25.03.2007, 19:49
Just a small code to check if a player has a weapon or not or how many. You will need to replace all your GivePlayerWeapon with GivePlayerWeapon2.
Edit:This snippet will only be useful in 0.1. 0.2 already has a GetPlayerWeapon function.
Edit:This snippet will only be useful in 0.1. 0.2 already has a GetPlayerWeapon function.
pawn Код:
stock GivePlayerWeapon2(playerid,weapon,ammo)
{
Weapon[playerid]++;
return GivePlayerWeapon(playerid,weapon,ammo);
}
pawn Код:
if(Weapon[playerid]) // if he has a weapon
{
}
else // he doesn't
{
}
pawn Код:
if(Weapon[playerid] >= 2) // 2 or more weapons
{
}
else // less then 2 weapons
{
}