SA-MP Forums Archive
Multi-Language Dialog - 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: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Multi-Language Dialog (/showthread.php?tid=145326)



Multi-Language Dialog - XxerykxX - 01.05.2010

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

Thanks..


Re: Multi-Language Dialog - johnnyc - 01.05.2010

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


Re: Multi-Language Dialog - XxerykxX - 01.05.2010

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


Re: Multi-Language Dialog - johnnyc - 01.05.2010

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


Re: Multi-Language Dialog - XxerykxX - 01.05.2010

Dont worry i just need to have example..


Re: Multi-Language Dialog - denis1999 - 02.05.2010

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;
}


Re: Multi-Language Dialog - Lorenc_ - 02.05.2010

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..


Re: Multi-Language Dialog - LZLo - 25.07.2010

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"