rep + dialog problem.
#10

Quote:
Originally Posted by niels44
Посмотреть сообщение
try this:
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == russianbar)
    {
        if(response)
        {
            switch(listitem)
            {
                case 0:
                {

                    if(GetPlayerMoney(playerid) < 25) return SendClientMessage(playerid, 0xFF0000FF, "You don't have enough cash.");
                    GivePlayerMoney(playerid, -25);
                    GetPlayerHealth(playerid,hp);
                    SetPlayerHealth(playerid,hp+15);



                }
                case 1:
                {
                    if(GetPlayerMoney(playerid) < 50) return SendClientMessage(playerid, 0xFF0000FF, "You don't have enough cash.");
                    GivePlayerMoney(playerid, -50);
                    GetPlayerHealth(playerid,hp);
                    SetPlayerHealth(playerid,hp+25);

                }
                case 2:
                {
                    if(GetPlayerMoney(playerid) < 15) return SendClientMessage(playerid, 0xFF0000FF, "You don't have enough cash.");
                    GivePlayerMoney(playerid, -15);
                    GetPlayerHealth(playerid,hp);
                    SetPlayerHealth(playerid,hp+35);


                }
                case 3:
                {
                    if(GetPlayerMoney(playerid) < 75) return SendClientMessage(playerid, 0xFF0000FF, "You don't have enough cash.");
                    GivePlayerMoney(playerid, -75);
                    GetPlayerHealth(playerid,hp);
                    SetPlayerHealth(playerid,hp+40);

                }
                case 4:
                {
                    if(GetPlayerMoney(playerid) < 100) return SendClientMessage(playerid, 0xFF0000FF, "You don't have enough cash.");
                    GivePlayerMoney(playerid, -100);
                    GetPlayerHealth(playerid,hp);
                    SetPlayerHealth(playerid,hp+50);
                }
            }
        }
        return 0;
    }
    if(dialogid == danielsbar)
    {
        if(response)
        {
            switch(listitem)
            {
                case 0:
                {

                    if(GetPlayerMoney(playerid) < 25) return SendClientMessage(playerid, 0xFF0000FF, "You don't have enough cash.");
                    GivePlayerMoney(playerid, -25);
                    GetPlayerHealth(playerid,hp);
                    SetPlayerHealth(playerid,hp+15);



                    }
                case 1:
                {
                    if(GetPlayerMoney(playerid) < 50) return SendClientMessage(playerid, 0xFF0000FF, "You don't have enough cash.");
                    GivePlayerMoney(playerid, -50);
                    GetPlayerHealth(playerid,hp);
                    SetPlayerHealth(playerid,hp+25);

                    }
                case 2:
                {
                    if(GetPlayerMoney(playerid) < 15) return SendClientMessage(playerid, 0xFF0000FF, "You don't have enough cash.");
                    GivePlayerMoney(playerid, -15);
                    GetPlayerHealth(playerid,hp);
                    SetPlayerHealth(playerid,hp+35);

                    }
                case 3:
                {
                    if(GetPlayerMoney(playerid) < 75) return SendClientMessage(playerid, 0xFF0000FF, "You don't have enough cash.");
                    GivePlayerMoney(playerid, -75);
                    GetPlayerHealth(playerid,hp);
                    SetPlayerHealth(playerid,hp+40);

                    }
                case 4:
                {
                    if(GetPlayerMoney(playerid) < 200) return SendClientMessage(playerid, 0xFF0000FF, "You don't have enough cash.");
                    GivePlayerMoney(playerid, -200);
                    GetPlayerHealth(playerid,hp);
                    SetPlayerHealth(playerid,hp+50);


                    }
                }
            }
        }
    return 1;
}
Thanks man worked! If I want to add the 3rd one how? all rep +
Reply


Messages In This Thread
rep + dialog problem. - by oscar7610 - 23.04.2012, 18:10
Re: rep + dialog problem. - by .FuneraL. - 23.04.2012, 18:19
Re: rep + dialog problem. - by ViniBorn - 23.04.2012, 18:19
Re: rep + dialog problem. - by Ballu Miaa - 23.04.2012, 18:22
Re: rep + dialog problem. - by kikito - 23.04.2012, 18:23
Re: rep + dialog problem. - by oscar7610 - 23.04.2012, 18:25
Re: rep + dialog problem. - by oscar7610 - 23.04.2012, 18:27
Re: rep + dialog problem. - by Calgon - 23.04.2012, 18:27
Re: rep + dialog problem. - by niels44 - 23.04.2012, 18:28
Re: rep + dialog problem. - by oscar7610 - 23.04.2012, 18:29

Forum Jump:


Users browsing this thread: 1 Guest(s)