Bug with dialogs[+REP]
#1

Hello
I did a prison FS and now when i have the cell dialog i press on any thing and it's buying like in 24/7
I mean i have the cells dialog but it's buying cellphone Walkie talkie and the all shits in 24/7
How can i fix it?
Reply
#2

you messed up in dialogids, and without viewing codes we can't do anything (that's common sense)
Reply
#3

It is better to do #define DIALOG_WHATEVER X <- X = the dialogid than doing it with numbers and having to remember them
Reply
#4

buy dialog
pawn Код:
if(dialogid == BUYDIALOG)
    {
        if(listitem == 0)
        {
            if(GetCash(playerid) > 150)
            {
                if(PlayerInfo[playerid][pTraderPerk] > 0)
                {
                    new skill = 150 / 100;
                    new price = (skill)*(PlayerInfo[playerid][pTraderPerk]);
                    new payout = 150 - price;
                    format(string, sizeof(string), "~r~-$%d", payout);
                    GameTextForPlayer(playerid, string, 5000, 1);
                    GiveCash(playerid,- payout);
                    SBizzInfo[9][sbTill] += payout;
                    ExtortionSBiz(9, payout);
                }
                else
                {
                    format(string, sizeof(string), "~r~-$%d", 150);
                    GameTextForPlayer(playerid, string, 5000, 1);
                    GiveCash(playerid,-150);
                    SBizzInfo[9][sbTill] += 150;
                    ExtortionSBiz(9, 150);
                }
                PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                new randphone = 100000 + random(899999);//minimum 1000  max 9999
                PlayerInfo[playerid][pPnumber] = randphone;
                format(string, sizeof(string), "   Mobile Phone Purchased your new Number is %d", randphone);
                SendClientMessage(playerid, COLOR_GRAD4, string);
                SendClientMessage(playerid, COLOR_GRAD5, "You can check this anytime by Typing /stats");
                SendClientMessage(playerid, COLOR_WHITE, "HINT: You can now type /help to see your cell phone commands.");
                return 1;
            }
            else SendClientMessage(playerid, COLOR_WHITE, "   You don't have the cash for that !");
        }
        else if(listitem == 1)
        {
            if(GetCash(playerid) > 2500)
            {
                if(PlayerInfo[playerid][pWT] == 1)
                    {SendClientMessage(playerid, COLOR_GRAD4, "  You already have a Walkie Talkie"); return 1; }
                GiveCash(playerid,-2500);
                SBizzInfo[9][sbTill] += 2500;
                ExtortionSBiz(9, 2500);
                format(string, sizeof(string), "~r~-$%d", 2500);
                GameTextForPlayer(playerid, string, 5000, 1);
                SBizzInfo[9][sbProducts]--;
                PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                format(string, sizeof(string), "Walkie Talkie Purchased.");
                PlayerInfo[playerid][pWT] = 1;
                SendClientMessage(playerid, COLOR_GRAD4, string);
                SendClientMessage(playerid, COLOR_WHITE, "HINT: Type /WT to talk in a walkie talkie channel ");
                SendClientMessage(playerid, COLOR_WHITE, "HINT: Type /Channel to set your walkie talkie channel ");
                return 1;
            }
            else SendClientMessage(playerid, COLOR_WHITE, "   You don't have the cash for that !");
        }
        else if(listitem == 2)
        {
            if(GetCash(playerid) > 10)
            {
                if(PlayerInfo[playerid][pTraderPerk] > 0)
                {
                    new skill = 10 / 100;
                    new price = (skill)*(PlayerInfo[playerid][pTraderPerk]);
                    new payout = 10 - price;
                    GiveCash(playerid,- payout);
                    SBizzInfo[9][sbTill] += payout;
                    ExtortionSBiz(9, payout);
                    format(string, sizeof(string), "~r~-$%d", payout);
                    GameTextForPlayer(playerid, string, 5000, 1);
                }
                else
                {
                    GiveCash(playerid,-10);
                    SBizzInfo[9][sbTill] += 10;
                    ExtortionSBiz(9, 10);
                    format(string, sizeof(string), "~r~-$%d", 10);
                    GameTextForPlayer(playerid, string, 5000, 1);
                }
                PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                gDice[playerid] = 1;
                format(string, sizeof(string), "   Dice Purchased you can throw your Dice.");
                SendClientMessage(playerid, COLOR_GRAD4, string);
                SendClientMessage(playerid, COLOR_WHITE, "HINT: Type /dice ");
                return 1;
            }
            else SendClientMessage(playerid, COLOR_WHITE, "   You don't have the cash for that !");
        }
        else if(listitem == 3)
        {
            if(GetCash(playerid) > 200)
            {
                PlayerInfo[playerid][pGasCan] = 1;
                PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                SendClientMessage(playerid, COLOR_WHITE, "HINT: Go to the gas station and fill your can type /get fuel");
                SendClientMessage(playerid, COLOR_WHITE, "HINT: Type /fillup after you filled up your gas can");
                GameTextForPlayer(playerid, "~r~-$200", 5000, 1);
                GiveCash(playerid, - 200);
                SBizzInfo[9][sbTill] += 200;
                ExtortionSBiz(9, 200);
                return 1;
            }
            else SendClientMessage(playerid, COLOR_WHITE, "   You don't have the cash for that !");
        }
        else if(listitem == 4)
        {
            if(GetCash(playerid) > 100)
            {
                if(PlayerInfo[playerid][pWatch] != 0)
                {
                    SendClientMessage(playerid, COLOR_GREY, "You already have one");
                    return 1;
                }
                GiveCash(playerid, - 100);
                SBizzInfo[9][sbTill] += 100;
                ExtortionSBiz(9, 100);
                format(string, sizeof(string), "~r~-$%d", 100);
                GameTextForPlayer(playerid, string, 5000, 1);
                PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                format(string, sizeof(string), "Watch Purchased.");
                SendClientMessage(playerid, COLOR_WHITE, "HINT: /time");
                SendClientMessage(playerid, COLOR_GRAD4, string);
                PlayerInfo[playerid][pWatch] = 1;
                return 1;
            }
            else SendClientMessage(playerid, COLOR_WHITE, "   You don't have the cash for that !");
        }
        else if(listitem == 5)
        {
            if(GetCash(playerid) > 150)
            {
                if(PlayerInfo[playerid][pFishTool] != 0)
                {
                    SendClientMessage(playerid, COLOR_GREY, "   You already have one !");
                    return 1;
                }
                GiveCash(playerid, - 150);
                SBizzInfo[9][sbTill] += 150;
                ExtortionSBiz(9, 150);
                format(string, sizeof(string), "~r~-$%d", 150);
                GameTextForPlayer(playerid, string, 5000, 1);
                PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                SendClientMessage(playerid, COLOR_GRAD4, "Fishing rod Purchased.");
                PlayerInfo[playerid][pFishTool] = 1;
                return 1;
            }
            else SendClientMessage(playerid, COLOR_WHITE, "   You don't have the cash for that !");
        }
        else if(listitem == 6)
        {
            if(GetCash(playerid) > 50)
            {
                if(Rope[playerid] >= 5)
                {
                    SendClientMessage(playerid, COLOR_GREY, "   You have 5 already !");
                    return 1;
                }
                GiveCash(playerid, - 50);
                SBizzInfo[9][sbTill] += 10;
                ExtortionSBiz(9, 10);
                format(string, sizeof(string), "~r~-$%d", 50);
                GameTextForPlayer(playerid, string, 5000, 1);
                PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                SendClientMessage(playerid, COLOR_GRAD4, "Rope Purchased.");
                SendClientMessage(playerid, COLOR_GRAD4, "HINT: You can /tie now.");
                Rope[playerid]++;
                return 1;
            }
            else SendClientMessage(playerid, COLOR_WHITE, "   You don't have the cash for that !");
        }
        else if(listitem == 7)
        {
            if(GetCash(playerid) > 200)
            {
                GiveCash(playerid, - 200);
                SBizzInfo[9][sbTill] += 200;
                ExtortionSBiz(9, 200);
                format(string, sizeof(string), "~r~-$%d", 200);
                GameTextForPlayer(playerid, string, 5000, 1);
                PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                SendClientMessage(playerid, COLOR_GRAD4, "Spray can Purchased.");
                AC_GivePlayerWeapon(playerid, 41, 500);
                return 1;
            }
            else SendClientMessage(playerid, COLOR_WHITE, "   You don't have the cash for that !");
        }
        else if(listitem == 8)
        {
            if(GetCash(playerid) > 5)
            {
                if(PlayerInfo[playerid][pLighter] != 0)
                {
                    SendClientMessage(playerid, COLOR_GREY, "   You already have a lighter ! ");
                    return 1;
                }
                GiveCash(playerid, - 5);
                SBizzInfo[9][sbTill] += 5;
                ExtortionSBiz(9, 5);
                PlayerInfo[playerid][pLighter] = 1;
                PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                format(string, sizeof(string), "~r~-$%d", 5);
                GameTextForPlayer(playerid, string, 5000, 1);
                SendClientMessage(playerid, COLOR_GRAD4, "Lighter Purchased.");
                OnPlayerAccountSave(playerid);
                return 1;
            }
            else SendClientMessage(playerid, COLOR_WHITE, "   You don't have the cash for that !");
        }
        else if(listitem == 9)
        {
            if(GetCash(playerid) > 30)
            {
                if(PlayerInfo[playerid][pCigarettes] != 0)
                {
                    format(string, sizeof(string), "   You already have %d cigarettes left .", PlayerInfo[playerid][pCigarettes]);
                    SendClientMessage(playerid, COLOR_GREY, string);
                    return 1;
                }
                GiveCash(playerid, - 30);
                SBizzInfo[9][sbTill] += 30;
                ExtortionSBiz(9, 30);
                PlayerInfo[playerid][pCigarettes] = 20;
                PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                format(string, sizeof(string), "~r~-$%d", 30);
                GameTextForPlayer(playerid, string, 5000, 1);
                SendClientMessage(playerid, COLOR_GRAD4, "Cigarettes Purchased.");
                SendClientMessage(playerid, COLOR_WHITE, "HINT: You can /smoke now !");
                OnPlayerAccountSave(playerid);
                return 1;
            }
            else SendClientMessage(playerid, COLOR_WHITE, "   You don't have the cash for that !");
        }
        else if(listitem == 10)
        {
            if(GetCash(playerid) > 850)
            {
                GiveCash(playerid, -850);
                SBizzInfo[9][sbTill] += 850;
                ExtortionSBiz(9, 850);
                AC_GivePlayerWeapon(playerid, 5, 1);
                PlayerInfo[playerid][pGun1] = 5; PlayerInfo[playerid][pAmmo1] = 1;
                PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                format(string, sizeof(string), "~r~-$%d", 850);
                GameTextForPlayer(playerid, string, 5000, 1);
                SendClientMessage(playerid, COLOR_GRAD4, "BaseBall Bat Purchased.");
                OnPlayerAccountSave(playerid);
                return 1;
            }
            else SendClientMessage(playerid, COLOR_WHITE, "   You don't have the cash for that !");
        }
        else if(listitem == 11)
        {
            if(GetCash(playerid) > 599)
            {
                PlayerInfo[playerid][pMask] = 1;
                SendClientMessage(playerid, COLOR_WHITE, "HINT: Type /maskon,/maskoff");
                GameTextForPlayer(playerid, "~r~-$600", 5000, 1);
                GiveCash(playerid, - 600);
                SBizzInfo[9][sbTill] += 600;
                ExtortionSBiz(9, 600);
                return 1;
            }
            else SendClientMessage(playerid, COLOR_WHITE, "   You don't have the cash for that !");
        }
        else if(listitem == 12)
        {
            if(GetCash(playerid) > 100)
            {
                if(!Kerchief[playerid])
                {
                    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                    Kerchief[playerid]=true;
                    GiveCash(playerid, - 100);
                    SBizzInfo[9][sbTill] += 100;
                    ExtortionSBiz(9, 100);
                    SendClientMessage(playerid, COLOR_GRAD4, "Kerchief Purchased.");
                    SendClientMessage(playerid, COLOR_GRAD4, "HINT: You can /covereyes now.");
                    return 1;
                }
                else SendClientMessage(playerid, COLOR_GREY, "You already have a kerchief!");
            }
            else SendClientMessage(playerid, COLOR_WHITE, "   You don't have the cash for that !");
        }
        else
            SendClientMessage(playerid, COLOR_WHITE, "   Your selection menu has been canceled");
    }
