AlliedModders

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

georgik57 03-26-2011 04:45

menu problem
 
1 Attachment(s)
so...i have this menu characters lenght problem...it doesn't write all of it(see img)
how can i correct it?
here's the code
PHP Code:

// Admin Menu
show_menu_admin(id)
{
    static 
menu[250], lenuserflags
    len 
0
    userflags 
get_user_flags(id)
    
    
// Title
    
len += formatex(menu[len], charsmax(menu) - len"\y%L^n^n"id"MENU_ADMIN_TITLE")
    
    
// 1. Zombiefy/Humanize command
    
if (userflags & (g_access_flag[ACCESS_MODE_INFECTION] | g_access_flag[ACCESS_MAKE_ZOMBIE] | g_access_flag[ACCESS_MAKE_HUMAN]))
        
len += formatex(menu[len], charsmax(menu) - len"\r1.\w %L^n"id"MENU_ADMIN1")
    else
        
len += formatex(menu[len], charsmax(menu) - len"\d1. %L^n"id"MENU_ADMIN1")
    
    
// 2. Nemesis command
    
if (userflags & (g_access_flag[ACCESS_MODE_NEMESIS] | g_access_flag[ACCESS_MAKE_NEMESIS]))
        
len += formatex(menu[len], charsmax(menu) - len"\r2.\w %L^n"id"MENU_ADMIN2")
    else
        
len += formatex(menu[len], charsmax(menu) - len"\d2. %L^n"id"MENU_ADMIN2")
    
    
// 3. Survivor command
    
if (userflags & (g_access_flag[ACCESS_MODE_SURVIVOR] | g_access_flag[ACCESS_MAKE_SURVIVOR]))
        
len += formatex(menu[len], charsmax(menu) - len"\r3.\w %L^n"id"MENU_ADMIN3")
    else
        
len += formatex(menu[len], charsmax(menu) - len"\d3. %L^n"id"MENU_ADMIN3")
    
    
// 4. Respawn command
    
if (userflags g_access_flag[ACCESS_RESPAWN_PLAYERS])
        
len += formatex(menu[len], charsmax(menu) - len"\r4.\w %L^n"id"MENU_ADMIN4")
    else
        
len += formatex(menu[len], charsmax(menu) - len"\d4. %L^n"id"MENU_ADMIN4")
    
    
// 5. Swarm mode command
    
if ((userflags g_access_flag[ACCESS_MODE_SWARM]) && allowed_swarm())
        
len += formatex(menu[len], charsmax(menu) - len"\r5.\w %L^n"id"MENU_ADMIN5")
    else
        
len += formatex(menu[len], charsmax(menu) - len"\d5. %L^n"id"MENU_ADMIN5")
    
    
// 6. Multi infection command
    
if ((userflags g_access_flag[ACCESS_MODE_MULTI]) && allowed_multi())
        
len += formatex(menu[len], charsmax(menu) - len"\r6.\w %L^n"id"MENU_ADMIN6")
    else
        
len += formatex(menu[len], charsmax(menu) - len"\d6. %L^n"id"MENU_ADMIN6")
    
    
// 7. Plague mode command
    
if ((userflags g_access_flag[ACCESS_MODE_PLAGUE]) && allowed_plague())
        
len += formatex(menu[len], charsmax(menu) - len"\r7.\w %L^n"id"MENU_ADMIN7")
    else
        
len += formatex(menu[len], charsmax(menu) - len"\d7. %L^n"id"MENU_ADMIN7")
    
    
// 8. Sniper command
    
if (userflags & (g_access_flag[ACCESS_MODE_SNIPER] | g_access_flag[ACCESS_MAKE_SNIPER]))
        
len += formatex(menu[len], charsmax(menu) - len"\r8.\w %L^n"id"MENU_ADMIN8")
    else
        
len += formatex(menu[len], charsmax(menu) - len"\d8. %L^n"id"MENU_ADMIN8")
    
    
// 9. Apocalypse mode command
    
if ((userflags g_access_flag[ACCESS_MODE_APOCALYPSE]) && allowed_apocalypse())
        
len += formatex(menu[len], charsmax(menu) - len"\r9.\w %L^n"id"MENU_ADMIN9")
    else
        
len += formatex(menu[len], charsmax(menu) - len"\d9. %L^n"id"MENU_ADMIN9")
    
    
// 0. Exit
    
len += formatex(menu[len], charsmax(menu) - len"^n\r0.\w %L"id"MENU_EXIT")
    
    
show_menu(idKEYSMENUmenu, -1"Admin Menu")



Exolent[jNr] 03-26-2011 04:53

Re: menu problem
 
PHP Code:

    static menu[250], lenuserflags 

Increase the menu size.

georgik57 03-26-2011 04:55

Re: menu problem
 
Quote:

Originally Posted by Exolent[jNr] (Post 1439455)
PHP Code:

    static menu[250], lenuserflags 

Increase the menu size.

hmm lol...i was looking at those charsmax things ^^
too blind to see that i guess...
thank you <3
will try asap
EDIT: WORKS, THANKS!!!


All times are GMT -4. The time now is 14:41.

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