15.03.2013, 12:14
pawn Код:
#define RESPAWN_TIME 3
OnGamemodeInit()
{
SetTimer("VehicleRespawn", RESPAWN_TIME * 50000, 1);
return 1;
}
forward VehicleRespawn();
public VehicleRespawn() {
GameTextForAll("~b~Vehicles~r~Respawn~w~!!!",4000,6);
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;
}