05.03.2013, 13:32
Hi all again, im having a problem with respawncars and trailers. I set a timer for respawning all cars every 5 minutes, and the problem is, when a player have a trailer attached to his truck, the trailer is respawning.
My code is:
Can someone help?
My code is:
pawn Code:
forward VehicleOccupied(vehicleid);
public VehicleOccupied(vehicleid)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerInVehicle(i,vehicleid))
return 1;
}
return 0;
}
forward RespawnCars();
public RespawnCars()
{
for(new c = 0; c < MAX_VEHICLES; c++)
{
if(!VehicleOccupied(c))
{
SetVehicleToRespawn(c);
}
}
}