Hey guys
I have an array, that fills every cell with each player that connects, gives him his timeleft and sets that he is not ready (false). Now, I did a code that before a pug starts it shows who's not ready in a hudmessage column, that updates every 1 seconds. The problem is that it shows in the Not Ready list the server's name only and nobody else. could someone please tell me why is that? I'll post the public of client_connect so people would see that when client connects he gets a false in the boolean if he's ready or not, only when he types .ready it sets it to true but thats not relevant to the topic. So here's the code:
PHP Code:
/* GLOBAL Variables in this code */
new bool:g_bIsReady[11]
new g_iTimeLeft[11]
new notrdy[200] = "Not Ready:"
/* GLOBAL Variables in this code */
public client_connect(id)
{
new pug = fopen(pug_ini_file, "r")
new getchar
fseek(pug, -1, SEEK_END)
getchar = fgetc(pug)
if (getchar == '0')
{
g_bIsReady[id] = false /* LOOK HERE - THINK AS IF IT PASSES THE 'IF' AND DONT ASK ME WHAT IT DOES, CUZ IT DOES PASS IT AND IM 100 PRECENT SURE CUZ I TESTED IT. look it gives a client who connects that he's false of being ready, which is relevant to my issue. */
remove_task(id)
g_iTimeLeft[id] = 140
set_task(10.0, "Continue", id, .flags="a", .repeat=14)
}
else
{
client_print(id, print_chat, "%s You have entered to this match as it has already started, you will be used as a substitution.", PREFIX)
return PLUGIN_HANDLED
}
return PLUGIN_HANDLED
}
public ShowLeft() /* THINK As if there is a set_task to this public at plugin_precache, so think as if it would reach it, and dont ask me to show how I hooked the public cuz it works, so just think as if it works. */
{
if (playersleft != 0)
{
for (new i; i<sizeof(g_bIsReady); i++)
{
if (g_bIsReady[i] == false)
{
new playername[32]
get_user_name(g_bIsReady[i], playername, 31)
new toadd[32] = "^n"
add(toadd, 31, playername)
add(notrdy, 31, toadd)
}
}
set_hudmessage(127, 255, 255, 0.03, 0.05, 0, 6.0, 12.0)
show_hudmessage(0, notrdy)
set_task(1.0, "ShowLeft")
}
else
{
return PLUGIN_HANDLED
}
return PLUGIN_HANDLED
}
Thanks alot for the help!