AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved [HELP] 2 times LANG_PLAYER with old menu (https://forums.alliedmods.net/showthread.php?t=309102)

CrAzY MaN 07-14-2018 03:14

[HELP] 2 times LANG_PLAYER with old menu
 
Am I doing something wrong?

Code:
public welcome_menu(id) {     new menubody[512] = "\y[CFM] \rCONFUSING FUN MOD \wv2.0^n^n";     new len = strlen(menubody);         len += formatex(menubody[len], charsmax(menubody) - len, "%L", LANG_PLAYER, "m_SWAP_WEAPONS", g_Settings[SWAP_WEAPONS] ? "%L" : "%L", LANG_PLAYER, "m_ENABLED", "m_DISABLED");         show_menu(id, keys, menubody, -1, "welcome_menu"); }

Text document
PHP Code:

m_SWAP_WEAPONS = \wSwapping Weapons - %s^n
m_ENABLED 
= \yEnabled
m_DISABLED 
= \rDisabled 

Output
Code:

Swapping Weapons - %L
It works with
PHP Code:

len += formatex(menubody[len], charsmax(menubody) - len"%L"LANG_PLAYER"m_SWAP_WEAPONS"g_Settings[SWAP_WEAPONS] ? "\yEnabled" "\rDisabled"); 


Ghosted 07-14-2018 03:23

Re: [HELP] 2 times LANG_PLAYER with old menu
 
Code:

public welcome_menu(id)
{
    new menubody[512] = "\y[CFM] \rCONFUSING FUN MOD \wv2.0^n^n";
    new len = strlen(menubody);
   
    len += formatex(menubody[len], charsmax(menubody) - len, "%L - %L^n", LANG_PLAYER, "m_SWAP_WEAPONS", LANG_PLAYER, g_Settings[SWAP_WEAPONS] ? "m_ENABLED", "m_DISABLED");

        show_menu(id, keys, menubody, -1, "welcome_menu");
}

Code:

m_SWAP_WEAPONS = \wSwapping Weapons
m_ENABLED = \yEnabled
m_DISABLED = \rDisabled


CrAzY MaN 07-14-2018 05:15

Re: [HELP] 2 times LANG_PLAYER with old menu
 
Thanks!


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

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