Multi-Language Dialog
#1

Hello.
As title says i need it.. If somebody have example of it with one command I would like to get it

Thanks..
Reply
#2

Something like : ?

Welcome to [ Server Name ] Choose the languge you want:
DIALOG:
|English| - |Italian| - |Chinese|


if yes, you can do it as just a dialog ( do nothing ) or if you have 3 languges or something then we its something else
Reply
#3

I want with 2 languages like:

When player connects everything is in English then when he spawn the dialog pops up and there is:

English
Polish

If player choose English language stay same if player choose Polish language changes and when he type
/language the dialog pop up and can change again
Reply
#4

You need to translate everything -.- to have 2 languges isnt easy to do
Reply
#5

Dont worry i just need to have example..
Reply
#6

stock LanguageDialog(playerid, dialog, styldialog, dehlavicka[], enhlavicka[], deobsah[], enobsah[], detlacidlo[], entlacidlo[], detlacidlo2[],entlacidlo2[])
{
switch(Lang[playerid])
{
case 1: ShowPlayerDialog(playerid, dialog, styldialog, dehlavicka, deobsah, detlacidlo, detlacidlo2);
case 2: ShowPlayerDialog(playerid, dialog, styldialog, enhlavicka, enobsah, entlacidlo, entlacidlo2);
}
return 1;
}
Reply
#7

Anywhere on ur script:

Код:
new English[MAX_PLAYERS];
new Polish[MAX_PLAYERS];
Under onplayerconnect:

Код:
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX, "LANGUAGE", "Choose a Language", "English", "Polish");
Under ondialogresponse:
Код:
	if(dialogid == 1)
	{
		if(response)
		{
		English[playerid] = 1;
		Polish[playerid] = 0;
 		SendClientMessage(playerid, 0xFFFFFFFF, "Your Language has been set to English.");
		}
		else
		{
   		English[playerid] = 0;
        Polish[playerid] = 1;
	 	SendClientMessage(playerid, 0xFFFFFFFF, "Your Language has been set to Polish"); //Translate if you want...
		}
		return 1;
	}
Now if you want to make a command for a player on either lang:

Код:
	if (strcmp("/mycommand", cmdtext, true, 10) == 0) // english
	{
		if(English[playerid] == 1)
	    {
	         //DO SOMETHING HERE
	    }
		return 1;
	}

	if (strcmp("/mycommand", cmdtext, true, 10) == 0) // polish
	{
		if(Polish[playerid] == 1)
	    {
	         //DO SOMETHING HERE
	    }
		return 1;
	}
Basic way but works..
Reply
#8

D:\SZERУM 8.1 running on RC8\gamemodes\PSD.pwn(9077) : error 017: undefined symbol "kstring"
D:\SZERУM 8.1 running on RC8\gamemodes\PSD.pwn(9077) : error 017: undefined symbol "kstring"

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)