Help me about Ammo
#1

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)
Reply
#2

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);
Reply
#3

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); 
Reply
#4

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)