11.08.2015, 08:07
You'd write this function in a way likу this:
And then, where its needed, you can output message if player has any weapon:
Also, I cannot see any problem with your function.
PHP код:
Check_Weapons(playerid)
{
new weaponid, ammo;
for(new i = 0; i < 13; i++)
{
GetPlayerWeaponData(playerid, i, weaponid, ammo);
if(weaponid > 0) // here was > 1 but brass knuckles are weapon too
{
return 1; // No message here
}
}
return 0;
}
PHP код:
if(Check_Weapons(playerid) == 1)
{
SendClientMessage(playerid, -1, "has weapons");
return 1;
}