Blizzard hasn't understood anything lol.
Here is corrected code with comments :
PHP Code:
#define B1 1 << 1; // here should be 1<<0 but you can use already defined MENU_KEY_1
#define B0 1 << 10; // here should be 1<<9 but you can use already defined MENU_KEY_0
new const gKeyslolMenu = MENU_KEY_1 | MENU_KEY_0;
public plugin_init()
{
register_clcmd("say /lol", "lolMenu");
register_menucmd(register_menuid("lolMenu"), gKeyslolMenu, "handlelolMenu");
}
public lolMenu(id)
{
new szMenu[256];
add( szMenu , charsmax(szMenu) , "\r1. \wCall lol Menu Test^n" );
add( szMenu , charsmax(szMenu) , "\r0. \wClose" );
show_menu( id , gKeyslolMenu , szMenu , -1 , "lolMenu" );
}
public handlelolMenu(id, key)
{
// key is 0(for 1), 1(for2), etc.... 9(for0)
// either you use those values : 0:lolProcess, 9;return
// either you use this tip to convert to numbers 1,2,3,4,5,6,7,8,9,0
new num = (key+1) % 10;
switch (++num)
{
case 1: { lolProcess; }
case 0: { return; }
}
// This can't happen since you have not registered keys
// if (num != 1 && num != 0)
// {
// lolMenu(id);
// }
}
public lolProcess( id )
{
// Sum huge variables
// Big loops
// File open and get data from file.
// Use of Cstrike and fun functions.
// fclose.
}
__________________