How do you check if a player has ANY weapons?
#4

You'd write this function in a way likу this:
PHP код:
Check_Weapons(playerid)
{
    new 
weaponidammo;

    for(new 
013i++)
    {
        
GetPlayerWeaponData(playeridiweaponidammo);
        
        if(
weaponid 0// here was > 1 but brass knuckles are weapon too
        
{
            return 
1// No message here
        
}
    }

    return 
0;

And then, where its needed, you can output message if player has any weapon:
PHP код:
if(Check_Weapons(playerid) == 1)
{
    
SendClientMessage(playerid, -1"has weapons");
    return 
1;

Also, I cannot see any problem with your function.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)