Help with respawning a particular set of vehicles.
#4

pawn Код:
new car = 17; car = 36; car = 37; car = 34; car = 35; car = 22; car = 31; car = 29; car = 30; car = 23; car = 18; car = 19; car = 20; car = 21; car = 24; car = 25; car = 26; car = 32; car = 33; car = 356; car = 357;
This is really useless, I assume that you wanted to so something else because the current code checks if the vehicleid 357 is not unwanted and it respawns it.

I'd store the vehicleids to an array and then simply:
pawn Код:
// Inside the /fvr command
for( new v = 0; v < MAX_VEHICLES; v++ )
{
    if( !IsVehicleOccupied( Vehicles[ v ][ PlayerInfo [playerid ][ pFaction ] ]  ) ) SetVehicleToRespawn( Vehicles[ v ][ [ PlayerInfo [playerid ][ pFaction ] ] );
}

stock IsVehicleOccupied( vehicleid )
{
    for( new i = 0; i < MAX_PLAYERS; i++)
    {
        if( IsPlayerInVehicle( i, vehicleid ) ) return 1;
    }
    return 0;
}
Reply


Messages In This Thread
Help with respawning a particular set of vehicles. - by DanishHaq - 08.08.2013, 19:21
Re: Help with respawning a particular set of vehicles. - by arjanforgames - 08.08.2013, 20:13
Re: Help with respawning a particular set of vehicles. - by DanishHaq - 08.08.2013, 20:16
Re: Help with respawning a particular set of vehicles. - by Konstantinos - 08.08.2013, 20:24

Forum Jump:


Users browsing this thread: 1 Guest(s)