Dialog help.Not working when click an option.
#2

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 3300)//our dialog!
    {
        if(response == 1)// They pressed the first button.
        {
            switch(listitem)
            {
                case 0:// The first item listed
                {
                       if(GetPlayerMoney(playerid) < 50) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
                       GivePlayerMoney(playerid, -50);
                       SetPlayerAttachedObject(playerid, 0, 18976, 2);
                }
                case 1: // The second item listed
                {
                    if(GetPlayerMoney(playerid) < 50) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
                    GivePlayerMoney(playerid, -50);
                    SetPlayerAttachedObject(playerid, 0, 18976, 2);
                }
                case 2: // The third item listed
                {
                    if(GetPlayerMoney(playerid) < 3) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
                    GivePlayerMoney(playerid, -3);
                    SetPlayerAttachedObject(playerid, 0, 18976, 2);
                }
                case 3: // The forth item listed
                {
                    if(GetPlayerMoney(playerid) < 50) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
                    GivePlayerMoney(playerid, -50);
                    SetPlayerAttachedObject(playerid, 0, 18976, 2);
                }
                case 4: // The forth item listed
                {
                    if(GetPlayerMoney(playerid) < 50) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
                    GivePlayerMoney(playerid, -50);SetPlayerAttachedObject(playerid, 3, 18976, 2, 0.101, -0.0, 0.0, 2.0, 90.60, 83.7, 1.05, 1.2, 1, 0xF500ED);
                    SetPlayerAttachedObject(playerid, 0, 19467, 2);
                }
                case 5: // The forth item listed
                {
                    if(GetPlayerMoney(playerid) < 50) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
                    GivePlayerMoney(playerid, -50);
                    SetPlayerAttachedObject(playerid, 0, 19487, 2);
                }
                case 6: // The forth item listed
                {
                    if(GetPlayerMoney(playerid) < 50) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
                    GivePlayerMoney(playerid, -50);
                    SetPlayerAttachedObject(playerid, 0, 19487, 2);
                }
                case 7: // The forth item listed
                {
                    if(GetPlayerMoney(playerid) < 50) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
                    GivePlayerMoney(playerid, -50);
                    SetPlayerAttachedObject(playerid, 0, 19487, 2);
                }
            }
            return 1;
        }
        if(response == 0)
        {
            ShowPlayerDialog(playerid,-1,-1,"","","","");
            return 1;
        }
    }
    return 1;
}
At the top of your script, put #pragma tabsize 0

This should work for you.
Reply


Messages In This Thread
Dialog help.Not working when click an option. - by TaLhA XIV - 12.08.2012, 16:07
Re: Dialog help.Not working when click an option. - by phillip875 - 12.08.2012, 16:17
Re: Dialog help.Not working when click an option. - by Faisal_khan - 12.08.2012, 16:23
Re: Dialog help.Not working when click an option. - by TaLhA XIV - 12.08.2012, 16:25

Forum Jump:


Users browsing this thread: 1 Guest(s)