[Tutorial] Criando um servidor em dois Idiomas [INICIANTES]
#21

eu acho mais simples utilizar arquivos.. ai qualquer pessoa pode traduzir e nгo precisa ficar abrindo gm e compilando ela.
Reply
#22

Alguйm ajuda

ERROS:
PHP код:
C:\Projeto D.M\gamemodes\DM.pwn(418) : error 017undefined symbol "linguagem"
C:\Projeto D.M\gamemodes\DM.pwn(418) : warning 215expression has no effect
C
:\Projeto D.M\gamemodes\DM.pwn(418) : error 001expected token";"but found "]"
C:\Projeto D.M\gamemodes\DM.pwn(418) : error 029invalid expressionassumed zero
C
:\Projeto D.M\gamemodes\DM.pwn(418) : fatal error 107too many error messages on one line
Compilation aborted
.Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
4 Errors

Cуdigos

Linha 418
PHP код:
    if(dialogid == DIALOG_LINGUAGEM)
    {
        if(
response)
        {
            
Linguagem[playerid] = 1;
            
SendClientMessage(playerid, -1,"{BD0D0D}Try /help , and have a Good Game !");
        }else
        {
            
Linguagem[playerid] = 2;
            
SendClientMessage(playerid, -1,"{BD0D0D}Digite /ajuda , e tenha um bom jogo !");
        }
    }
    return 
1;

Reply
#23

Quote:
Originally Posted by GuilhermeNunes
Посмотреть сообщение
Alguйm ajuda

ERROS:
PHP код:
C:\Projeto D.M\gamemodes\DM.pwn(418) : error 017undefined symbol "linguagem"
C:\Projeto D.M\gamemodes\DM.pwn(418) : warning 215expression has no effect
C
:\Projeto D.M\gamemodes\DM.pwn(418) : error 001expected token";"but found "]"
C:\Projeto D.M\gamemodes\DM.pwn(418) : error 029invalid expressionassumed zero
C
:\Projeto D.M\gamemodes\DM.pwn(418) : fatal error 107too many error messages on one line
Compilation aborted
.Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
4 Errors

Cуdigos

Linha 418
PHP код:
    if(dialogid == DIALOG_LINGUAGEM)
    {
        if(
response)
        {
            
Linguagem[playerid] = 1;
            
SendClientMessage(playerid, -1,"{BD0D0D}Try /help , and have a Good Game !");
        }else
        {
            
Linguagem[playerid] = 2;
            
SendClientMessage(playerid, -1,"{BD0D0D}Digite /ajuda , e tenha um bom jogo !");
        }
    }
    return 
1;

Mude sua new para:
PHP код:
new Linguagem[MAX_PLAYERS] = 0
Pois os cуdigos que usam esta new sгo:
PHP код:
Linguagem[playerid] = 1;
Linguagem[playerid] = 2
Lembre-se: Uma letra minъscula ou maiъscula faz toda diferenзa.
Reply
#24

Belo tutorial Zackt, pode ajudar muitos mas poderia simplificar

Код:
stock Translate(language, text_PT[], text_EN[])
{
    new string[256];

    if(language == 1) format(string, sizeof(string), text_PT);
    else if(language == 2) format(string, sizeof(string), text_EN);

    return string;
}
Код:
enum PlayerInfo
{
     pLanguage,
}
Код:
CMD:verificarinfeccao(playerid)
{
   		if(pInfo[playerid][pInfection] == 0)
     	{
			SendClientMessage(playerid, -1, Translate(pInfo[playerid][pLanguage], "*"COL_RED" VVocк nгo estб infectado!!", "*"COL_RED" You are not infected of any sort!"));
		}

  return 1;
}
Reply
#25

Meck, e caso eu queira usar format, para mostrar o valor de alguma variavel? eu tentei assim:

Код:
	new info[128];
 	format(info, sizeof(info), Translate(PlayerInfo[playerid][P_LANGUAGE], " *** \"%s\" saiu do server", "*** \"%s\" has left the server"),PlayerName(playerid));
	SendClientMessageToAll(COLOR_DUEL, info);
Mas nгo mostrou o nome do player!
Reply
#26

Quote:
Originally Posted by forbidden404
Посмотреть сообщение
Meck, e caso eu queira usar format, para mostrar o valor de alguma variavel? eu tentei assim:

Код:
	new info[128];
 	format(info, sizeof(info), Translate(PlayerInfo[playerid][P_LANGUAGE], " *** \"%s\" saiu do server", "*** \"%s\" has left the server"),PlayerName(playerid));
	SendClientMessageToAll(COLOR_DUEL, info);
Mas nгo mostrou o nome do player!
Substitua a funзгo por define com operaзгo ternбria:
Код:
#define Translate(%0,%1,%2) (%0 == 1) ? (%1) : (%2)
Reply
#27

Quote:
Originally Posted by forbidden404
Посмотреть сообщение
Meck, e caso eu queira usar format, para mostrar o valor de alguma variavel? eu tentei assim:

Код:
	new info[128];
 	format(info, sizeof(info), Translate(PlayerInfo[playerid][P_LANGUAGE], " *** \"%s\" saiu do server", "*** \"%s\" has left the server"),PlayerName(playerid));
	SendClientMessageToAll(COLOR_DUEL, info);
Mas nгo mostrou o nome do player!
Maneira Funcional

Quote:
Originally Posted by RodrigoMSR
Посмотреть сообщение
Substitua a funзгo por define com operaзгo ternбria:
Код:
#define Translate(%0,%1,%2) (%0 == 1) ? (%1) : (%2)
Reply
#28

Valeu Rodrigo, funcionou mesmo!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)