07.08.2017, 13:09
You can also use a specific variable for that.
pawn Код:
#define DIALOG_LANGUAGE 500
new PlayerLanguage[MAX_PLAYERS];
//under onplayerconnect for example
ShowPlayerDialog(playerid, DIALOG_LANGUAGE, DIALOG_STYLE_MSGBOX,"Language","Heyho. Please select a language.","English","Portuguese"); //or whatever your second lang is
//ondialogresponse
if(dialogid == DIALOG_LANGUAGE)
{
if(response)
{
PlayerLanguage[playerid] == 0; //english
}
else
{
PlayerLanguage[playerid] == 1;
}
}
//now you need (or can use) a stock to have a shortcut
stock SendLanguageMessage(playerid, color, msg_en[], msg_pr[])
{
if(PlayerLanguage[playerid] == 0)
SendClientMessage(playerid, color, msg_en);
else
SendClientMessage(playerid, color, msg_pr);
}
//and now you can do something like this:
new string[144], string2[144];
format(string, sizeof string, "Hello %s!", GetName(playerid));
format(string2, sizeof string2, "Ciao %s!", GetName(playerid));
SendLanguageMessage(playerid, color, string, string2);