mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2024-12-25 06:15:37 +03:00
Switched LANG_SERVER/LANG_PLAYER
Fixed show_menu (param count is always the same)
This commit is contained in:
parent
93851f289f
commit
7aa6902e36
@ -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");
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user