Raised This Month: $ Target: $400
 0% 

Showing Not Ready


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 07-23-2011 , 06:58   Showing Not Ready
Reply With Quote #1

I have a mode that checks if someone is ready or not (you'll see the variable that shows it, g_IsReady), the problem is, that it shows maximum 3 or 2 players that are not ready in the server, and sometimes it doesnt show the name fully, so if my name would be Diegorkable, it would show Diegorka or something like that that is my name and not fully, so it displays just a part of my name, I tried making the variables with [2000] many cells available so it'll let it copy, but still it doesnt, wierd, check the code tell me if you see something please. The Public ShowLeft() refreshes every 1 minute in order to check if he did .rdy or not

PHP Code:
/* Global Variables in the code */
new playersleft 10
new bool:g_bIsReady[11]
new 
notrdy[400] = "Not Ready:^n"
/* Global ... */

public ShowLeft()
{
    if (
playersleft != 0)
    {
        new 
players[32], pnumtempid
     
        
get_players(playerspnum"ch"); 
     
        for( new 
ii<pnumi++ ) 
        { 
            
tempid players[i]; 
            if (
g_bIsReady[tempid] == false)
            {
                new 
playername[200]
                
get_user_name(tempidplayername31)
                new 
toadd[32] = "^n"
                
add(toadd31playername)
                
add(notrdy31toadd)
            }
            
        } 
            
        if (
equali(notrdy"Not Ready:^n"))
        {
            
notrdy "Not Ready:^n^nNone."
        
}
        
        
set_hudmessage(1272552550.030.0506.012.0)
        
show_hudmessage(0notrdy)
        
        
notrdy "Not Ready:^n"
        
set_task(1.0"ShowLeft")
    }
    
    else
    {
        return 
PLUGIN_HANDLED
    
}
    return 
PLUGIN_HANDLED

Diegorkable is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 07-23-2011 , 09:52   Re: Showing Not Ready
Reply With Quote #2

get_user_name(tempid, playername, 31)??

new toadd[32] = "^n" ??
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 07-23-2011 , 10:56   Re: Showing Not Ready
Reply With Quote #3

It gets if the player is not ready (if g_bIsReady is false) then it copies his name into a variable (playername) and adds to it a ^n, so if my name would be "Diego" then it adds it to it "Diego^n", The reason I wanted to do this is that the Not Ready will be a column, list.

Can't hudmessage be a column?
Diegorkable is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 07-23-2011 , 11:27   Re: Showing Not Ready
Reply With Quote #4

Are you not getting index out of bounds errors?

The first thing I can see is that this:

new bool:g_bIsReady[11]


needs to be

new bool:g_bIsReady[33]


because you need to hold every player index (1-32).

Try this:

PHP Code:
if (playersleft != 0
    { 
        new 
players[32], pnumtempid;  
      
        
get_players(playerspnum"ch");  
      
        new 
szPlayerName32 ];
        
        for( new 
ii<pnumi++ )  
        {  
            
tempid players[i];  
            if (
g_bIsReady[tempid] == false
            { 
                
get_user_name(tempidplayername31)
                
                
addnotrdycharsmaxnotrdy ), playername );
                
addnotrdycharsmaxnotrdy ), "^n" );
            } 
             
        }  
             
        if (
equali(notrdy"Not Ready:^n")) 
        { 
            
notrdy "Not Ready:^n^nNone." 
        

         
        
set_hudmessage(1272552550.030.0506.012.0
        
show_hudmessage(0notrdy
         
        
notrdy "Not Ready:^n" 
        
set_task(1.0"ShowLeft"
    } 
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please

Last edited by nikhilgupta345; 07-23-2011 at 11:29.
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
HBxander
Senior Member
Join Date: Jan 2011
Location: Behind you!
Old 07-23-2011 , 11:27   Re: Showing Not Ready
Reply With Quote #5

Show us the whole code, else we can't help you.
__________________
Selling:

- PointMod for Hide And Seek - $20
- Private BlockMaker with Weapon Block And More - $50
- Achievements ( FFA GamePlay ) - $25

PM Me about Private Work!
HBxander is offline
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 07-23-2011 , 11:39   Re: Showing Not Ready
Reply With Quote #6

You don't need the whole code, the rest of the code is that it refreshes that public through a recursive public.... thats all. and nikhilpug..qt13-15813681-36 ill test your code
Diegorkable is offline
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 07-23-2011 , 12:18   Re: Showing Not Ready
Reply With Quote #7

i think it works great tyvm
Diegorkable is offline
Reply



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 00:46.


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