Quote:
Originally Posted by Carlton
@Armada
pawn Код:
#define RESPAWN_TIME 20 // Twenty minutes #define RESPAWN_MESSAGE_TIME 2 //Minutes before the respawn
public OnGameModeInit() { SetTimer("VehicleRespawn", RESPAWN_TIME * 60000, 1); SetTimer("VehicleRespawnMessage", (RESPAWN_TIME-RESPAWN_MESSAGE_TIME) * 60000, 0) 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); } } SetTimer("VehicleRespawnMessage", (RESPAWN_TIME-RESPAWN_MESSAGE_TIME) * 60000, 0) return 1; }
stock IsAnyBodyInVehicle(vid) { for(new i = 0; i < GetMaxPlayers(); i ++ ) { if(IsPlayerInVehicle(i, vid)) return 1; } return 0; }
forward VehicleRespawnMessage(); public VehicleRespawnMessage() { //Message return 1; }
|
I edited the code from Carlton for your needs