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*);
|
char *langName = va_arg(argptr, char*);
|
||||||
const char *cpLangName=NULL;
|
const char *cpLangName=NULL;
|
||||||
// Handle player ids (1-32) and server language
|
// Handle player ids (1-32) and server language
|
||||||
if ((int)langName == 0)
|
if ((int)langName == LANG_PLAYER)
|
||||||
langName = (char*)m_CurGlobId;
|
langName = (char*)m_CurGlobId;
|
||||||
if ((int)langName == -1)
|
if ((int)langName == LANG_SERVER)
|
||||||
cpLangName = g_vault.get("server_language");
|
cpLangName = g_vault.get("server_language");
|
||||||
else if ((int)langName >= 1 && (int)langName <= 32)
|
else if ((int)langName >= 1 && (int)langName <= 32)
|
||||||
cpLangName = ENTITY_KEYVALUE(GET_PLAYER_POINTER_I((int)langName)->pEdict, "lang");
|
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++]);
|
cell *pLangName = get_amxaddr(amx, params[parm++]);
|
||||||
const char *cpLangName=NULL;
|
const char *cpLangName=NULL;
|
||||||
// Handle player ids (1-32) and server language
|
// Handle player ids (1-32) and server language
|
||||||
if (*pLangName == 0)
|
if (*pLangName == LANG_PLAYER)
|
||||||
*pLangName = m_CurGlobId;
|
*pLangName = m_CurGlobId;
|
||||||
if (*pLangName == -1)
|
if (*pLangName == LANG_SERVER)
|
||||||
cpLangName = g_vault.get("server_language");
|
cpLangName = g_vault.get("server_language");
|
||||||
else if (*pLangName >= 1 && *pLangName <= 32)
|
else if (*pLangName >= 1 && *pLangName <= 32)
|
||||||
cpLangName = ENTITY_KEYVALUE(GET_PLAYER_POINTER_I(*pLangName)->pEdict, "lang");
|
cpLangName = ENTITY_KEYVALUE(GET_PLAYER_POINTER_I(*pLangName)->pEdict, "lang");
|
||||||
|
@ -32,7 +32,8 @@
|
|||||||
#ifndef _INCLUDE_CLANG_H
|
#ifndef _INCLUDE_CLANG_H
|
||||||
#define _INCLUDE_CLANG_H
|
#define _INCLUDE_CLANG_H
|
||||||
|
|
||||||
#define LANG_SERVER -1
|
#define LANG_SERVER 0
|
||||||
|
#define LANG_PLAYER -1
|
||||||
|
|
||||||
class CLangMngr
|
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 */
|
static cell AMX_NATIVE_CALL show_menu(AMX *amx, cell *params) /* 3 param */
|
||||||
{
|
{
|
||||||
int ilen;
|
int ilen=0, ilen2=0;
|
||||||
char* sMenu = get_amxstring(amx,params[3],0,ilen);
|
char *sMenu = get_amxstring(amx, params[3], 0, ilen);
|
||||||
int numparam = *params/sizeof(cell);
|
char *lMenu = get_amxstring(amx, params[4], 1, ilen2);
|
||||||
int menuid = 0;
|
int menuid = 0;
|
||||||
if (numparam == 4)
|
if (ilen2 && lMenu)
|
||||||
menuid = g_menucmds.findMenuId(get_amxstring(amx, params[4], 1, ilen), amx);
|
{
|
||||||
else
|
menuid = g_menucmds.findMenuId(lMenu, amx);
|
||||||
|
} else {
|
||||||
menuid = g_menucmds.findMenuId(sMenu, amx);
|
menuid = g_menucmds.findMenuId(sMenu, amx);
|
||||||
|
}
|
||||||
int keys = params[2];
|
int keys = params[2];
|
||||||
int time = params[4];
|
int time = params[4];
|
||||||
if (params[1] == 0) {
|
if (params[1] == 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user