SA-MP Forums Archive
Blocking weapons? - 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: Blocking weapons? (/showthread.php?tid=515747)



Blocking weapons? - geohareas - 27.05.2014

Hey,

I was wondering if there is a way to block a weapon from shooting,I mean, having the weapon on your hands but not shooting or something like this. Impossible?

Thanks in advance


Re : Blocking weapons? - S4t3K - 27.05.2014

It is.

Check when the player fires (basically under OnPlayerKeyStateChange), and check the weapon he is holding through GetPlayerWeapon.
If it's one of the weapons you want to block, then simply ClearAnimation on the player.


Re: Blocking weapons? - geohareas - 27.05.2014

Would you mind giving me an example? Let's say that the weapon id is 32 and the key is ctrl.


Re: Blocking weapons? - Fredrik - 27.05.2014

Hi! I don't know if you can block it, but I know that you can disable them from causing damage!
Try looking here:
https://sampwiki.blast.hk/wiki/OnPlayerWeaponShot

Hope you figure it out!