SA-MP Forums Archive
Car respawning. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Car respawning. (/showthread.php?tid=459244)



Car respawning. - ThaCrypte - 21.08.2013

Well, currently i have this as a timer (because when you type the cmd, the timer get's activated).
pawn Код:
forward RespawnTimer();
public RespawnTimer()
{
    for(new i = 1; i <= MAX_VEHICLES; i++)
    {
        SetVehicleToRespawn(i);
    }
}
But the problem is that even when a player is in a vehicle, it still respawns. so the player will fall in of the air and stuff like that.
How can i fix that?


Re: Car respawning. - JimmyCh - 21.08.2013

pawn Код:
forward RespawnTimer();
public RespawnTimer()
{
        new bool:VehicleUsed[MAX_VEHICLES] = false;
        foreach(Character, i)//for(new i = 0; i < MAX_PLAYERS; i++)
        {
        if(IsPlayerInAnyVehicle(i)) VehicleUsed[GetPlayerVehicleID(i)] = true;
        }
        for(new i = 0; i < MAX_VEHICLES; i++)
        {
        if(VehicleUsed[i] == false) SetVehicleToRespawn(i);
        }
}



Re: Car respawning. - ThaCrypte - 21.08.2013

Quote:
Originally Posted by JimmyCh
Посмотреть сообщение
pawn Код:
forward RespawnTimer();
public RespawnTimer()
{
        new bool:VehicleUsed[MAX_VEHICLES] = false;
        foreach(Character, i)//for(new i = 0; i < MAX_PLAYERS; i++)
        {
        if(IsPlayerInAnyVehicle(i)) VehicleUsed[GetPlayerVehicleID(i)] = true;
        }
        for(new i = 0; i < MAX_VEHICLES; i++)
        {
        if(VehicleUsed[i] == false) SetVehicleToRespawn(i);
        }
}
Nice man, it worked