Raised This Month: $ Target: $400
 0% 

If false add to hudmessage


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 07-20-2011 , 20:48   If false add to hudmessage
Reply With Quote #1

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, -1SEEK_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(idprint_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 
ii<sizeof(g_bIsReady); i++)
        {
            
            if (
g_bIsReady[i] == false)
            {
                new 
playername[32]
                
get_user_name(g_bIsReady[i], playername31)
                new 
toadd[32] = "^n"
                
add(toadd31playername)
                
add(notrdy31toadd)
            }
            
        }
        
        
set_hudmessage(1272552550.030.0506.012.0)
        
show_hudmessage(0notrdy)
        
set_task(1.0"ShowLeft")
    }
    
    else
    {
        return 
PLUGIN_HANDLED
    
}
    return 
PLUGIN_HANDLED

Thanks alot for the help!

Last edited by Diegorkable; 07-20-2011 at 20:51.
Diegorkable is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:05.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode