This functionality is automatically provided by the
_hooks/sv_policeonly.lua hook (in case you want to edit it). You just need to mark your weapons as police-only.Step-by-step guide
1
Open the items file
Open your server files and navigate to:
jaksam_inventory/_data/items.lua2
Find or create the weapon
Find the weapon item you want to protect (or create it if it doesn’t exist).
3
Mark it as police-only
Add
policeOnly = true to the item definition.4
Restart
Save the file and restart the script/reload the server.
Examples
Example 1: Combat Pistol
Example 2: Stun Gun
How it works
Thesv_policeonly.lua hook automatically checks every time someone tries to move a weapon with policeOnly = true to a player inventory. If the player doesn’t have the “police” job, the transfer is blocked and they see an error message.
