15.12.2017, 08:08
This is my code for the dm event system:
Thing here is, it doesn't unfreeze players.
Код:
public AtriDmStartTime() { new string[30]; DmEventCountDown--; if(DmEventCountDown == 30) { SendClientMessageToAll(0x00FF00FF, "[EVENT]: {FFFFFF}Only 30 seconds left, /join before event starts."); } for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(IsPlayerInEvent[i] == true) { if(DmEventCountDown > 0) { format(string, sizeof(string), "Time Left: %d", DmEventCountDown); GameTextForPlayer(i, string, 5000, 3); } else if(DmEventCountDown == 0) { if(PlayersJoinedEvent <= 1) { SendClientMessageToAll(0xFF0000AA, "[EVENT]: {FFFFFF}The event has been cancled, Not enough players!"); IsPlayerInEvent[i] = false; PlayersJoinedEvent = 0; AtriDM = 0; SetPlayerHealth(i, 0); DmEventCountDown = 60; SetPlayerInterior(i, 0); DmEventTimerVar = SetTimer("DmEventT", 1800000, false); KillTimer(Event1SecT); } else if(PlayersJoinedEvent > 1 && IsPlayerInEvent[i] == true) { SendClientMessage(i, 0x00FF00AA, "[EVENT]: {FFFFFF}You have been unfrozen, be the last man standing to win the prize!"); TogglePlayerControllable(i,1); GameTextForPlayer(i, "~w~Event ~g~Started", 5000, 3); DmEventCountDown = 60; AtriDM = 2; KillTimer(Event1SecT); } } } } } return 1; }