diff --git a/amxmodx/CLang.cpp b/amxmodx/CLang.cpp index 57be60a1..89d061b5 100755 --- a/amxmodx/CLang.cpp +++ b/amxmodx/CLang.cpp @@ -521,9 +521,9 @@ const char *CLangMngr::Format(const char *src, ...) char *langName = va_arg(argptr, char*); const char *cpLangName=NULL; // Handle player ids (1-32) and server language - if ((int)langName == 0) + if ((int)langName == LANG_PLAYER) langName = (char*)m_CurGlobId; - if ((int)langName == -1) + if ((int)langName == LANG_SERVER) cpLangName = g_vault.get("server_language"); else if ((int)langName >= 1 && (int)langName <= 32) cpLangName = ENTITY_KEYVALUE(GET_PLAYER_POINTER_I((int)langName)->pEdict, "lang"); @@ -642,9 +642,9 @@ char * CLangMngr::FormatAmxString(AMX *amx, cell *params, int parm, int &len) cell *pLangName = get_amxaddr(amx, params[parm++]); const char *cpLangName=NULL; // Handle player ids (1-32) and server language - if (*pLangName == 0) + if (*pLangName == LANG_PLAYER) *pLangName = m_CurGlobId; - if (*pLangName == -1) + if (*pLangName == LANG_SERVER) cpLangName = g_vault.get("server_language"); else if (*pLangName >= 1 && *pLangName <= 32) cpLangName = ENTITY_KEYVALUE(GET_PLAYER_POINTER_I(*pLangName)->pEdict, "lang"); diff --git a/amxmodx/CLang.h b/amxmodx/CLang.h index 8cd3b574..3fad0fb1 100755 --- a/amxmodx/CLang.h +++ b/amxmodx/CLang.h @@ -32,7 +32,8 @@ #ifndef _INCLUDE_CLANG_H #define _INCLUDE_CLANG_H -#define LANG_SERVER -1 +#define LANG_SERVER 0 +#define LANG_PLAYER -1 class CLangMngr { diff --git a/amxmodx/amxmodx.cpp b/amxmodx/amxmodx.cpp index dfd8bd47..27189a1b 100755 --- a/amxmodx/amxmodx.cpp +++ b/amxmodx/amxmodx.cpp @@ -709,14 +709,16 @@ static cell AMX_NATIVE_CALL get_user_team(AMX *amx, cell *params) /* 3 param */ static cell AMX_NATIVE_CALL show_menu(AMX *amx, cell *params) /* 3 param */ { - int ilen; - char* sMenu = get_amxstring(amx,params[3],0,ilen); - int numparam = *params/sizeof(cell); + int ilen=0, ilen2=0; + char *sMenu = get_amxstring(amx, params[3], 0, ilen); + char *lMenu = get_amxstring(amx, params[4], 1, ilen2); int menuid = 0; - if (numparam == 4) - menuid = g_menucmds.findMenuId(get_amxstring(amx, params[4], 1, ilen), amx); - else + if (ilen2 && lMenu) + { + menuid = g_menucmds.findMenuId(lMenu, amx); + } else { menuid = g_menucmds.findMenuId(sMenu, amx); + } int keys = params[2]; int time = params[4]; if (params[1] == 0) {