Disable weapon change - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Disable weapon change (
/showthread.php?tid=619056)
Disable weapon change -
HidroDF - 13.10.2016
Hello!
I want to limit the players to hold only one weapon. I want to disable the Q/E keys and mousewheeel to change weapons. There's an easy way to do it?
Thanks!
Re: Disable weapon change -
azzerking - 13.10.2016
Information
You can't disable keys, but what you can do. Is have a variable that holds the current weapon and
OnPlayerUpdate you can check if their current weapon is the same as the variable and if not, you can then use
SetPlayerArmedWeapon and force it.
Re: Disable weapon change -
Gotham - 13.10.2016
The answer is simple just give them the weapon you want only...If you had many weaps in AddPlayerClass just simply reset the player weapons using
ResetPlayerWeapons
and then use
GivePlayerWeapon