17.10.2011, 12:37
Quote:
enum pInfo { pLang1, pLang2, } new PlayerInfo[MAX_PLAYERS][pInfo]; |
pawn Код:
new Language[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
Language[playerid] = 1// set a default language
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid==69)
{
case 1:
{
if(!response)
{
SendClientMessage(playerid,0xFF0000FF,"You didn't choose language!");
SendClientMessage(playerid,0xFF0000FF,"So now you will be kick. | Reason: Didn't choose laguage.");
Kick(playerid);
return 1;
}
switch(listitem)
{
case 0:
{
SendClientMessage(playerid,0xFF0000FF,"You selected language 1");
Language[playerid] = 1;
}
case 1:
{
SendClientMessage(playerid,0xFF0000FF,"You selected language 2");
Language[playerid] = 2;
}
}
return 1;
}
}
return 1;
if(strcmp(cmd, "/minigames", true) == 0)
{
if(Language[playerid] == 1)
{
ShowPlayerDialog(playerid, 656454, DIALOG_STYLE_MSGBOX, "Here is the text with language 1", "Ok", "" );
}
else if(Langauge[playerid] == 2)
{
ShowPlayerDialog(playerid, 656454, DIALOG_STYLE_MSGBOX, "Here is the text with language 2", "Ok", "" );
}
}