AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved Try to add text to menu. (https://forums.alliedmods.net/showthread.php?t=295656)

Fuck For Fun 04-01-2017 02:16

Try to add text to menu.
 
i trying to add test like blank but It shows me this weird.
Code:

public OpenMainMenu(Index)
{
    new szKey[3], iMenu = menu_create(g_szMenuTitle, "menuHandler")

    for(new i = 0; i < sizeof(g_szMenuItems) - 1; i += 2)
    {
        formatex(szKey, charsmax(szKey), "%i", i)
        menu_additem(iMenu, g_szMenuItems[i], szKey, 0)
        menu_addtext(iMenu,"test: %d", g_frags[ i ]) // there
    }

    menu_display(Index, iMenu, 0)
    return PLUGIN_HANDLED
}

http://up416.siz.co.il/up3/mg3hyj5memon.png

why 3 times test:?

Natsheh 04-01-2017 06:30

Re: Try to add text to menu.
 
Code:

new szKey[20], iMenu = menu_create(g_szMenuTitle, "menuHandler")

for(new i = 0; i < sizeof(g_szMenuItems); i += 2)
    {
        num_to_str(i, szKey, charsmax(szKey))
        menu_additem(iMenu, g_szMenuItems[i], szKey, 0)
        formatex(szKey, charsmax(szKey)), "test : %d", g_frags[i])
        menu_addtext(iMenu,szKey, 0) // there
    }


Fuck For Fun 04-01-2017 07:00

Re: Try to add text to menu.
 
Quote:

Originally Posted by Natsheh (Post 2508468)
Code:

new szKey[20], iMenu = menu_create(g_szMenuTitle, "menuHandler")

for(new i = 0; i < sizeof(g_szMenuItems); i += 2)
    {
        num_to_str(i, szKey, charsmax(szKey))
        menu_additem(iMenu, g_szMenuItems[i], szKey, 0)
        formatex(szKey, charsmax(szKey)), "test : %d", g_frags[i])
        menu_addtext(iMenu,szKey, 0) // there
    }


thanks anyways bro:)

alr fixed.


All times are GMT -4. The time now is 17:56.

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