Error with OnDialogResponse (Crash Detect Return).
#1

I know this is quite a lot to ask and I'd seriously appreciate anyone, personally who manages to see why this happens...


The server crashes when this happens:

When I use DIALOG_GRIPS, it crashes, every other dialog works fine. I've no idea what is the cause of this?

Could someone assist me.

However, it only crashes when I add, DIALOG_RANDOMS back into the server...I think theres a link.

THIS IS RETURNED UNDER SERVER_LOG from CRASHDETECT.
Quote:

[02:24:35] [debug] Server crashed while executing TRRP_MYSQL.amx
[02:24:35] [debug] AMX backtrace:
[02:24:35] [debug] #0 native format () [00470b70] from samp-server.exe
[02:24:35] [debug] #1 0005b324 in public OnDialogResponse (0x00000000, 0x0000001a, 0x00000001, 0x00000000, 0x0014c1c4) from TRRP_MYSQL.amx
[02:24:35] [debug] Native backtrace:
[02:24:35] [debug] #0 00403334 in ?? () from C:\Users\user\Desktop\Bone County Roleplay\samp-server.exe
[02:24:35] [debug] #1 5ad05f2a in ?? () from C:\Users\user\Desktop\Bone County Roleplay\plugins\crashdetect.DLL
[02:24:35] [debug] #2 5ad0822e in ?? () from C:\Users\user\Desktop\Bone County Roleplay\plugins\crashdetect.DLL
[02:24:35] [debug] #3 5acfff6f in ?? () from C:\Users\user\Desktop\Bone County Roleplay\plugins\crashdetect.DLL
[02:24:35] [debug] #4 5ad05f7a in ?? () from C:\Users\user\Desktop\Bone County Roleplay\plugins\crashdetect.DLL
[02:24:35] [debug] #5 0046d7b1 in ?? () from C:\Users\user\Desktop\Bone County Roleplay\samp-server.exe
[02:24:35] [debug] #6 00452710 in ?? () from C:\Users\user\Desktop\Bone County Roleplay\samp-server.exe
[02:24:35] [debug] #7 7717e38c in ?? () from C:\Windows\SysWOW64\ntdll.dll
[02:24:35] [debug] #8 7717e0f2 in ?? () from C:\Windows\SysWOW64\ntdll.dll
[02:24:35] [debug] #9 004988e9 in ?? () from C:\Users\user\Desktop\Bone County Roleplay\samp-server.exe
[02:24:35] [debug] #10 0045aeda in ?? () from C:\Users\user\Desktop\Bone County Roleplay\samp-server.exe
[02:24:35] [debug] #11 100016df in ?? () from C:\Users\user\Desktop\Bone County Roleplay\plugins\mysql.DLL
[02:24:35] [debug] #12 100081b2 in ?? () from C:\Users\user\Desktop\Bone County Roleplay\plugins\mysql.DLL
[02:24:35] [debug] #13 0048886d in ?? () from C:\Users\user\Desktop\Bone County Roleplay\samp-server.exe
[02:24:35] [debug] #14 5c8b01f8 in ?? () from C:\Users\user\Desktop\Bone County Roleplay\samp-server.exe
[02:24:35] [debug] #15 61750824 in ?? () from C:\Users\user\Desktop\Bone County Roleplay\samp-server.exe
DIALOG_RANDOMS

