Register, Log and tutorial in multilingual
#1

I'm making a GM from 0 roleplay multilingual and i decide to start with a dialog asking to player in what lenguage want to display the server so i put this on the top of the script

PHP код:
#define DIALOG_LANGUAGE 0
#define DIALOG_PASSWORD 1 
i have this in OnPlayerConnect:

PHP код:
public OnPlayerConnect(playerid)
{
    
ShowPlayerDialog(playeridDIALOG_LANGUAGEDIALOG_STYLE_MSGBOX"                                     {0092FF}Welcome","\n         {FFFFFF}Please, choose a language you would like to display.\n\n          Por favor, elija el idioma en el que desea visualizar.","{FFFFFF}English","{FFFFFF}Espaсol");
    return 
1;

now im trying to add when player press english or spanish botton this will check if the player is registered on server or not and will show you a register or a login dialog depends of the player account status and i got this in OnDialogResponse:

PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == DIALOG_LANGUAGE)
    {
        if(
response)
        {
        
English[playerid] = 1;
        
Spanish[playerid] = 0;
         
SendClientMessage(playeridCOLOR_SUCCESS"Your language has been set to English.");
        }
        else
        {
           
English[playerid] = 0;
        
Spanish[playerid] = 1;
         
SendClientMessage(playeridCOLOR_SUCCESS"Su idioma ha sido configurado a Espaсol.");
        }
        return 
1;
    }
    return 
1;
}
if(
dialogid == DIALOG_LANGUAGE)
        {
            if(
response == 1)
            {
                
SendClientMessage(playeridDIALOG_PASSWORDDIALOG_STYLE_PASSWORD"{0092FF}Register Panel""\n{FFFFFF}Please put a password below:""Register""Cancel");
            }
            else
            {
                
SendClientMessage(playeridDIALOG_PASSWORDDIALOG_STYLE_PASSWORD"{0092FF}Panel de Registro""\n{FFFFFF}pon tu contraseсa abajo""Registrar""Cancelar");
            }
        } 
when i try to compile shows me this:

Код:
C:\Users\Jaua\Desktop\Clean Server\gamemodes\Nuevo.pwn(284) : error 010: invalid function or declaration
C:\Users\Jaua\Desktop\Clean Server\gamemodes\Nuevo.pwn(286) : error 010: invalid function or declaration
C:\Users\Jaua\Desktop\Clean Server\gamemodes\Nuevo.pwn(290) : error 010: invalid function or declaration
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
line 284:

