28.05.2012, 13:50
Hello, I will show you the easiest way (I think), how to make an order in several languages.
1.Add this variable.
2.Now create command
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.
4.Add to OnDialogResponse
So much was it ...
1.Add this variable.
Код:
enum OptiuniServer { Limba }; new Option[OptiuniServer];
Код:
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; }
3.At the end OnPlayerLogin do so.
Код:
ShowPlayerDialog(playerid,1996,DIALOG_STYLE_LIST,"Limba/Language/Idioma","Romana\nEnghlis\nEspaГ±ol","Select", "");
Код:
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."); } } }