Hello there,
My timer is bugged, possibly because im using a loop that when the timer hits 0 that everyone opens the menu. Now for example 2 players are connected to my server its going from 15 to 13 to 11 so on but when im alone its going 15 14 13 so on. heres my little code
PHP Code:
public KickMenu3(id)
{
// timer
Timer = 15
// sound
client_cmd(0, "spk misc/bilalvote.wav")
// menu
KickMenu4(id)
KickMenu6(id)
return PLUGIN_CONTINUE
}
public KickMenu4(id)
{
if(task_exists(TASKID))
remove_task(TASKID)
set_task(1.0, "KickMenu5", TASKID, _, _, "a", Timer)
}
public KickMenu5(id)
{
new players[32], iNum
get_players(players, iNum, "ch")
for (new i; i <iNum; i++)
{
if (Timer == 0)
{
EndVote(players[i])
}
else
{
KickMenu6(players[i])
}
}
return PLUGIN_CONTINUE
}
By the way if im trying to use for example: KickMenu6(id), i will get a server crash. Thats why i used a loop!
__________________