Help with register and login sisyem with textdraw
#1

Hey guys im making a multilingual server with english and spanish but im a little confused cuz i dont know where i have to put my codes, what variables i need etc etc, can you explain to be how its the correct way please?

First to all i would like to ask the player when log in the game ask always in which language he want to play so i made it and put it on player connect (please correct me if i am wrong):

Code:
public OnPlayerConnect(playerid)
{
	SetPlayerColor(playerid, 0xFFFFFFFF);
	ShowPlayerDialog(playerid,0,DIALOG_STYLE_MSGBOX,"                                                              {0092FF}Bienvenido | Welcome","{FFFFFF}Por favor, elija el idioma en el que desea visualizar el servidor. | Please, choose a language you would like to display this server.","Espaсol","English");
	return 1;
}
I dont know where to to this:

Code:
DIALOG_LANGUAGE:
		{
			pLanguage[playerid] = (!response) ? (false) : (true);
			SendLanguageMessage(playerid, COLOR_SUCCESS, "Your language has been set to English.", "Su idioma ha sido configurado a Espaсol.");
Now i want a thing that check if player is registered or not of course showing the dialog with the respective language that the player has chosen.

Code:
new string[500];
	if(logeo == false)
	{
	    format(string, sizeof(string), pLanguage[playerid] == false ? ("{FFFFFF}That usename isn't registered, please put your password below:\n\n{0092FF}Username: {FFFFFF}%s\n\n{0092FF}Password: ") : ("{FFFFFF}Usuario no registrado, por favor ingrese su contraseсa abajo:\n\n{0092FF}Nombre de Usuario: {FFFFFF}%s\n\n{0092FF}Contraseсa: "), GetName(playerid));
	    ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, pLanguage[playerid] == false ? ("{0092FF}Unregistered Account") : ("{0092FF}Cuenta no registrada"), string, pLanguage[playerid] == false ? ("Sign Up") : ("Registrarme"),  pLanguage[playerid] == false ? ("Quit") : ("Salir"));
	}
	else
	{
	    format(string, sizeof(string), pLanguage[playerid] == false ? ("{0092FF}Username: {FFFFFF}%s\n\n{FFFFFF}That usename is registered, please put your password below:") : ("{0092FF}Nombre de Usuario: {FFFFFF}%s\n\n{FFFFFF}Estб usuario esta registrado, por favor ingrese su contraseсa abajo:"), GetName(playerid));
	    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, pLanguage[playerid] == false ? ("{0092FF}Registered Account") : ("{0092FF}Cuenta registrada"), string, pLanguage[playerid] == false ? ("Login") : ("Inciar Sesiуn"),  pLanguage[playerid] == false ? ("Quit") : ("Salir"));
	}
}
Code:
DIALOG_NATIONALITY
			ShowLanguageDialog(playerid, DIALOG_NATIONALITY, DIALOG_STYLE_INPUT, "{0092FF}Character Nationality", "Next", "Back", \
																				"{0092FF}Nacionalidad del Personaje", "Siguiente", "Atrбs");
		}
		case DIALOG_NACIONALTY:
		{
		    if(!response)
		    {
		        ShowLanguageDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, "{0092FF}Character Age", "{FFFFFF}What's your character age?\n{0092FF}Note: Must be between 18 and 100", "Next", "Back", \
																				"{0092FF}Edad del Personaje", "{FFFFFF}Cuбl es la edad de tu personaje?\n{0092FF}Nota: Debe ser entre 18 y 100", "Siguiente", "Atrбs");
				return 1;
			}
			ShowLanguageDialog(playerid, DIALOG_SEX, DIALOG_STYLE_MSGBOX, "{0092FF}Character Gender", "{FFFFFF}What do you want your character's gender to be?", "{FF55A3}Female", "{0092FF}Male", \
																				"{0092FF}Genero del Personaje", "{FFFFFF}Cuбl es el gйnero de tu personaje?", "{FF55A3}Femenino", "{0092FF}Masculino");
		}
		case DIALOG_CITY:
		{
			ShowLanguageDialog(playerid, DIALOG_REFERRER_1, DIALOG_STYLE_LIST, "{0092FF}Choose a City", "{FFFFFF}In which city would you like to spawn?", "Accept", "Back", \
																				"{0092FF}Escoja una Ciudad", "{FFFFFF}їEn que ciudad te gustarнa aparecer?", "Aceptar", "Atras");
after this i would like to start the tutorial but that will be later for now i just want to know how can i do to with this things. Thanks in advance guys.
Reply
#2

What you have here are a bunch of dialogs, not textdraws. Know the difference. If you want to know how to use dialogs in your code, refer to the following links to get you started with:

https://sampforum.blast.hk/showthread.php?tid=379247
https://sampforum.blast.hk/showthread.php?tid=236561

https://sampwiki.blast.hk/wiki/ShowPlayerDialog
https://sampwiki.blast.hk/wiki/OnDialogResponse
Reply
#3

Alright i'll check this, thanks alot man
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)