Timer that deletes a vehicle (no driver) problem...
#1

i have made Vehicle Updating delete system to avoid respawning vehicles back from their spawned position
suddenly i notice that my server vehicles are also delete too. how to avoid to do that? i use
create vehicle native function for /v and for /acar. here is the code.

pawn Код:
new DeleteUpdate;
DeleteUpdate = SetTimer("DeleteVehicles", 21000, true);

forward DeleteVehicles();
public DeleteVehicles()
{
    for(new veh = 0; veh < MAX_VEHICLES; veh++)
    {
        if(!VehicleOccupied(veh))
        {
            DestroyVehicle(veh);
        }
    }
    return 1;
}

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


Messages In This Thread
Timer that deletes a vehicle (no driver) problem... - by Reklez - 14.03.2012, 07:02
Re: Timer that deletes a vehicle (no driver) problem... - by Daddy Yankee - 14.03.2012, 09:48
Re: Timer that deletes a vehicle (no driver) problem... - by HighPitchedVoice - 14.03.2012, 10:08
Re: Timer that deletes a vehicle (no driver) problem... - by TTJJ - 14.03.2012, 10:12

Forum Jump:


Users browsing this thread: 1 Guest(s)