04/10/2020 08:35
Usar acentuação em GameText.
Código:
Exemplo:
Código:
Código PHP:
stock TextConverter(string[])
{
for(new arraysize = 0; arraysize < strlen(string); arraysize++)
{
if(strfind(string, "â", true) != -1){new pos = strfind(string, "â", true); strdel(string, pos, pos+strlen("â")); strins(string, "™", pos, sizeof(pos));}
if(strfind(string, "ã", true) != -1){new pos = strfind(string, "ã", true); strdel(string, pos, pos+strlen("ã")); strins(string, "š", pos, sizeof(pos));}
if(strfind(string, "á", true) != -1){new pos = strfind(string, "á", true); strdel(string, pos, pos+strlen("á")); strins(string, "˜", pos, sizeof(pos));}
if(strfind(string, "é", true) != -1){new pos = strfind(string, "é", true); strdel(string, pos, pos+strlen("é")); strins(string, "ž", pos, sizeof(pos));}
if(strfind(string, "ú", true) != -1){new pos = strfind(string, "ú", true); strdel(string, pos, pos+strlen("ú")); strins(string, "“", pos, sizeof(pos));}
if(strfind(string, "ó", true) != -1){new pos = strfind(string, "ó", true); strdel(string, pos, pos+strlen("ó")); strins(string, "¦", pos, sizeof(pos));}
if(strfind(string, "ê", true) != -1){new pos = strfind(string, "ê", true); strdel(string, pos, pos+strlen("ê")); strins(string, "Ÿ", pos, sizeof(pos));}
if(strfind(string, "í", true) != -1){new pos = strfind(string, "í", true); strdel(string, pos, pos+strlen("í")); strins(string, "¢", pos, sizeof(pos));}
if(strfind(string, "ç", true) != -1){new pos = strfind(string, "ç", true); strdel(string, pos, pos+strlen("ç")); strins(string, "œ", pos, sizeof(pos));}
if(strfind(string, "ô", true) != -1){new pos = strfind(string, "ô", true); strdel(string, pos, pos+strlen("ô")); strins(string, "§", pos, sizeof(pos));}
}
return 1;
}
Exemplo:
Código PHP:
CMD:cnn(playerid, params[])
{
if(!IsPlayerHelper(playerid))
return SendClientMessage(playerid, Erro, "Comando Inválido");
new tmp[128];
if(sscanf(params, "s[128]", tmp))
return SendClientMessage(playerid, Erro, "Digite: /Cnn [mensagem]");
TextConverter(tmp); //Convertendo
format(String, sizeof(String), "~r~# ~p~%s~w~: %s ~r~#", PlayerInfo[playerid][Nome], tmp);
GameTextForPlayer(playerid, String, 3000, 2);
return 1;
}