SA-MP Forums Archive
Question about Out of Ammo (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: Question about Out of Ammo (Weapons) (/showthread.php?tid=454255)



Question about Out of Ammo (Weapons) - ToiletDuck - 28.07.2013

When the your weapons is out of ammo it will stay on your character the weapons will not disappear how can i do that?


Re: Question about Out of Ammo (Weapons) - JimmyCh - 28.07.2013

I don't think there is any possible way to do that, well you see when your ammo is 0, it directly removes your weapon.
I can suggest something though, when the ammo is 1, save the weapon to the character, this will do just what you need..


Re: Question about Out of Ammo (Weapons) - ToiletDuck - 28.07.2013

Quote:
Originally Posted by JimmyCh
Посмотреть сообщение
I don't think there is any possible way to do that, well you see when your ammo is 0, it directly removes your weapon.
I can suggest something though, when the ammo is 1, save the weapon to the character, this will do just what you need..
i think its possible, then how can i do that when your weapon is 1 ammo you cant fire you gun.


Re: Question about Out of Ammo (Weapons) - JimmyCh - 28.07.2013

To be honest, when you got 1 ammo, you won't even realise it and just fire it, that can be sure with M4 for example..
Well I can't really search on ****** for a way to disable shooting with a weapon(Slow internet at the moment), but if you do find something, you can do the following:
pawn Код:
if(GetPlayerAmmo(playerid) == 1)
{
//something here to stop shooting or something
}
I hope you get the idea..

EDIT:
I got an idea how to do that, you can do like when he presses KEY_FIRE, and if the ammo is 1, do that carry animation of the weapon.