Player value problem
#1

Why the m4a1ammo[playerid] is always 0 ?
PHP код:
new ammo GetPlayerAmmo(playerid);
                
m4a1ammo[playerid] = ammo;
             if(
GetPlayerWeapon(playerid) == 31AddItem(playerid,"M4A1",ammo) && RemovePlayerWeapon(playerid31);
             } 
This works perfectly, but when i try to give the gun
PHP код:
GivePlayerWeapon(playerid31m4a1ammo[playerid]); 
It gives M4a1 with 0 ammo
Reply
#2

pawn Код:
new M4A1Ammo = GetPlayerAmmo(playerid);
if(GetPlayerWeapon(playerid) == 31) AddItem(playerid,"M4A1",ammo) && RemovePlayerWeapon(playerid, 31);
             }
Reply
#3

regarding GetPlayerAmmo, wiki says
Quote:
Originally Posted by wiki.sa-mp.com
Gets the amount of ammo in a player's current weapon.
meaning if youre, for example, holding the fists, GetPlayerAmmo will return 0.
so check the weapon slot, for the correct weapon, before you get the ammo.
Reply
#4

Can you guys help me ?I want in one command to store the weapon in inventory and in second to get it in my hands.
Reply
#5

Try this

Код:
GivePlayerWeapon(playerid, 31,0  m4a1ammo[playerid]);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)