enum { DIALOG_SREDNJA, DIALOG_FAX, }
public OnPlayerCommandText(playerid, cmdtext[]) if(strcmp(cmdtext, "/flesson", true, 6) == 0) { ShowPlayerDialog(playerid, DIALOG_FAX, DIALOG_STYLE_LIST, "select direction","Electric\nComputer\nMedical","OK","End"); return 1; } if(strcmp(cmdtext, "/slesson", true, 6) == 0) { ShowPlayerDialog(playerid, DIALOG_SREDNJA, DIALOG_STYLE_LIST, "select direction","Electric\nComputer\nGymnasium\nMedical","OK","End"); return 1; } return 0; } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid == DIALOG_FAX) { if(response) { SendClientMessage(playerid, 0x33AA33AA, "You have chosen the right direction , teaching begins!"); } else { Kick(playerid); } return 1; } if(dialogid == DIALOG_SREDNJA) { if(response) { SendClientMessage(playerid, 0x33AA33AA, "You have chosen the right direction , teaching begins!"); } else { Kick(playerid); } return 1; } return 0; }
#define DIALOG_FAX #define DIALOG_SREDNJA
#define DIALOG_WEAPONS 3 // In some command ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_LIST, "Weapons", "Desert Eagle\nAK-47\nCombat Shotgun", "Select", "Close"); public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid == DIALOG_WEAPONS) { if(response) // If they clicked 'Select' or double-clicked a weapon { // Give them the weapon switch(listitem) { case 0: GivePlayerWeapon(playerid, WEAPON_DEAGLE, 14); // Give them a desert eagle case 1: GivePlayerWeapon(playerid, WEAPON_AK47, 120); // Give them an AK-47 case 2: GivePlayerWeapon(playerid, WEAPON_SHOTGSPA, 28); // Give them a Combat Shotgun } } return 1; // We handled a dialog, so return 1. Just like OnPlayerCommandText. } return 0; // You MUST return 0 here! Just like OnPlayerCommandText. }
enum
{
DIALOG_SREDNJA,
DIALOG_FAX // you added a comma here
}
What a retarded reply from both of you |