CMD:acentos(playerid) { GameTextForPlayer(playerid, "~w~Vocк й um vacilгo igual o seu vф e sua vу!", 1000, 3); return 1; }
stock FixTextDrawText(const string:text[]) {
new
output[512],
i = -1,
l = strlen(text);
while(++i < l) {
output[i] = text[i];
switch(text[i]) {
case 0xC0 .. 0xC3: output[i] -= 0x40;
case 0xC7 .. 0xC9: output[i] -= 0x42;
case 0xD2 .. 0xD5: output[i] -= 0x44;
case 0xD9 .. 0xDC: output[i] -= 0x47;
case 0xE0 .. 0xE3: output[i] -= 0x49;
case 0xE7 .. 0xEF: output[i] -= 0x4B;
case 0xF2 .. 0xF5: output[i] -= 0x4D;
case 0xF9 .. 0xFC: output[i] -= 0x50;
case 0xC4, 0xE4: output[i] = 0x83;
case 0xC6, 0xE6: output[i] = 0x84;
case 0xD6, 0xF6: output[i] = 0x91;
case 0xD1, 0xF1: output[i] = 0xEC;
case 0xDF: output[i] = 0x96;
case 0xBF: output[i] = 0xAF;
}
}
return output;
}
Estou usando o #include <portuguese_accents>
https://hastebin.com/uduvehahac.cpp Mas meu acentos continuam bugados: https://i.imgur.com/XM2tTaR.png Код:
CMD:acentos(playerid) { GameTextForPlayer(playerid, "~w~Vocк й um vacilгo igual o seu vф e sua vу!", 1000, 3); return 1; } |
GameTextForPlayer
stock ConverterTexto(texto[]) { new string[256]; for(new i = 0; texto[i]; ++i) { string[i] = texto[i]; switch(string[i]) { case 0xC0 .. 0xC3: string[i] -= 0x40; case 0xC7 .. 0xC9: string[i] -= 0x42; case 0xD2 .. 0xD5: string[i] -= 0x44; case 0xD9 .. 0xDC: string[i] -= 0x47; case 0xE0 .. 0xE3: string[i] -= 0x49; case 0xE7 .. 0xEF: string[i] -= 0x4B; case 0xF2 .. 0xF5: string[i] -= 0x4D; case 0xF9 .. 0xFC: string[i] -= 0x50; case 0xC4, 0xE4: string[i] = 0x83; case 0xC6, 0xE6: string[i] = 0x84; case 0xD6, 0xF6: string[i] = 0x91; case 0xD1, 0xF1: string[i] = 0xEC; case 0xDF: string[i] = 0x96; case 0xBF: string[i] = 0xAF; } } return string; } GameTextForPlayer(playerid, ConverterTexto("~w~Vocк й um vacilгo igual o seu vф e sua vу!"), 1000, 3);
ConvertToGameText("Text");
SendClientMessage(playerid, -1, ConvertToGameText("Text"));
stock ConvertToGameText(in[])
{
new string[256];
for(new i = 0; in[i]; ++i)
{
string[i] = in[i];
switch(string[i])
{
case 0xC0 .. 0xC3: string[i] -= 0x40;
case 0xC7 .. 0xC9: string[i] -= 0x42;
case 0xD2 .. 0xD5: string[i] -= 0x44;
case 0xD9 .. 0xDC: string[i] -= 0x47;
case 0xE0 .. 0xE3: string[i] -= 0x49;
case 0xE7 .. 0xEF: string[i] -= 0x4B;
case 0xF2 .. 0xF5: string[i] -= 0x4D;
case 0xF9 .. 0xFC: string[i] -= 0x50;
case 0xC4, 0xE4: string[i] = 0x83;
case 0xC6, 0xE6: string[i] = 0x84;
case 0xD6, 0xF6: string[i] = 0x91;
case 0xD1, 0xF1: string[i] = 0xEC;
case 0xDF: string[i] = 0x96;
case 0xBF: string[i] = 0xAF;
}
}
return string;
}
stock PortugueseAcents(in[])
{
new string[256];
for(new i = 0; in[i]; ++i)
{
string[i] = in[i];
switch(string[i])
{
case 0xC0 .. 0xC3: string[i] -= 0x40;
case 0xC7 .. 0xC9: string[i] -= 0x42;
case 0xD2 .. 0xD5: string[i] -= 0x44;
case 0xD9 .. 0xDC: string[i] -= 0x47;
case 0xE0 .. 0xE3: string[i] -= 0x49;
case 0xE7 .. 0xEF: string[i] -= 0x4B;
case 0xF2 .. 0xF5: string[i] -= 0x4D;
case 0xF9 .. 0xFC: string[i] -= 0x50;
case 0xC4, 0xE4: string[i] = 0x83;
case 0xC6, 0xE6: string[i] = 0x84;
case 0xD6, 0xF6: string[i] = 0x91;
case 0xD1, 0xF1: string[i] = 0xEC;
case 0xDF: string[i] = 0x96;
case 0xBF: string[i] = 0xAF;
}
}
return string;
}
forward public GameTextForPlayerEx(playerid, string[], time, type);
public GameTextForPlayerEx(playerid, string[], time, type) {
GameTextForPlayer(playerid, PortugueseAcents(string), time, type);
}