Jump to content

Question

4 answers to this question

Recommended Posts

Posted

CMD:vrespawn(playerid, params[])

{

    new sec,string[128];

    if(sscanf(params,"i",sec)) return SendClientMessage(playerid, COLOR_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 != 1) SetVehicleToRespawn(i); else continue;

    }

    SendClientMessageToAll(COLOR_ORANGE, "~All vehicles have been respawned.");

    return 1;

}

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.