Switched LANG_SERVER/LANG_PLAYER

Fixed show_menu (param count is always the same)
This commit is contained in:
David Anderson 2004-08-13 16:21:15 +00:00
parent 93851f289f
commit 7aa6902e36
3 changed files with 14 additions and 11 deletions

View File

@ -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");

View File

@ -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
{

View File

@ -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;
int ilen=0, ilen2=0;
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;
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) {