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 i = 0; i < 13; i++ ) {
if( equal( PlayerName[ i ], PlayerName[ 0 ] ) )
continue;
new szItem[ 300 ], iPos[ 3 ];
num_to_str( i, iPos, sizeof( iPos ) - 1 );
formatex( szItem, 299, "\w%s \d- \yasdf Necesarios: \r%d", PlayerName[ i ], PlayerLevels[ i ] );
menu_additem( Menu, szItem, iPos );
}
menu_setprop( Menu, MPROP_EXIT, MEXIT_ALL );
menu_display( id, Menu, 0);
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
__________________