03.11.2012, 18:29
Hello, i made a map vote for my server but after the 20 seconds the vote take, i got bugged, and idk why, this is the code:
Код:
public Tick() { ticked++; new ticktime = MAX_TIME-ticked, tempticktime = ticktime, minutes = 0; while(tempticktime > 59) { minutes++; tempticktime = tempticktime-60; } format(str, sizeof(str), "%02d:%02d", minutes, tempticktime); TextDrawSetString(TimeText, str); if(ticktime == 0) { ticked = 0; KillTimer(countdowntimer); for(new i=0;i<MaxPlayers;i++) { ShowPlayerDialog(i, 1, DIALOG_STYLE_LIST, "Choose a map for next round", "zm_mountain\nzm_army2", "Register", "Leave"); SetTimer("Vote", 20000, 0); } } } forward Vote(); public Vote() { countdowntimer = SetTimer("Tick", 1000, true); for(new i=0;i<MaxPlayers;i++) { if(vote1 >= vote2) { SetPlayerPos(i, 162.89999389648, 83.1000976563, 52.400001525879); map = 1; } if(vote2 > vote1) { SetPlayerPos(i, 3156.6999511719, -1518.3000488281, 10.89999961853); map = 2; } } }