SA-MP Forums Archive
Help me about Ammo - 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: Help me about Ammo (/showthread.php?tid=595026)



Help me about Ammo - Bumie - 27.11.2015

My server is using game mode of NGG, And I have edit the command give gun to limit the ammo of weapon

But :
- When player enter, get out of the car, The weapon will be full ammo.
- Exit the arena (paintball). The weapon will be full ammo.
- Example I have 7 ammo in Deagle, when I /q [log out the game] and reconnected, The ammo will full.
- How to save the ammo of player (If have 7 bullet in deagle, and 30 bullet in M4A1. If log in next time, it will recover).
Help me fix this Thank you (y)


Re: Help me about Ammo - IzadorO - 27.11.2015

Save the ammo variables under OnPlayerDisconnect, and set them where ever the rest of the data is retrieved and set. Then simply use SetPlayerAmmo(playerid, weapon, ammovariable);


Re: Help me about Ammo - Bumie - 27.11.2015

Quote:
Originally Posted by IzadorO
Посмотреть сообщение
Save the ammo variables under OnPlayerDisconnect, and set them where ever the rest of the data is retrieved and set. Then simply use SetPlayerAmmo(playerid, weapon, ammovariable);
I think I will add like you said, this my result, isn't it correct ?
PHP код:
at onplayerdisconect
GetPlayerAmmo
(playerid);
at onplayerload
SetPlayerAmmo
(playeridweaponammovariable); 



Re: Help me about Ammo - TwinkiDaBoss - 27.11.2015

Use GetPlayerWeaponData
pawn Код:
https://wiki.sa-mp.com/wiki/GetPlayerWeaponData
Here is an example how to save it
pawn Код:
http://forum.sa-mp.com/showthread.php?t=505081