pawn Код:
// Define the dialog ID so we can handle responses
#define DIALOG_LENGUAGE 1
new Idiomas[3][MAX_PLAYERS]; //0 spanish 1 english 2 morce.
CMD:lenguage(playerid, params[]){return ShowPlayerDialog(playerid, DIALOG_LENGUAGE, DIALOG_STYLE_LIST, "Lenguage?", "Spanish\nEnglish\nMorce", "Select", "Close");}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_LENGUAGE)
{
if(response) // If they clicked 'Select' or double-clicked a weapon
{
// Give them the weapon
switch(listitem)
{
case 0:
{
SendClientMessage(playerid,-1,"Has seleccionado el idioma espaсol");
Idiomas[0][playerid] = 1; //spanish
Idiomas[1][playerid] = 0; //0 use else if
Idiomas[2][playerid] = 0; //0 ""
}
case 1:
{
SendClientMessage(playerid,-1,"You have selected the English language");
Idiomas[0][playerid] = 0;
Idiomas[1][playerid] = 1; //english
Idiomas[2][playerid] = 0;
}
case 2:
{
SendClientMessage(playerid,-1,"-.-- --- ..- / .... .- ...- . / ... . .-.. . -.-. - . -.. / - .... . / -- --- .-. -.-. . .-.-.");
Idiomas[0][playerid] = 0;
Idiomas[1][playerid] = 0;
Idiomas[2][playerid] = 1; // morce
}
}
}
return 1; // We handled a dialog, so return 1. Just like OnPlayerCommandText.
}
return 0; // You MUST return 0 here! Just like OnPlayerCommandText.
}
//ejemplos de uso:
CMD:comandos(playerid, params[])
{
if(Idiomas[0][playerid])
{
SendClientMessage(playerid,-1,"Comandos disponibles /help /paja /kill /dance");
}
else if(Idiomas[1][playerid])
{
SendClientMessage(playerid,-1,"commands available /help /paja /kill /dance");
}
else if(Idiomas[2][playerid])
{
SendClientMessage(playerid,-1,"-.-. --- -- -- .- -. -.. ... / .- ...- .- .. .-.. .- -... .-.. . .-.-. /help /paja /kill /dance");
}
return true;
}