Raised This Month: $ Target: $400
 0% 

Menu code gets a warning?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
stupok
Veteran Member
Join Date: Feb 2006
Old 12-11-2006 , 18:13   Re: Menu code gets a warning?
Reply With Quote #8

Things I would change: (in boldface)

Code:
public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR);
    register_clcmd("say /menu", "mainMenu");
    register_menucmd(register_menuid("\yMain Menu: "), 1023, "MenuCommand");
menuCommand
}
public mainMenu(id) {
    if(access(id, ADMIN_BAN)) {
        new szMenuBody[256];
        new key = MENU_KEY_0|MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6|MENU_KEY_7|MENU_KEY_8|MENU_KEY_9;
        
        new nLen = format(szMenuBody, 255, "\yMain Menu: ");
        
        nLen += format(szMenuBody[nLen], 255-nLen, "^n\w1. Add Start Timer");
        nLen += format(szMenuBody[nLen], 255-nLen, "^n\w2. Add End Timer");
        nLen += format(szMenuBody[nLen], 255-nLen, "^n\w3. Remove Start Timer");
        nLen += format(szMenuBody[nLen], 255-nLen, "^n\w4. Remove End Timer");
        nLen += format(szMenuBody[nLen], 255-nLen, "^n^n\w5. Save Position");
        nLen += format(szMenuBody[nLen], 255-nLen, "^n\w6. Load Position");
        nLen += format(szMenuBody[nLen], 255-nLen, "^n\w7. Cancel Timed Run");
        nLen += format(szMenuBody[nLen], 255-nLen, "^n\w8. Give Quad");
        nLen += format(szMenuBody[nLen], 255-nLen, "^n\w9. Give God");
        
        nLen += format(szMenuBody[nLen], 255-nLen, "^n^n\w0. Exit");
        
        show_menu(id, key, szMenuBody, -1, "menu_mainMenu");
    } else {
        new szMenuBody[256];
        new key = MENU_KEY_0|MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5;
        
        new nLen = format(szMenuBody, 255, "\yMain Menu:^n");
        
        nLen += format(szMenuBody[nLen], 255-nLen, "^n\w1. Save Position");
        nLen += format(szMenuBody[nLen], 255-nLen, "^n\w2. Load Position");
        nLen += format(szMenuBody[nLen], 255-nLen, "^n\w3. Cancel Timed Run");
        nLen += format(szMenuBody[nLen], 255-nLen, "^n\w4. Give Quad");
        nLen += format(szMenuBody[nLen], 255-nLen, "^n\w5. Give God");
        
        nLen += format(szMenuBody[nLen], 255-nLen, "^n^n\w0. Exit");
        
        show_menu(id, key, szMenuBody, -1,);
    }
    
    return PLUGIN_HANDLED;
}
1. Remove menuCommand
2. Remove "menu_mainMenu"
3. Remove ,
stupok is offline
 



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 06:49.


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