08.03.2016, 17:56
Here is the code,
My problem:
When it respawns the vehicles it respawns trailers that are being used at the moment and connected to a truck.Can someone help me out with this? PLEASE !!!
P.S Dont give me any thread links...
PHP код:
#define RESPAWN_TIME 20 // Twenty minutes
public OnGameModeInit() {
SetTimer("VehicleRespawn", RESPAWN_TIME * 60000, 1);
return 1;
}
forward VehicleRespawn();
public VehicleRespawn() {
for(new i = 0; i < MAX_VEHICLES; i ++ ) {
for(new o = 0; o < GetMaxPlayers(); o ++ ) {
if(!IsPlayerConnected(o)) continue;
if(IsAnyBodyInVehicle(i)) continue;
SetVehicleToRespawn(i);
}
}
return 1;
}
stock IsAnyBodyInVehicle(vid) {
for(new i = 0; i < GetMaxPlayers(); i ++ ) {
if(IsPlayerInVehicle(i, vid)) return 1;
}
return 0;
}
When it respawns the vehicles it respawns trailers that are being used at the moment and connected to a truck.Can someone help me out with this? PLEASE !!!

P.S Dont give me any thread links...