Attached is ava_ts.inc, which includes the following functions for The Specialists 2.1:
ts_get_user_tsgun
gets the entity index of the player's weapon_tsgun.
ts_set_weapon_clip
sets the amount of ammo in clip for a player's weapon.
ts_set_weapon_ammo
sets the amount of backpack (not in clip) ammo for a player's weapon.
ts_set_weapon_rof
sets the rate of fire for a player's weapon.
ts_set_weapon_extras
sets the extras of a player's weapon.
ts_get_weapon_info
like ts_getuserwpn, except that you can specify a weapon to get information about, so as to grab info of weapons not currently drawn.
ts_get_user_weapons
the TS equivalent to AMXx's base get_user_weapons.
ts_set_weapon_ready
sets whether a weapon is "ready" or not.
The include itself contains more documentation. Note that this requires tsx/tsfun and fakemeta to use.
TS can only display a number as high as 216 (-ish) for the clip display, and there is probably a limit on the backpack ammo display as well. Although only certain numbers can be displayed, the actual amount of bullets can be much more.
Silencers on weapons that don't normally have them will make the gunfire sound extremely quiet or non-existant. Lasersights on weapons that don't normally have them will work, but won't point in the correct direction. Flashlights on weapons that don't normally have them work perfectly. You can't add scopes to weapons that don't normally have them.
Custom rates of fire work across all weapons. Pump-action on non-pump-action shotguns acts like full-auto. Burst fire does not work on pump-action shotguns (they won't fire at all). Free semi on non-akimbo weapons acts like semi-auto. Free full on non-akimbo weapons acts like full-auto. Besides those exceptions, all rates of fire work on all weapons. Also, of course, you can't change ROF on weapons that don't normally have a ROF anyway (grenades, knives, katanas, etcetera).
Messages are by default sent as emessages, so watch out for recursive functions (ie: calling one of these functions in a WeaponInfo hook). This is so that AMXx receives the new values, for when someone calls ts_getuserwpn. The last parameter of functions that send HUD messages controls whether or not to send as an emessage or regular message. See the include for full details.
Tested on a Windows 32-bit server. I have no clue as to the offset for 64-bit servers, and I'm not 100% sure that my Linux +4 offset is correct. If a Linux server op could test this for me I would be extremely grateful.
Avalanche's TS Weapon Functions BETA V v3
- Archive-Poster
- Posts: 1229
- Gender:

Avalanche's TS Weapon Functions BETA V v3
- Attachments
-
- ava_ts.zip
- (4.77 KiB) Downloaded 16 times
Who is online
Users browsing this forum: No registered users and 2 guests