/respawnallcars
#5

pawn Код:
CMD:vrespawn(playerid, params[])
{
    new sec,string[128];
    if(sscanf(params,"i",sec)) return SendClientMessage(playerid, red, "USAGE:/vrespawn [seconds]");
    SetTimer("vrespawn", sec*1000, false);
    format(string, sizeof(string), "~All currently unoccupied vehicles will respawn in %d seconds.",sec);
    SendClientMessageToAll(COLOR_ORANGE, string);
    return 1;
}

forward vrespawn();
public vrespawn()
{
    new u[MAX_VEHICLES];
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerInAnyVehicle(i)) u[GetPlayerVehicleID(i)]=1;
    }
    for(new i;i<MAX_VEHICLES;i++)
    {
        if(u[i] != 1) SetVehicleToRespawn(i); else continue;
    }
    SendClientMessageToAll(COLOR_ORANGE, "~All vehicles have been respawned.");
    return 1;
}
respawn with timer
Reply


Messages In This Thread
/respawnallcars - by SomebodyAndMe - 11.12.2011, 10:46
Re: /respawnallcars - by Ash. - 11.12.2011, 11:06
Re: /respawnallcars - by suhrab_mujeeb - 11.12.2011, 11:07
Re: /respawnallcars - by SomebodyAndMe - 11.12.2011, 11:25
Re: /respawnallcars - by THE_KNOWN - 11.12.2011, 11:27
Re: /respawnallcars - by Ash. - 11.12.2011, 11:58
Re: /respawnallcars - by SomebodyAndMe - 11.12.2011, 19:25
Re: /respawnallcars - by SnG.Scot_MisCuDI - 11.12.2011, 19:36
Re: /respawnallcars - by Kostas' - 11.12.2011, 19:38
Re: /respawnallcars - by suhrab_mujeeb - 12.12.2011, 09:25

Forum Jump:


Users browsing this thread: 2 Guest(s)