Is this creating an infinite loop?
pawn Код:
else if(dialogid == DIALOG_RANDOMS)
            {
            new str[128];
            if(response == 0)
                {
                    ShowPlayerDialog(playerid, DIALOG_PARTLIST, DIALOG_STYLE_LIST, "Part Selection", "{FF0000}Grips\n{FF0000}Frames\n{FF0000}Barrels\n{FF0000}Random Packages",  "Select", "Cancel");
                }
                switch(listitem)
                {
                    case 0://Random Package.
                    {
                        if(PlayerMoney[playerid] < 1500)return SendClientMessage(playerid, COLOUR_GREY, "You do not have this much money.");
                        GivePlayerMoney(playerid, -1500);
                        PlayerSQLID[playerid] = MySQL_GetValue(PlayerSQLID[playerid], "id", "accounts");
                        new rand[3];
                        new randStr[3][25];


                        for(new i = 0; i < sizeof rand; i++)
                        {
                            rand[i] = random(3);
                            switch(rand[i])
                            {
                            case 0:
                                {
                                    format(randStr[i], 25, "Small Grip");
                                    SGrip[playerid] ++;
                                    MySQL_SetInteger(PlayerSQLID[playerid], "SGrip", SGrip[playerid], "accounts");

                                }
                            case 1:
                                {
                                    format(randStr[i], 25, "Medium Grip");
                                    MGrip[playerid] ++;
                                    MySQL_SetInteger(PlayerSQLID[playerid], "MGrip", MGrip[playerid], "accounts");
                                }
                            case 2:
                                {
                                    format(randStr[i], 25, "Large Grip");
                                    LGrip[playerid] ++;
                                    MySQL_SetInteger(PlayerSQLID[playerid], "LGrip", LGrip[playerid], "accounts");
                                }//case 2
                            }//switch
                        }//fornew
                            format(str, sizeof(str),"You got a {33AA33}%s{FFFFFF}, a {33AA33}%s {FFFFFF}and a {33AA33}%s {FFFFFF}from the package.", randStr[0], randStr[1], randStr[2]);
                            SendClientMessage(playerid, COLOUR_WHITE, str);
                    }//actual case
                    case 1://Random Package.
                    {
                        if(PlayerMoney[playerid] < 3000)return SendClientMessage(playerid, COLOUR_GREY, "You do not have this much money.");
                        GivePlayerMoney(playerid, -3000);
                        PlayerSQLID[playerid] = MySQL_GetValue(PlayerSQLID[playerid], "id", "accounts");

                        new rand1[3];
                        new randStr1[3][25];

                        for(new i = 0; i < sizeof rand1; i++)
                        {
                            rand1[i] = random(3);
                            switch(rand1[i])
                            {
                            case 0:
                                {
                                    format(randStr1[i], 25, "Small Frame");
                                    SFrame[playerid] ++;
                                    MySQL_SetInteger(PlayerSQLID[playerid], "SFrame", SFrame[playerid], "accounts");

                                }
                            case 1:
                                {
                                    format(randStr1[i], 25, "Medium Frame");
                                    MFrame[playerid] ++;
                                    MySQL_SetInteger(PlayerSQLID[playerid], "MFrame", MFrame[playerid], "accounts");
                                }
                            case 2:
                                {
                                    format(randStr1[i], 25, "Large Frame");
                                    LFrame[playerid] ++;
                                    MySQL_SetInteger(PlayerSQLID[playerid], "LFrame", LFrame[playerid], "accounts");
                                }//case 2
                            }//switch
                        }//switch
                            format(str, sizeof(str),"You got a {33AA33}%s{FFFFFF}, a {33AA33}%s {FFFFFF}and a {33AA33}%s {FFFFFF}from the package.", randStr1[0], randStr1[1], randStr1[2]);
                            SendClientMessage(playerid, COLOUR_WHITE, str);
                    }//case
                    case 2://Random Package.
                    {
                        if(PlayerMoney[playerid] < 2000)return SendClientMessage(playerid, COLOUR_GREY, "You do not have this much money.");
                        GivePlayerMoney(playerid, -2000);
                        PlayerSQLID[playerid] = MySQL_GetValue(PlayerSQLID[playerid], "id", "accounts");
                        new rand2[3];
                        new randStr2[3][25];


                        for(new i = 0; i < sizeof rand2; i++)
                        {
                            rand2[i] = random(3);
                            switch(rand2[i])
                            {
                            case 0:
                                {
                                    format(randStr2[i], 25, "Small Barrel");
                                    SBarrel[playerid] ++;
                                    MySQL_SetInteger(PlayerSQLID[playerid], "SBarrel", SBarrel[playerid], "accounts");

                                }
                            case 1:
                                {
                                    format(randStr2[i], 25, "Medium Barrel");
                                    MBarrel[playerid] ++;
                                    MySQL_SetInteger(PlayerSQLID[playerid], "MBarrel", MBarrel[playerid], "accounts");
                                }
                            case 2:
                                {
                                    format(randStr2[i], 25, "Large Barrel");
                                    LBarrel[playerid] ++;
                                    MySQL_SetInteger(PlayerSQLID[playerid], "LBarrel", LBarrel[playerid], "accounts");
                                }//case 2
                            }//switch

                        }//for
                            format(str, sizeof(str),"You got a {33AA33}%s{FFFFFF}, a {33AA33}%s {FFFFFF}and a {33AA33}%s {FFFFFF}from the package.", randStr2[0], randStr2[1], randStr2[2]);
                            SendClientMessage(playerid, COLOUR_WHITE, str);
                    }//case
                }//switch
            }//dialog
