SA-MP Forums Archive
[Tutorial] How to make an order in several languages - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Tutorials (https://sampforum.blast.hk/forumdisplay.php?fid=70)
+---- Thread: [Tutorial] How to make an order in several languages (/showthread.php?tid=346407)



How to make an order in several languages - SkL_MD - 28.05.2012

Hello, I will show you the easiest way (I think), how to make an order in several languages.

1.Add this variable.
Код:
enum OptiuniServer {
Limba };
new Option[OptiuniServer];
2.Now create command
Код:
	if(strcmp(cmd, "/cmdtest", true) == 0)
	{
		if(Option[Limba] ==1)SendClientMessage(playerid, 0xFFFFFFAA, "** Salut George ce faci?");else // Romanian
		if(Option[Limba] ==2)SendClientMessage(playerid, 0xFFFFFFAA, "** Hi Tom how are you?");else // English
		if(Option[Limba] ==3)SendClientMessage(playerid, 0xFFFFFFAA, "** Hola Xavi que passa?"); // Spanish 
                
		return 1;
	}
Now, I would recommend you to do when a player logs in, after i write the password to a dialog appears where you choose your language.
3.At the end OnPlayerLogin do so.
Код:
ShowPlayerDialog(playerid,1996,DIALOG_STYLE_LIST,"Limba/Language/Idioma","Romana\nEnghlis\nEspaГ±ol","Select", "");
4.Add to OnDialogResponse
Код:
		if(dialogid == 1996)
		{
			if(response)
			{
            	if(listitem == 0)
				{
                	Option[Limba] = 1;
                	SendClientMessage(playerid, 0xFFFFFFAA, "** Ai selectat limba romana.");
				}
				if(listitem == 1)
				{
			      	Option[Limba] = 2;
			      	SendClientMessage(playerid, 0xFFFFFFAA, "** You have selected enghlish language."); 
				}
				if(listitem == 2)
				{
			      	Option[Limba] = 3;
			      	SendClientMessage(playerid, 0xFFFFFFAA, "** Lengua espaГ±ola se ha seleccionado."); 
				}
			}
		}
So much was it ...


Re: How to make an order in several languages - seanny - 28.05.2012

Terribly indented and Never explained what each function does.


Re : How to make an order in several languages - mehdi-jumper - 28.05.2012

0/10, this is NOT a tutorial, go to hell and come back later


Re: How to make an order in several languages - MP2 - 28.05.2012

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


Re: How to make an order in several languages - [GF]Logic - 28.05.2012

Don't want to make you feel bad but it's terrible


Re: Re : How to make an order in several languages - 2KY - 28.05.2012

Quote:
Originally Posted by mehdi-jumper
Посмотреть сообщение
0/10, this is NOT a tutorial, go to hell and come back later
Why would you tell him to go to hell rather than try to help him improve his tutorial? That's extremely rude...


Re: How to make an order in several languages - Jonny5 - 29.05.2012

this code will not work properly,

af the the second player logins and select a new language it will change everyone language.

i think
pawn Код:
enum OptiuniServer {
Limba };
new Option[OptiuniServer];
would be much better like

pawn Код:
new gPlayerLang[MAX_PLAYERS];

//set it like so

gPlayerLang[playerid] = 2;
and you spell English wrong in the ShowPlayerDialog

0/10 from me.


Re: How to make an order in several languages - TheArcher - 01.06.2012

Better using YSI Language instead of variables, if you do a complex GameMode it takes a lot of memory.