Check if player has gun ?
#1

Code:
new PlayerGun[MAX_PLAYERS][47];


public CheckIfPlayerHasGun(playerid);
{
for(new j=0; j<47; j++)
{
     new wep1, ammo1;
     GetPlayerWeaponData(playerid, GetWeaponSlot(j), wep1, ammo1);
     if(wep1 != j)
     {
           PlayerGun[playerid][j] = 0;
     }
}
}
Does this is a good way to check if player has gun?
IMPORTANT: not to check if player has gun in arm like(GetPlayerWeapon) i want to check all player weapons.
Reply
#2

pawn Code:
for(new j;j<=12;j++)
{
     new wep1, ammo1;
     GetPlayerWeaponData(playerid,j,wep1,ammo1);
     if(wep1) return true;
}
return false;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)