Car respawning.
#1

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?
Reply
#2

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);
        }
}
Reply
#3

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)