DIALOG_GRIPS.
pawn Код:
else if(dialogid == DIALOG_GRIPS)
            {
                printf("CALLED DIALOG_GRIPS");
                if(response == 0)
                {
                    ShowPlayerDialog(playerid, DIALOG_PARTLIST, DIALOG_STYLE_LIST, "Part Selection", "{FF0000}Grips\n{FF0000}Frames\n{FF0000}Barrels\n{FF0000}Random Packages", "Select",  "Cancel");
                }
                switch(listitem)
                {
                    case 0:
                    {

                        PlayerMoney[playerid] = GetPlayerMoney(playerid);
                        if(PlayerMoney[playerid] < 300)return SendClientMessage(playerid, COLOUR_GREY, "You do not have this much money.");
                        GivePlayerMoney(playerid, -300);
                        PlayerSQLID[playerid] = MySQL_GetValue(PlayerSQLID[playerid], "id", "accounts");
                        SGrip[playerid] ++;
                        MySQL_SetInteger(PlayerSQLID[playerid], "SGrip", SGrip[playerid], "accounts");
                        format(str, sizeof(str), "You have purchased a Small Grip, you now have a total of %d.", SGrip[playerid]);
                        SendClientMessage(playerid, COLOUR_WHITE, str);
                    }
                    case 1:
                    {

                        if(PlayerMoney[playerid] < 500)return SendClientMessage(playerid, COLOUR_GREY, "You do not have this much money.");
                        GivePlayerMoney(playerid, -500);
                        PlayerSQLID[playerid] = MySQL_GetValue(PlayerSQLID[playerid], "id", "accounts");
                        MGrip[playerid] ++;
                        MySQL_SetInteger(PlayerSQLID[playerid], "MGrip", MGrip[playerid], "accounts");
                        format(str, sizeof(str), "You have purchased a Medium Grip, you now have a total of %d.", MGrip[playerid]);
                        SendClientMessage(playerid, COLOUR_WHITE, str);
                    }
                    case 2:
                    {

                        if(PlayerMoney[playerid] < 750)return SendClientMessage(playerid, COLOUR_GREY, "You do not have this much money.");
                        GivePlayerMoney(playerid, -750);
                        PlayerSQLID[playerid] = MySQL_GetValue(PlayerSQLID[playerid], "id", "accounts");
                        LGrip[playerid] ++;
                        MySQL_SetInteger(PlayerSQLID[playerid], "LGrip", LGrip[playerid], "accounts");
                        format(str, sizeof(str), "You have purchased a Large Grip, you now have a total of %d.", LGrip[playerid]);
                        SendClientMessage(playerid, COLOUR_WHITE, str);

                    }
                }
            }
I would appreciate any assistance and pointers!
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)