Dialog
#3

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
new string[128];
            if(dialogid == 3)// this is for check, if the dialog id = 999, we will do these below
          {
        if(response)// if they response for the menus of dialog
        {
            if (listitem == 0)// same like above that ive explained.
            {
                    if(GetPlayerMoney(playerid) <100) return SendClientMessage(playerid,0xAA3333AA, "You do not have enough money!");
                    SendClientMessage(playerid, -1, "You've bought an package of Beer.");
                    format(string, sizeof(string), "** %s hands out some cash to the Cashier", NAMEGET(playerid));
                    NearMessageSender(playerid, 7, string, 0x2B95FFFF,0x2B95FFFF,0x2B95FFFF,0x2B95FFFF,0x2B95FFFF);
                    (HasBoughtBeer[playerid] = 1);
                    GivePlayerMoney(playerid, -100);
            }
            if (listitem == 1)// same like above tha    t ive explained.
            {
                    if(GetPlayerMoney(playerid) <100) return SendClientMessage(playerid,0xAA3333AA, "You do not have enough money!");
                    format(string, sizeof(string), "** %s hands out some cash to the Cashier ", NAMEGET(playerid));
                    NearMessageSender(playerid, 7, string, 0x2B95FFFF,0x2B95FFFF,0x2B95FFFF,0x2B95FFFF,0x2B95FFFF);
                    (HasBoughtCigar[playerid] = 1);
                    GivePlayerMoney(playerid, -100);
            }
            if (listitem == 2)
            {
                    if(GetPlayerMoney(playerid) <300) return SendClientMessage(playerid,0xAA3333AA, "You do not have enough money!");
                    SendClientMessage(playerid, -1, "You've bought an Mask.");
                    format(string, sizeof(string), "** %s hands out some cash to the Cashier ", NAMEGET(playerid));
                    NearMessageSender(playerid, 7, string, 0x2B95FFFF,0x2B95FFFF,0x2B95FFFF,0x2B95FFFF,0x2B95FFFF);
                    (HasBoughtMask[playerid] = 1);
                    GivePlayerMoney(playerid, -300);
            }
            if (listitem == 3)
            {
                    if(GetPlayerMoney(playerid) <500) return SendClientMessage(playerid,0xAA3333AA, "You do not have enough money!");
                    SendClientMessage(playerid, -1, "You've bought an Boombox.");
                    format(string, sizeof(string), "** %s hands out some cash to the Cashier. ", NAMEGET(playerid));
                    NearMessageSender(playerid, 7, string, 0x2B95FFFF,0x2B95FFFF,0x2B95FFFF,0x2B95FFFF,0x2B95FFFF);
                    (HasBoughtBoombox[playerid] = 1);
                    GivePlayerMoney(playerid, -500);
            }
            if (listitem == 4)
            {
                    if(GetPlayerMoney(playerid) <300) return SendClientMessage(playerid,0xAA3333AA, "You do not have enough money!");
                    SendClientMessage(playerid, -1, "You've bought an Bat.");
                    format(string, sizeof(string), "** %s hands out some cash to the Cashier. ", NAMEGET(playerid));
                    NearMessageSender(playerid, 7, string, 0x2B95FFFF,0x2B95FFFF,0x2B95FFFF,0x2B95FFFF,0x2B95FFFF);
                    GivePlayerWeapon(playerid, 5, 1);
                    GivePlayerMoney(playerid, -300);
            }
            if (listitem == 5)
            {
                    if(GetPlayerMoney(playerid) <100) return SendClientMessage(playerid,0xAA3333AA, "You do not have enough money!");
                    SendClientMessage(playerid, -1, "You've bought a Dice.");
                    format(string, sizeof(string), "** %s hands out some cash to the Cashier. ", NAMEGET(playerid));
                    NearMessageSender(playerid, 7, string, 0x2B95FFFF,0x2B95FFFF,0x2B95FFFF,0x2B95FFFF,0x2B95FFFF);
                    (HasBoughtDice[playerid] = 1);
                    GivePlayerMoney(playerid, -100);
            }
         }
         return 1;
        }


            if(dialogid == 2)// this is for check, if the dialog id = 999, we will do these below
          {
        if(response)// if they response for the menus of dialog
        {
            if (listitem == 0)// same like above that ive explained.
            {
            format(string, sizeof(string), "** %s Takes out the Cadet Gear and the Weapon`s", NAMEGET(playerid));
                    NearMessageSender(playerid, 7, string, 0x2B95FFFF,0x2B95FFFF,0x2B95FFFF,0x2B95FFFF,0x2B95FFFF);
                    GivePlayerWeapon(playerid, 24, 64);
                    SetPlayerArmour(playerid, 100.0);
                    SetPlayerSkin(playerid, 71);
            }
            if (listitem == 1)// same like above that ive explained.
            {
            format(string, sizeof(string), "** %s Takes out the Officer Gear and the Weapon`s", NAMEGET(playerid));
                    NearMessageSender(playerid, 7, string, 0x2B95FFFF,0x2B95FFFF,0x2B95FFFF,0x2B95FFFF,0x2B95FFFF);
                    GivePlayerWeapon(playerid, 24, 64);
                    GivePlayerWeapon(playerid, 25, 64);
                    SetPlayerArmour(playerid, 100.0);
                    SetPlayerSkin(playerid, 280);
            }
            if (listitem == 2)// same like above that ive explained.
            {
                        format(string, sizeof(string), "** %s Takes out the Senior Lead Officer Gear and the Weapon`s", NAMEGET(playerid));
                    NearMessageSender(playerid, 7, string, 0x2B95FFFF,0x2B95FFFF,0x2B95FFFF,0x2B95FFFF,0x2B95FFFF);
                    GivePlayerWeapon(playerid, 24, 64);
                    GivePlayerWeapon(playerid, 25, 64);
                    GivePlayerWeapon(playerid, 29, 64);
                    SetPlayerArmour(playerid, 100.0);
                    SetPlayerSkin(playerid, 281);
            }
            if (listitem == 3)// same like above that ive explained.
            {
            format(string, sizeof(string), "** %s Takes out the Detective Gear and the Weapon`s", NAMEGET(playerid));
                    NearMessageSender(playerid, 7, string, 0x2B95FFFF,0x2B95FFFF,0x2B95FFFF,0x2B95FFFF,0x2B95FFFF);
                    GivePlayerWeapon(playerid, 24, 64);
                    GivePlayerWeapon(playerid, 25, 64);
                    GivePlayerWeapon(playerid, 29, 64);
                    SetPlayerArmour(playerid, 100.0);
                    SetPlayerSkin(playerid, 165);
            }
            if (listitem == 4)// same like above that ive explained.
            {
            format(string, sizeof(string), "** %s Takes out the Sergeant Gear and the Weapon`s", NAMEGET(playerid));
                    NearMessageSender(playerid, 7, string, 0x2B95FFFF,0x2B95FFFF,0x2B95FFFF,0x2B95FFFF,0x2B95FFFF);
                    GivePlayerWeapon(playerid, 24, 64);
                    GivePlayerWeapon(playerid, 25, 64);
                    GivePlayerWeapon(playerid, 29, 64);
                    SetPlayerArmour(playerid, 100.0);
                    SetPlayerSkin(playerid, 283);
            }
            if (listitem == 5)// same like above that ive explained.
            {
            format(string, sizeof(string), "** %s Takes out the Liutenant Gear and the Weapon`s", NAMEGET(playerid));
                    NearMessageSender(playerid, 7, string, 0x2B95FFFF,0x2B95FFFF,0x2B95FFFF,0x2B95FFFF,0x2B95FFFF);
                    GivePlayerWeapon(playerid, 24, 64);
                    GivePlayerWeapon(playerid, 25, 64);
                    GivePlayerWeapon(playerid, 29, 64);
                    SetPlayerArmour(playerid, 100.0);
                    SetPlayerSkin(playerid, 286);
            }
            if (listitem == 6)// same like above that ive explained.
            {
            format(string, sizeof(string), "** %s Takes out the Captain Gear and the Weapon`s", NAMEGET(playerid));
                    NearMessageSender(playerid, 7, string, 0x2B95FFFF,0x2B95FFFF,0x2B95FFFF,0x2B95FFFF,0x2B95FFFF);
                    GivePlayerWeapon(playerid, 24, 64);
                    GivePlayerWeapon(playerid, 25, 64);
                    GivePlayerWeapon(playerid, 29, 64);
                    SetPlayerArmour(playerid, 100.0);
                    SetPlayerSkin(playerid, 288);
            }
            if (listitem == 7)// same like above that ive explained.
            {
            format(string, sizeof(string), "** %s Takes out the Commander Gear and the Weapon`s", NAMEGET(playerid));
                    NearMessageSender(playerid, 7, string, 0x2B95FFFF,0x2B95FFFF,0x2B95FFFF,0x2B95FFFF,0x2B95FFFF);
                    GivePlayerWeapon(playerid, 24, 64);
                    GivePlayerWeapon(playerid, 25, 64);
                    GivePlayerWeapon(playerid, 29, 64);
                    SetPlayerArmour(playerid, 100.0);
                    SetPlayerSkin(playerid, 282);
            }
            if (listitem == 8)// same like above that ive explained.
            {
            format(string, sizeof(string), "** %s Takes out the Deputy Chief Gear and the Weapon`s", NAMEGET(playerid));
                    NearMessageSender(playerid, 7, string, 0x2B95FFFF,0x2B95FFFF,0x2B95FFFF,0x2B95FFFF,0x2B95FFFF);
                    GivePlayerWeapon(playerid, 24, 64);
                    GivePlayerWeapon(playerid, 25, 64);
                    GivePlayerWeapon(playerid, 29, 64);
                    SetPlayerArmour(playerid, 100.0);
                    SetPlayerSkin(playerid, 282);
            }
            if (listitem == 9)// same like above that ive explained.
            {
            format(string, sizeof(string), "** %s Takes out the Chief of Police Gear and the Weapon`s", NAMEGET(playerid));
                    NearMessageSender(playerid, 7, string, 0x2B95FFFF,0x2B95FFFF,0x2B95FFFF,0x2B95FFFF,0x2B95FFFF);
                    GivePlayerWeapon(playerid, 24, 64);
                    GivePlayerWeapon(playerid, 25, 64);
                    GivePlayerWeapon(playerid, 29, 64);
                    SetPlayerArmour(playerid, 100.0);
                    SetPlayerSkin(playerid, 282);
            }
         }
       }
     }
     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, 2; // 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.
}
Reply


Messages In This Thread
Dialog - by nezo2001 - 11.12.2014, 18:56
Re: Dialog - by HY - 11.12.2014, 19:04
Re: Dialog - by UltraScripter - 11.12.2014, 19:04
Re: Dialog - by nezo2001 - 11.12.2014, 19:20
Re: Dialog - by MrViolence101 - 11.12.2014, 19:39
Re: Dialog - by nezo2001 - 11.12.2014, 19:42
Re: Dialog - by MrViolence101 - 11.12.2014, 19:43
Re: Dialog - by nezo2001 - 11.12.2014, 19:49
Re: Dialog - by MrViolence101 - 11.12.2014, 20:01
Re: Dialog - by nezo2001 - 11.12.2014, 20:21

Forum Jump:


Users browsing this thread: 1 Guest(s)