Raised This Month: $ Target: $400
 0% 

Menu Problems with loop


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
gladius
Veteran Member
Join Date: Jul 2008
Location: Santiago, Chile
Old 03-10-2010 , 14:12   Menu Problems with loop
Reply With Quote #1

My problem is how I can get "playername [1]," stay with "PlayerLevel [0]"

I did a menu, but the way that I did it don't works, tells me this error in the console:
Run time error 4: index out of bounds
I look at the "debug" and the error is on the line 685 (plugin full) it would be this
formatex(Item, 299, "\w%s \d- \yProrecs Necesarios: \r%d", PlayerName[i], PlayerLevels[i])

my code:
PHP Code:
new const PlayerName[13][] = {
    
"Recien Llegado"
    
"Noob"
    
"Principiante"
    
"Aprendiz"
    
"Normal"
    
"Bueno"
    
"Muy Bueno"
    
"Excelente"
    
"Profesional"
    
"Chuck Norris"
    
"Ultra Brigido"
    
"Campeon"
    
"KZ Man"
}
new const 
PlayerLevels[12][] = {
    
1
    
3
    
7
    
16
    
25
    
37
    
50
    
70
    
100
    
150
    
200
    
300


public 
plugin_init() {
    
register_plugin("A""B""C")
    
    
register_clcmd("say /info""StatusMenu")
}

public 
StatusMenu(id)
{    
    new 
Menu menu_create("\yInfo Status Menu""StatusHandler")
    
    for(new 
013i++ ) {
        if( 
equalPlayerName], PlayerName] ) )
            continue;
            
        new 
szItem300 ], iPos];
        
num_to_striiPossizeofiPos ) - );
        
formatexszItem299"\w%s \d- \yasdf Necesarios: \r%d"PlayerName], PlayerLevels] );
        
menu_additemMenuszItemiPos );
    }
    
    
menu_setpropMenuMPROP_EXITMEXIT_ALL );
    
menu_displayidMenu0);
    return 
PLUGIN_HANDLED;

Then I want to make

I want that does not appear "Recien Llegado"

//Menu
Noob - asdf Necesarios: 1
Principiante - asdf Necesarios: 3
Aprendiz - asdf Necesarios: 7
etc..

I hope you can help me

*my English is not very good
__________________
Proyects
Kreedz Chile Mod [100%] (Fixing some details).


Last edited by gladius; 03-10-2010 at 14:14.
gladius is offline
Send a message via MSN to gladius Send a message via Skype™ to gladius
 


Thread Tools
Display Modes

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 08:43.


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