PHP код:
if(dialogid == DIALOG_LANGUAGE
line 286:

PHP код:
if(response == 1
line 290:

PHP код:
else 
any of you can give me some advice to make what i want and try to run this? thanks in advance
Reply
#2

PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    switch( 
dialogid )
    {
        case 
DIALOG_LANGUAGE:
        {
            if( 
response //They clicked 'OK'
            
{
                switch( 
listitem //Checks through the available languages (Defined above)
                
{
                    case 
0//English
                    
{
                        
English[playerid] = 1;
                        
Spanish[playerid] = 0;
                         
SendClientMessage(playeridCOLOR_SUCCESS"Your language has been set to English.");
                        
ShowPlayerDialog(playeridDIALOG_PASSWORDDIALOG_STYLE_PASSWORD"{0092FF}Register Panel""\n{FFFFFF}Please put a password below:""Register""Cancel");
                    }
                    case 
1// Espaсol
                    
{
                        
English[playerid] = 0;
                        
Spanish[playerid] = 1;
                         
SendClientMessage(playeridCOLOR_SUCCESS"Su idioma ha sido configurado a Espaсol.");
                        
SendClientMessage(playeridDIALOG_PASSWORDDIALOG_STYLE_PASSWORD"{0092FF}Panel de Registro""\n{FFFFFF}pon tu contraseсa abajo""Registrar""Cancelar");
                    }
                }
            }
            else return 
ShowPlayerDialog(playeridDIALOG_LANGUAGEDIALOG_STYLE_LIST""#CYAN"Select your language "#WHITE"(Seleccione su idioma)", LANGUAGE_SELECTION, "OK", ""); //If they hit ESC while on the dialog (trying to bug the system?)
        
}
    }
    return 
true;

If work +rep.
Reply
#3

Dont work, now im trying this but i have this error:

Код:
C:\Users\Jaua\Desktop\Clean Server\gamemodes\Nuevo.pwn(317) : error 035: argument type mismatch (argument 3)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
line 317:

PHP код:
SendClientMessage(playeridDIALOG_PASSWORDDIALOG_STYLE_PASSWORD"{0092FF}Panel de Registro""\n{FFFFFF}pon tu contraseсa abajo:""Registrar""Cancelar"); 
Reply
#4

PHP код:
ShowPlayerDialog(playeridDIALOG_PASSWORDDIALOG_STYLE_PASSWORD"{0092FF}Panel de Registro""\n{FFFFFF}pon tu contraseсa abajo:""Registrar""Cancelar"); 
You can't use SendClientMessage with a diaglogs.
Reply
#5

Quote:
Originally Posted by RedRex
Посмотреть сообщение
PHP код:
ShowPlayerDialog(playeridDIALOG_PASSWORDDIALOG_STYLE_PASSWORD"{0092FF}Panel de Registro""\n{FFFFFF}pon tu contraseсa abajo:""Registrar""Cancelar"); 
You can't use SendClientMessage with a diaglogs.
still not working my friend i made something wrong, take a look to my code:

PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == DIALOG_LANGUAGE)
    {
        if(
response)
        {
        
English[playerid] = 1;
        
Spanish[playerid] = 0;
        
SendClientMessage(playeridCOLOR_SUCCESS"Your language has been set to English.");
        }
        else
        {
        
English[playerid] = 0;
        
Spanish[playerid] = 1;
        
SendClientMessage(playeridCOLOR_SUCCESS"Su idioma ha sido configurado a Espaсol.");
        }
        return 
1;
    }
    return 
1;
}
if(
dialogid == DIALOG_LANGUAGE)
        {
            if(
response == 1)
            {
                
ShowPlayerDialog(playeridDIALOG_PASSWORDDIALOG_STYLE_PASSWORD"{0092FF}Register Panel""\n{FFFFFF}Please put a password below:""Register""Cancel");
            }
            else
            {
                
ShowPlayerDialog(playeridDIALOG_PASSWORDDIALOG_STYLE_PASSWORD"{0092FF}Panel de Registro""\n{FFFFFF}pon tu contraseсa abajo:""Registrar""Cancelar");
            }
        } 
Reply
#6

Sir remove your OnDialogResponse and put this new one.

PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    switch( 
dialogid )
    {
        case 
DIALOG_LANGUAGE:
        {
            if( 
response //They clicked 'OK'
            
{
                switch( 
listitem //Checks through the available languages (Defined above)
                
{
                    case 
0//English
                    
{
                        
English[playerid] = 1;
                        
Spanish[playerid] = 0;
                         
SendClientMessage(playeridCOLOR_SUCCESS"Your language has been set to English.");
                        
ShowPlayerDialog(playeridDIALOG_PASSWORDDIALOG_STYLE_PASSWORD"{0092FF}Register Panel""\n{FFFFFF}Please put a password below:""Register""Cancel");
                    }
                    case 
1// Espaсol
                    
{
                        
English[playerid] = 0;
                        
Spanish[playerid] = 1;
                         
SendClientMessage(playeridCOLOR_SUCCESS"Su idioma ha sido configurado a Espaсol.");
                        
ShowPlayerDialog(playeridDIALOG_PASSWORDDIALOG_STYLE_PASSWORD"{0092FF}Panel de Registro""\n{FFFFFF}pon tu contraseсa abajo""Registrar""Cancelar");
                    }
                }
            }
            else return 
ShowPlayerDialog(playeridDIALOG_LANGUAGEDIALOG_STYLE_LIST""#CYAN"Select your language "#WHITE"(Seleccione su idioma)", LANGUAGE_SELECTION, "OK", ""); //If they hit ESC while on the dialog (trying to bug the system?)
        
}
    }
    return 
true;

Reply
#7

alright i dont have errors but is not showing me nothing, thanks anyways bro
Reply
#8

You don't show the dialog? How? Can you check your codes again.
Reply
#9

If I were you, I would use YSI language or ScavengeSurvive language. The usage of them are too easy and better then switching Player[playerid][pLanguage]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)