All vehicles Respawn
#5

Thanks Nero_3D. In a second thought, it loops more times that it should.

Here it is in case Sting. or someone else wants it:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (!strcmp(cmdtext, "/respawnall", true))
    {
        if (!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "You need to be RCON admin to use this command.");
       
        new
            bool: occupied_vehicle[MAX_VEHICLES char];
       
        foreach(new i : Player) occupied_vehicle{GetPlayerVehicleID(i)} = true;
        for (new v = 1; v != MAX_VEHICLES; ++v)
        {
            if (!GetVehicleModel(v) || occupied_vehicle{v}) continue;
            SetVehicleToRespawn(v);
        }
        return 1;
    }
    return 0;
}
Reply


Messages In This Thread
All vehicles Respawn - by Sting. - 06.06.2014, 19:37
Re: All vehicles Respawn - by Konstantinos - 06.06.2014, 20:03
Re: All vehicles Respawn - by Sting. - 06.06.2014, 20:23
AW: All vehicles Respawn - by Nero_3D - 06.06.2014, 20:31
Re: All vehicles Respawn - by Konstantinos - 06.06.2014, 20:49

Forum Jump:


Users browsing this thread: 4 Guest(s)