Taser
Turns GTA's taser (WEAPON_STUNGUN) into something closer to a modern police conducted-energy weapon. Two probe wires run from the taser to the target, the officer holds fire to keep shocking, and every second of current comes out of a battery on the taser. The tranquilizer pistol (WEAPON_STUNGUN_MP, GR1M_Research) is not touched.
#Install
- Add
taser_cartridgeandtaser_batterytoox_inventory/data/items.lua(the entries are ininstall/ox_inventory-items.lua). - Add
ensure GR1M_Taserafterox_inventoryandqbx_core. - Give officers a way to get cartridges and batteries (add the items to an armoury shop in ox_inventory, or your own shop script).
- Open
/taseradminand add a charging dock at each armoury (stand on the spot, name it, press Add Dock).
#Using it
- Fire as normal. A fresh taser holds a full cartridge (2 shots) and a full battery. A miss still uses a shot.
- If the probes land within the wire length (7.6 m), the wires connect and a 5 s shock starts. Keep holding the fire button to keep shocking. Letting go ends it at the end of the 5 s cycle, and pulling the trigger again starts a new one.
- The shock stops when the officer lets go or the battery runs flat. Staff can also cap a single hold.
- The wires snap if the target gets further away than the wire length or gets into a vehicle. They also come off if the officer puts the taser away, presses R, or the target pulls the probes out (E, between shocks).
- R, or using a Taser Cartridge, loads a new cartridge. Taser Battery swaps in a full battery. At a dock, an officer on an allowed job holds the taser out and presses E to charge.
- The battery meter shows bottom right whenever the taser is out.
/taseradminholds every setting plus the charging docks. It needs thegr1m.taser.adminorcommandace.
#How it works
The server owns every link. The client reports each shot, each hit and the fire button, and the server re-checks the taser in hand, the loaded shots, the battery and the distance. The server also cancels vanilla taser hits past the wire length, or on players or locals when staff make them immune.
A shock only ragdolls the target (a pulse every 0.4 s, sent to whoever owns the ped), so health is never touched and anticheats have nothing to flag. The tased player also gets the game's own taser screen effect.
Battery (taserBattery, 0-100) and loaded shots (taserShots) are saved on the taser's ox_inventory metadata, so they follow the weapon. Settings and docks are in the server KVP.
Every nearby client draws the wires as two sagging lines from the muzzle to the target's chest and hips, with sparks and a crackle (made in the NUI, no sound files) while the current runs.
GR1M