[Ajuda] Corrigir acentos
#1

Vi um tуpico aqui mostrando sobre corrigir os acentos e um membro do fуrum (RazorGuido) disse que o script tava mal feito, ele me passou esse:

#include <corrigir_acentos>

corrigir_acentos.inc
Code:
stock corrigiracentos(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;
}

stock IA_GameTextForPlayer(playerid, string[], time, style)
{
     return GameTextForPlayer(playerid, corrigiracentos(string), time, style);
}
stock IA_GameTextForAll(string[], time, style)
{
   return GameTextForAll(corrigiracentos(string), time, style);
}
#if defined _ALS_GameTextForPlayer
    #undef GameTextForPlayer
#else
    #define _ALS_GameTextForPlayer
#endif
 
#if defined _ALS_GameTextForAll
    #undef GameTextForAll
#else
    #define _ALS_GameTextForAll
#endif
Mas no jogo isso:
format(string,sizeof(string),"~w~vocк");

Ta aparecendo assim:
vociъ
Reply
#2

Mano, utiliza esta include https://sampforum.blast.hk/showthread.php?tid=631354 , sу colocar #include <ia> e ser feliz testei e atй agora nenhum bug.
Reply
#3

Tentar isso aqui http://forum.sa-mp.com/showpost.php?...postcount=1089
ver isso tbm: http://forum.sa-mp.com/showpost.php?...80&postcount=6
Reply
#4

Quote:
Originally Posted by FullStarS
View Post
Mano, utiliza esta include https://sampforum.blast.hk/showthread.php?tid=631354 , sу colocar #include <ia> e ser feliz testei e atй agora nenhum bug.
Essa aqui nгo ta funcionando
https://pastebin.com/raw/xvKPQigG

Include
(15) : error 027: invalid character constant
(31) : error 010: invalid function or declaration
(43) : error 032: array index out of bounds (variable "arrCharacters")
(74) : error 032: array index out of bounds (variable "arrCharacters")
(89) : error 032: array index out of bounds (variable "arrCharacters")
(104) : error 032: array index out of bounds (variable "arrCharacters")
(119) : error 032: array index out of bounds (variable "arrCharacters")

GM
(9333) : warning 209: function "IA_GameTextForPlayer" should return a value
(20843) : warning 209: function "IA_GameTextForPlayer" should return a value
Reply
#5

Й logico que ta funcionando... eu sу coloquei ela e deu de boa.
Reply
#6

pawn Code:
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;
}
Reply
#7

Quote:
Originally Posted by FullStarS
View Post
Й logico que ta funcionando... eu sу coloquei ela e deu de boa.
Vc usou a nova com "correзхes"?
Pq a nova ta bugada mesmo, botei pra testar e apareceu os mesmos erros
Reply
#8

Eu sou criador desta include (Portuguese Accents) e nгo presenciei absolutamente nenhum bug relacionado а ela, aliбs, estou a usando em um projeto meu e nгo dб sequer um aviso ao compilar.
Vocкs podem estar fazendo algo errado ou tentando adaptar ela ao prуprio gamemode; coisa que nгo recomendo.
Baixe o arquivo .inc dela (nгo baixe o source e tente recriar-la) e nгo modifique absolutamente nada, apуs isso, diga-me se hб algum bug.
Reply
#9

Quote:
Originally Posted by Manorango
View Post
Eu sou criador desta include (Portuguese Accents) e nгo presenciei absolutamente nenhum bug relacionado а ela, aliбs, estou a usando em um projeto meu e nгo dб sequer um aviso ao compilar.
Vocкs podem estar fazendo algo errado ou tentando adaptar ela ao prуprio gamemode; coisa que nгo recomendo.
Baixe o arquivo .inc dela (nгo baixe o source e tente recriar-la) e nгo modifique absolutamente nada, apуs isso, diga-me se hб algum bug.
Eu apenas peguei isso, copiei tudo e colei em um ca.inc na minha pasta de includes:
https://pastebin.com/raw/xvKPQigG

E dei um #include <ca> no GM
E deu os mesmos erros
Reply
#10

Faz do jeito que eu disse, vocк pode ter feito algo errado... Apenas baixe o prуprio arquivo que eu deixei e faзa.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)