14.03.2012, 07:02
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.
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;
}