This is part of a plugin where a person has 30 seconds to choose there weapon in the beginning of the round. But I can NOT seem to get the timer to work PLEASE HELP...
PHP Code:
ShowGunsVoteMenu(id) {
new menu[256];
new bool:prev = (g_guns_vote_menu[id] >= 1);
new bool:next = ((g_guns_vote_menu[id] * 7 + 7) < g_guns_count);
new len = 0;
new keys = 0;
len += formatex(menu[len], charsmax(menu), "\yVote for a gun \w[\r%s\w]^n^n", g_new_file, iTimer);
for(new i = 0; (i < 7) && ((g_guns_vote_menu[id] * 7 + i) < g_guns_count); i++) {
len += formatex(menu[len], charsmax(menu), "\r%d. \w%s^n", (i + 1), g_guns_names[g_guns_vote_menu[id] * 7 + i]);
keys |= (1 << i);
}
len += formatex(menu[len], charsmax(menu), "^n\r8. %sPrevious^n", prev ? "\w" : "\d");
keys |= (prev ? B8 : 0);
len += formatex(menu[len], charsmax(menu), "\r9. %sNext^n^n", next ? "\w" : "\d");
keys |= (next ? B9 : 0);
len += formatex(menu[len], charsmax(menu), "\r0. \wNone^n");
keys |= B0;
show_menu(id, keys, menu, -1, "GunGunsVoteMenu");
}
public task_Timer(iTimer[])
{
if(iTimer[0] > 0 || iTimer[1] > 0)
{
if(iTimer[0] == 0)
{
iTimer[1]--;
iTimer[0] = 29;
}
else
{
iTimer[0]--;
}
}
}
iTimer()
{
new iTimer[2];
iTimer[0] = (iTotal % 30);
iTimer[1] = (iTotal - iTimer[0]) / 30;
task_Timer(iTimer);
}
__________________