Clear cars but only the ones abandoned
#2

pawn Код:
if(strcmp(cmdtext,"/clearcars")==0)
    {
        if(!IsPlayerAdmin(playerid))return SendClientMessage(playerid,magenta,"This command is not avaliable to you!");
        {
                SendClientMessageToAll(denim,"[SYSTEM]: All cars have been deleted!");
                for(new veh;veh < MAX_VEHICLES; veh++)
                {
                        if(!IsVehicleInUse(veh)) DestroyVehicle(veh);
                }
        }
        return 1;
    }
Then add this somewhere:
pawn Код:
stock IsVehicleInUse(vehicleid)
{
    for(new i=0; i<GetMaxPlayers(); i++)
    {
        if(IsPlayerConnected(i))
        {
            if(GetPlayerVehicleID(i) == vehicleid)
            return true;
        }
    }
    return false;
}
Credits to whoever made the stock I think it's Sacky.
Reply


Messages In This Thread
Clear cars but only the ones abandoned - by kin - 11.01.2011, 02:07
Re: Clear cars but only the ones abandoned - by _rAped - 11.01.2011, 02:13
Re: Clear cars but only the ones abandoned - by kin - 13.01.2011, 17:55

Forum Jump:


Users browsing this thread: 1 Guest(s)