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 ![Smiley](images/smilies/smile.png)
|
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.