Format message
#4

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);
Reply


Messages In This Thread
SendFormatMessageL - by RedGun2015 - 06.08.2017, 14:23
Respuesta: Format message - by RedGun2015 - 07.08.2017, 12:35
Re: Format message - by Kraeror - 07.08.2017, 12:39
Re: Format message - by DarkZero - 07.08.2017, 13:09

Forum Jump:


Users browsing this thread: 2 Guest(s)