19.02.2015, 06:00
So yeah.
OnGameModeInit
What could be wrong?
OnGameModeInit
Code:
// Timers SetTimer("KillUpdate", 1000, true); //this one doesn't give me problems SetTimer("OnServerUpdate", 1, true); //this one either SetTimer("GMX", 10000, true); //This one won't work. I'm using 10 secs just to see if it works but it's meant to be 15 mins
Code:
public KillUpdate() { new string[128]; format(string, sizeof(string), "Army: %d", T1Kills); TextDrawSetString(Kill1, string); format(string, sizeof(string), "Rebels: %d", T2Kills); TextDrawSetString(Kill2, string); GameSec--; if(GameSec<=-1) { GameMin--; GameSec=59; } return 1; } forward OnServerUpdate(); public OnServerUpdate() { new String[1000]; format(String,sizeof(String),"%02d:%02d",GameMin, GameSec); TextDrawSetString(Watch,String); } public GMX() { print("Hello World!"); SetTimer("GMX2", 10000, false); TextDrawDestroy(Watch); if(T1Kills > T2Kills) { for(new i=0;i<MAX_PLAYERS;i++) { if(gTeam[i] == T1) { GameTextForPlayer(i, "You Won! When is the party?", 4000, 3); SetPlayerScore(i, GetPlayerScore(i) + 1); GivePlayerMoney(i, 2000); } else { GameTextForPlayer(i, "You brought Disgrace!You LOST!", 4000, 3); } } } else if(T2Kills > T1Kills) { for(new i=0;i<MAX_PLAYERS;i++) { if(gTeam[i] == T2) { GameTextForPlayer(i, "You Won! When is the party?", 4000, 3); SetPlayerScore(i, GetPlayerScore(i) + 1); GivePlayerMoney(i, 2000); } else { GameTextForPlayer(i, "You brought Disgrace!You LOST!", 4000, 3); } } } else if(T1Kills == T2Kills) { GameTextForAll("Round Draw!", 4000, 3); } return 1; } forward GMX2(); public GMX2() { SendRconCommand("gmx"); return 1; }