Multi-Language Dialog
#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


Messages In This Thread
Multi-Language Dialog - by XxerykxX - 01.05.2010, 20:25
Re: Multi-Language Dialog - by johnnyc - 01.05.2010, 20:40
Re: Multi-Language Dialog - by XxerykxX - 01.05.2010, 20:42
Re: Multi-Language Dialog - by johnnyc - 01.05.2010, 20:45
Re: Multi-Language Dialog - by XxerykxX - 01.05.2010, 20:50
Re: Multi-Language Dialog - by denis1999 - 02.05.2010, 07:44
Re: Multi-Language Dialog - by Lorenc_ - 02.05.2010, 07:57
Re: Multi-Language Dialog - by LZLo - 25.07.2010, 10:03

Forum Jump:


Users browsing this thread: 2 Guest(s)