Quote:
Originally Posted by Madsen
okay
at the top:
pawn Код:
forward VehicleOccupied(vehicleid);
public VehicleOccupied(vehicleid) { for(new i=0;i<MAX_PLAYERS;i++) { if(IsPlayerInVehicle(i,vehicleid)) return 1; } return 0; }
i use zcmd here is the command
pawn Код:
CMD:respawnallvehicles(playerid, params[]) { for(new cars=0; cars<MAX_VEHICLES; cars++) { if(!VehicleOccupied(cars)) { SetVehicleToRespawn(cars); RepairVehicle(cars); } } return 1; }
|
At the command you are using (eg. /teleport):
pawn Код:
SetTimer("CarRespawn",10000,0); // Change the amount of milisecounds to what you need.
Anywhere :
pawn Код:
forward CarRespawn();
public CarRespawn()
{
for(new cars=0; cars<MAX_VEHICLES; cars++)
{
if(!VehicleOccupied(cars))
{
SetVehicleToRespawn(cars);
RepairVehicle(cars);
}
}
return 1;
}
All done.