SA-MP Forums Archive
How can i do a limit to shot ?.. - 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: How can i do a limit to shot ?.. (/showthread.php?tid=561975)



How can i do a limit to shot ?.. - Metharon - 06.02.2015

How can i make if



PlayerInfo[playerid][WeaponSkills] == 1) Wait 10 seconds before new shot
PlayerInfo[playerid][WeaponSkills] == 2) Wait 7 seconds before new shot
PlayerInfo[playerid][WeaponSkills] == 3) Wait 4 seconds before new shot
PlayerInfo[playerid][WeaponSkills] == 4) Wait 2 seconds before new shot


? ...

I don't want to do with ClearAnimations ... for example i would use that animation for gun reload , but how ? i mean how i can do that animation before the fire shot


Re: How can i do a limit to shot ?.. - Sime30 - 06.02.2015

Hmm, you could do something like - When player with a weapon skill of 1 shoot with a gun, set armed weapon to fists for the next 10 seconds(timer) or you could make that he CAN shoot but all his bullets will deal zero damage until the timer is killed


Re: How can i do a limit to shot ?.. - HazardouS - 06.02.2015

It's not so efficient to try and block the animation. You can just set the gun damage to 0 if he is not supposed to deal damage. Check out this callback: https://sampwiki.blast.hk/wiki/OnPlayerWeaponShot
Returning 0 in there prevents the bullet from doing damage. Of course, you will need a timer to set players ability to shoot to true or false.