AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Menu (https://forums.alliedmods.net/showthread.php?t=172337)

Compro 11-19-2011 05:09

Menu
 
Hello, i am making basic menu . And when I compile .sma it compiles with error.

PHP Code:

#include <amxmodx>
#include <fun>

public plugin_init()
{
    
register_clcmd"Menu1","Menu2");
}
public 
Menu2(id)
{
    new 
menu menu_create"\rAdvanced shop v1:""menu_handler");
    
menu_additem(menu"\wSelection #1""1"0);
    
menu_additem(menu"\wSelection #2""2"0);
    
menu_additem(menu"\wSelection #3""3"0);
    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
menu_display(idmenu0);
}
public 
menu_handler(idmenuitem){
    if (
item == MENU_EXIT)
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
new 
data[6], szName[64];
new 
accesscallback;
menu_item_getinfo(menuitemaccessdata,charsmax(data), szNamecharsmax(szName), callback);
new 
key str_to_num(data);
switch(
key){
    case 
1:
    {
        
client_print(idprint_chat"Well done , you selected 1st selection");
    }
    case 
2:
    {
        
client_print(idprint_chat"HEHE , you choosed 2nd section");
    }
    case 
3:
    {
        
client_print(idprint_chat"You choosed 3rd section");
    }
}
menu_destroy(menu);
return 
PLUGIN_HANDLED;    


It say's that 23 row has error: warning 217: loose indentation.
Row 23 :
PHP Code:

new data[6], szName[64]; 

, why compiler shows to me an error ?
Thanks for support.

Arkshine 11-19-2011 05:13

Re: Menu
 
Loose indentation is not an error but a warning, meaning it can be ignored safely and your plugin is compiled. You have have this warning because your code is badly indented. It's kind of obvious when you look at your code above.


All times are GMT -4. The time now is 08:28.

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