TS Random Weapons

Here, you can acquire assets to use with Natural Selection or find information about them.
User avatar
Archive-Poster
Posts: 1090
Gender:
United States of America

TS Random Weapons

Post by Archive-Poster »

True random weapons AMXX plugin for Half-Life mod, "The Specialists" - Updated to version 1.4

I requested a plugin like this on both amx and amxx, but since no-one was keen to code it, I eventually did it myself. Unlike the standard TS random weapons function, this one is forced, and is truly random. Just spawn and you will receive your guns.

Features:
-Forces player to take a random number of guns (to a maximum of your choosing).
-Each gun they receive is also a random selection.
-50/50 chance of players receiving a random set of attachments for each gun (ie silencer, lasersight etc).
-Relative chance of no guns at all (ie Kung-fu only).

Usage:
-requires TSX, TFUN & ENGINE modules
cvars:
amx_randomweapons <Max Weapons|0> Give players random weapons, maximum no. given in the setting (1 by default)
amx_randomattachments <1|0> Give players random attachments (off by default)
amx_randomrestrictions <Restriction|0> Restricts the weapon pool to certain groups
amx_randomkungfu <1|0> Give players relative chance of kung fu (off by default)

Possible amx_weaponrestriction settings:

0: All Weapons
1: Kung-Fu only
2: Melee only
3: Pistols & Melee
4: Pistols & Shotguns & Melee
5: Pistols only (no melee)
6: Shotguns only (no melee)
7: Rifles only (no melee)
8: Sub-machineguns only (no melee)
9: Pistols & Shotguns only (no melee)
10: Shotguns & Rifles only (no melee)
11: Rifles and Sub-machineguns only (no melee)
12: All Weapons (Excluding Melee & Grenade)
13: All Weapons (Excluding Melee)
14: All Weapons (Excluding Grenade)

I recommend you set weaponrestriction to 1, but it will work fine without it.
If you turn randomweapons off, you'll have to reset weaponrestriction to the value you want, since the plugin will change it to 1 when it's running.

Thanks to eskimobob, darkpast, Sphericus and o_OR4N^_^ for their assistance in playtesting

Changelog:

version 1.4(31/3/06)
-cleaned up code (no more magic numbers, changed if/else set to switch)
-generalised give_powerup function
-added akimbo mini uzi (was missing from last version)

version 1.3 (18/11/05)
-additional weapon restrictions
-updated for AMXX 1.60
-readded Kung-Fu powerup (Thanks to AssKicR for use of his powerup-spawning code)

version 1.2 (15/7/05)
-removed single knife sets
-added cvar to turn off getting kung-fu as a weapon
-added cvar to turn off randomized attachments
-changed amx_randomweapons to specify the maximum number of guns given to a player

version 1.1 (26/5/05)
-removed kung-fu powerup for kung-fu only
-added weapon restrictions (group restrictions like TS default)
-changed akimbo guns and different knife holdouts to be seperate weapons

version 1.0 (2/2/05)
-release
Attachments
randomweapons.sma
(10.71 KiB) Not downloaded yet

Who is online

Users browsing this forum: No registered users and 0 guests