07.12.2015, 02:30
Bom pessoal, tenho um sistema de 2 idiomas q funfa de boas, porйm tem um detalhe que eu quero modificar:
Alterar NUMBER para STRING...
Segue o code:
Gostaria de "converter" o NUMBER para STRING, ou seja:
0 = Portugues
1 = Ingles
Alterar NUMBER para STRING...
Segue o code:
PHP код:
public OnPlayerSelectedMenuRow(playerid, row)
{
new Menu:CurrentMenu = GetPlayerMenu(playerid);
new string[128];
if(CurrentMenu == languageMenu)
{
switch(row)
{
case 0: LanguageID[playerid] = 0;
case 1: LanguageID[playerid] = 1;
}
TogglePlayerControllable(playerid, 0);
}
if(LanguageID[playerid] == 0)
{
tkUSER[playerid][TKU_PlayerLanguage] = 0;
format(string, sizeof(string),"Vocк selecionou a linguagem: %s [PT]", tkPlayerName(playerid), LanguageID);
SendClientMessage(playerid, -1, string);
}
else if(LanguageID[playerid] == 1)
{
tkUSER[playerid][TKU_PlayerLanguage] = 1;
format(string, sizeof(string),"Vocк selecionou a linguagem: %s [EN]", tkPlayerName(playerid), LanguageID);
SendClientMessage(playerid, -1, string);
}
new langkey = DB::RetrieveKey(gGlobal[TKT_MultiLanguage], "username", tkPlayerName(playerid));
DB::SetIntEntry(gGlobal[TKT_MultiLanguage], langkey, "player language", tkUSER[playerid][TKU_PlayerLanguage]);
SavePlayerLanguage(playerid);
return 1;
}
public OnPlayerExitedMenu(playerid)
{
new Menu:CurrentMenu = GetPlayerMenu(playerid);
if(CurrentMenu == languageMenu)
{
ShowMenuForPlayer(languageMenu, playerid);
}
TogglePlayerControllable(playerid, 1);
SavePlayerLanguage(playerid);
}
0 = Portugues
1 = Ingles