the cells dialog
pawn Код:
if(dialogid == 1338)
   {
        if(!response) return ShowPlayerDialog(playerid, 1335, DIALOG_STYLE_LIST, " Please Choose what you want to do...","Open the Cells\nClose the Cells","Ok","Cancel");
        switch(listitem)
                {
                    case 0:
                    {
                        MoveObject(Cell0,377.69546509,179.25382996,889.29455566,2.250000);
                        SendClientMessage(playerid,COLOR_WHITE, "Cell NO.1 is now closed!");
                    }
                    case 1:
                    {
                        MoveObject(Cell1,383.57598877,179.13928223,889.29455566,2.250000);
                        SendClientMessage(playerid,COLOR_WHITE, "Cell NO.2 is now closed!");
                    }
                    case 2:
                    {
                        MoveObject(Cell2,389.14746094,179.17053223,889.29455566,2.250000);
                        SendClientMessage(playerid,COLOR_WHITE, "Cell NO.3 is now closed!");
                    }
                    case 3:
                    {
                        MoveObject(Cell3,393.99261475,163.01403809,889.29455566,2.250000);
                        SendClientMessage(playerid,COLOR_WHITE, "Cell NO.4 is now closed!");
                    }
                    case 4:
                    {
                        MoveObject(Cell4,388.64166260,163.08963013,889.29455566,2.250000);
                        SendClientMessage(playerid,COLOR_WHITE, "Cell NO.5 is now closed!");
                    }
                    case 5:
                    {
                        MoveObject(Cell5,382.90737915,163.05653381,894.43408203,2.250000);
                        SendClientMessage(playerid,COLOR_WHITE, "Cell NO.6 is now closed!");
                    }
                    case 6:
                    {
                        MoveObject(Cell6,388.19750977,163.05236816,894.43408203,2.250000);
                        SendClientMessage(playerid,COLOR_WHITE, "Cell NO.7 is now closed!");
                    }
                    case 7:
                    {
                        MoveObject(Cell7,393.85983276,163.09884644,894.43408203,2.250000);
                        SendClientMessage(playerid,COLOR_WHITE, "Cell NO.8 is now closed!");
                    }
                    case 8:
                    {
                        MoveObject(Cell8,389.14746094,179.16992188,894.46875000,2.250000);
                        SendClientMessage(playerid,COLOR_WHITE, "Cell NO.9 is now closed!");
                    }
                    case 9:
                    {
                        MoveObject(Cell9,383.28500366,179.09257507,894.46875000,2.250000);
                        SendClientMessage(playerid,COLOR_WHITE, "Cell NO.10 is now closed!");
                    }
                    case 10:
                    {
                        MoveObject(Cell10,377.63180542,179.12403870,894.46875000,2.250000);
                        SendClientMessage(playerid,COLOR_WHITE, "Cell NO.11 is now closed!");
                    }
                    case 11:
                    {
                        MoveObject(Cell0,377.69546509,179.25382996,889.29455566,2.250000);
                        MoveObject(Cell1,383.57598877,179.13928223,889.29455566,2.250000);
                        MoveObject(Cell2,389.14746094,179.17053223,889.29455566,2.250000);
                        MoveObject(Cell3,393.99261475,163.01403809,889.29455566,2.250000);
                        MoveObject(Cell4,388.64166260,163.08963013,889.29455566,2.250000);
                        MoveObject(Cell5,382.90737915,163.05653381,894.43408203,2.250000);
                        MoveObject(Cell6,388.19750977,163.05236816,894.43408203,2.250000);
                        MoveObject(Cell7,393.85983276,163.09884644,894.43408203,2.250000);
                        MoveObject(Cell8,389.14746094,179.16992188,894.46875000,2.250000);
                        MoveObject(Cell9,383.28500366,179.09257507,894.46875000,2.250000);
                        MoveObject(Cell10,377.63180542,179.12403870,894.46875000,2.250000);
                        SendClientMessage(playerid,COLOR_WHITE, "You have closed all the cells!");
                    }
                }
    }


    return 1;
}
Reply
#5

You should show us #define BUYDIALOG
Reply
#6

Sloved NVM thanks +REP
Reply
#7

I have another orror help with this one?
pawn Код:
if(PRESSED(KEY_WALK) && IsPlayerInRangeOfPoint(playerid, 1.5,298.2446, 201.8958, 889.5491 & if(IsACop(playerid)))
Errors:
pawn Код:
C:\Documents and Settings\Administrator.WINXPSP3\щемзп дтбегд\сън\Server\filterscripts\OZPris.pwn(140) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administrator.WINXPSP3\щемзп дтбегд\сън\Server\filterscripts\OZPris.pwn(140) : error 001: expected token: ";", but found ")"
C:\Documents and Settings\Administrator.WINXPSP3\щемзп дтбегд\сън\Server\filterscripts\OZPris.pwn(140) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administrator.WINXPSP3\щемзп дтбегд\сън\Server\filterscripts\OZPris.pwn(140) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
Reply
#8

pawn Код:
if(PRESSED(KEY_WALK) && IsPlayerInRangeOfPoint(playerid, 1.5,298.2446, 201.8958, 889.5491) && IsACop(playerid))
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)