Player 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: Player Weapons (
/showthread.php?tid=380009)
Player Weapons -
GXLZPGX - 23.09.2012
How would I go about checking if a player has a specific weapon, and if they have that weapon, check how much ammo it has?
Re: Player Weapons -
TheArcher - 23.09.2012
This will answer to whole the question.
Re: Player Weapons -
GXLZPGX - 23.09.2012
Quote:
Originally Posted by TheArcher
This will answer to whole the question.
|
Alright, so I've managed to get the players weapon (thanks to you), but the function GetPlayerAmmo and SetPlayerAmmo only works for the players active weapon slot, how could I get/set the ammo of a specific weapon slot without making it active?
Edit: I know how to retrieve ammo from inactive weapon slots, but how do I set them?
Second Edit: I'm an idiot, thanks.
Re: Player Weapons -
Squirrel - 23.09.2012
Here you go
pawn Код:
new ammo = GetPlayerAmmo(playerid);
SetPlayerAmmo(playerid, GetPlayerWeapon(playerid), ammo);