Respawn all cars
#1

Hey Does anyone knows how to make that it respawns all empty vehicles...also NOT-ATTACHED trailers...Cus current code respawns trailer if you have it attached or not..
pawn Код:
CMD:respawnallcars(playerid,params[])
{
    new sendername[30],string[60];    
    if(APlayerData[playerid][PlayerLevel] < 3) return SendClientMessage(playerid, 0xFF0000FF, "You are not authorized to use that command!");
        for(new car = 1; car <= 268; car++)
        {
            if(IsVehicleEmpty(car)) SetVehicleToRespawn(car);
        }
        GetPlayerName(playerid,sendername,sizeof(sendername));
        format(string, sizeof(string), "SERVER: All unused cars respawned by %s.", sendername);
        SendClientMessageToAll(0xFFFFFFFF,string);
        return 1;
}
 
stock IsVehicleEmpty(vehicleid)
{
        for(new i=0; i<MAX_PLAYERS; i++)
        {
                if(IsPlayerInVehicle(i, vehicleid)) return 0;
        }
        return 1;
}
Reply


Messages In This Thread
Respawn all cars - by wumpyc - 30.11.2011, 12:21
Re: Respawn all cars - by Kingunit - 30.11.2011, 12:23
Re: Respawn all cars - by wumpyc - 30.11.2011, 12:29
Re: Respawn all cars - by [MG]Dimi - 30.11.2011, 13:08
Re: Respawn all cars - by wumpyc - 30.11.2011, 13:08
Re: Respawn all cars - by [MG]Dimi - 30.11.2011, 13:13
Re: Respawn all cars - by wumpyc - 30.11.2011, 13:13
Re: Respawn all cars - by wumpyc - 30.11.2011, 13:24
Re: Respawn all cars - by Rafiko - 30.11.2011, 13:45
Re: Respawn all cars - by wumpyc - 30.11.2011, 14:16

Forum Jump:


Users browsing this thread: 1 Guest(s)