Automatic respawn for unused vehicules.
#8

This should be works This only spawn used cars.
If you got errors. Then post here

pawn Код:
new setspawn[MAX_VEHICLES]; //on top

//OnGameModeInt
SetTimer( "RespawnVehicles", 5000, true); // Change '5000' to make a different delay

// After main( )
forward RespawnVehicles( );
public RespawnVehicles( )
{
    new vehicles[ MAX_VEHICLES ];
    for( new i = 0; i < MAX_PLAYERS; i ++ )
    {
        if( IsPlayerInAnyVehicle( i ) )
        {
            vehicles[ GetPlayerVehicleID( i ) ] = 1;
        }
    }

    for( new v = 0; v < MAX_VEHICLES; v ++ )
    {
        if( vehicles[ v ] == 1 && setspawn[v ] == 0 ) continue;
        SetVehicleToRespawn( v );
        setspawn[v ] = 0;
    }
    return 1;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    setspawn[vehicleid] = 1;
    return 1;
}
Reply


Messages In This Thread
Automatic respawn for unused vehicules. - by Kethrios - 22.01.2013, 08:34
Re: Automatic respawn for unused vehicules. - by _Mohit_ - 22.01.2013, 08:37
Re: Automatic respawn for unused vehicules. - by _Mohit_ - 22.01.2013, 08:40
Re: Automatic respawn for unused vehicules. - by Jewell - 22.01.2013, 08:44
Re : Automatic respawn for unused vehicules. - by Kethrios - 22.01.2013, 08:45
Re: Automatic respawn for unused vehicules. - by _Mohit_ - 22.01.2013, 08:45
Re: Automatic respawn for unused vehicules. - by Jewell - 22.01.2013, 08:47
Re: Automatic respawn for unused vehicules. - by Jewell - 22.01.2013, 09:00
Re : Re: Automatic respawn for unused vehicules. - by Kethrios - 22.01.2013, 09:14
Re: Automatic respawn for unused vehicules. - by Threshold - 22.01.2013, 09:15

Forum Jump:


Users browsing this thread: 1 Guest(s)