enum pInfo { pLang1, pLang2, } new PlayerInfo[MAX_PLAYERS][pInfo];
ShowPlayerDialog(playerid,69,DIALOG_STYLE_LIST,"Select your language","Language1\nLanguage2","Select","Cancel");
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"); PlayerInfo[playerid][pLang1] =1; } case 1: { SendClientMessage(playerid,0xFF0000FF,"You selected language 2"); PlayerInfo[playerid][pLang2] =1; } } return 1; } } return 1;
if(strcmp(cmd, "/minigames", true) == 0) { if(PlayerInfo[playerid][pLang1] == 1) { ShowPlayerDialog(playerid, 656454, DIALOG_STYLE_MSGBOX, "Here is the text with language 1", "Ok", "" ); } else if(PlayerInfo[playerid][pLang2] == 1) { ShowPlayerDialog(playerid, 656454, DIALOG_STYLE_MSGBOX, "Here is the text with language 2", "Ok", "" ); } }
return 0;
return 1;
Hello all,
4. And here its 1 of my commands with these 2 languages : pawn Код:
|
When you compile script do you see any warning? |
enum pInfo { pLang1, pLang2, } new PlayerInfo[MAX_PLAYERS][pInfo]; |
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", "" );
}
}
if(strcmp(cmd, "/minigames", true) == 0)
{
if(PlayerInfo[playerid][pLang1] == 1)
{
ShowPlayerDialog(playerid, 656454, DIALOG_STYLE_MSGBOX, "Language 1","Here is the text with language 1", #Ok, #);
return 1;
}
else if(PlayerInfo[playerid][pLang2] == 1)
{
ShowPlayerDialog(playerid, 656454, DIALOG_STYLE_MSGBOX, "Language 2", "Here is the text with language 2", #Ok, #);
return 1;
}
}
enum pInfo { pEnglish, pSerbian, } new PlayerInfo[MAX_PLAYERS][pInfo]; In your language dialog make that if player chooses English then = 1 and Serbian = 0 if Serbian then = 1 and English = 0. Now make command like that pawn Code: public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/kill", cmdtext, true, 10) == 0) { SetPlayerHealth(playerid,0); if(PlayerInfo[playerid][pEnglish] == 1) { SendClientMessage(playerid,0xFF0000FF,"You suck"); } if(PlayerInfo[playerid][pSerbian] == 1) { SendClientMessage(playerid,0xFF0000FF,"You suck in serbian"); } } return 0; }
if (strcmp("/kill", cmdtext, true, 10) == 0) { if(PlayerInfo[playerid][pEnglish] == 1) { SetPlayerHealth(playerid,0); SendClientMessage(playerid,0xFF0000FF,"You suck"); } if(PlayerInfo[playerid][pSerbian] == 1) { SetPlayerHealth(playerid,0); SendClientMessage(playerid,0xFF0000FF,"You suck in serbian"); } } // i do not see return here why?