Respawn All Empty Cars
#2

Code:
RespawnEmptyCars();
public RespawnEmptyCars()
{
for(new i=0; i<MAX_VEHICLES; i++)
{
for(new pl = 0; pl<MAX_PLAYERS; pl++)
{
if(IsPlayerConnected(pl))
{
if(!IsVehicleInUse(i))//if(!IsPlayerInVehicle(pl, i))
{
SetVehicleToRespawn(i);
}
}
}
}
}
Edit:
Code:
stock IsVehicleInUse(vehicleid)
{
    for(new i=0; i<GetMaxPlayers(); i++)
    {
        if(IsPlayerConnected(i))
        {
            if(GetPlayerVehicleID(i) == vehicleid)
            return true;
        }
    }
    return false;
}
you need both to work
Reply


Messages In This Thread
Respawn All Empty Cars - by wouter0100 - 24.08.2010, 19:34
Re: Respawn All Empty Cars - by boelie - 24.08.2010, 19:49
Re: Respawn All Empty Cars - by wouter0100 - 24.08.2010, 20:19
Re: Respawn All Empty Cars - by boelie - 24.08.2010, 20:24
Re: Respawn All Empty Cars - by Finn - 24.08.2010, 20:32
Re: Respawn All Empty Cars - by wouter0100 - 24.08.2010, 20:33

Forum Jump:


Users browsing this thread: 1 Guest(s)