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
#2

Bump
Reply
#3

Bump again.
Reply
#4

Still unresolved.
Reply
#5

I'm not sure is this your problem, but it would be easier if you would put
Код:
for(new i = 0; i < 3; i++)
                        {
                            rand[i] = random(3);
// rest of the code
if this doesn't change anything, try to divide your code into small pieces and add SendClientMessage or print to send the message so you can see which parts actually work. I hope I helped you little bit.
EDIT: I think your problem is that you are using sizeof and you have no brackets after it, so everything in the code that is written after your sizeof will be checked as it would be inside the brackets.
Reply
#6

I'm afraid that didn't do anything, thanks though...Still unresolved.
Reply
#7

http://forum.sa-mp.com/showthread.ph...ghlight=detect

compile with debug -d3 and show one more time errors
Reply
#8

Will do.
Reply
#9

Hey, this is what it returned.

Quote:

[23:06:46] CALLED DIALOG_GRIPS
[23:06:46] [debug] Server crashed while executing TRRP_MYSQL.amx
[23:06:46] [debug] AMX backtrace:
[23:06:46] [debug] #0 native format () [00470b70] from samp-server.exe
[23:06:46] [debug] #1 00075290 in public OnDialogResponse (playerid=0, dialogid=26, response=1, listitem=0, inputtext[]=@0x0014c1c4 "Small Grip ($300)") at C:\Users\user\Desktop\Bone County Roleplay\gamemodes\TRRP_MYSQL.pwn:9566
[23:06:47] [debug] Native backtrace:
[23:06:47] [debug] #0 00403334 in ?? () from C:\Users\user\Desktop\Bone County Roleplay\samp-server.exe
[23:06:47] [debug] #1 705d5f2a in ?? () from C:\Users\user\Desktop\Bone County Roleplay\plugins\crashdetect.DLL
[23:06:47] [debug] #2 705d822e in ?? () from C:\Users\user\Desktop\Bone County Roleplay\plugins\crashdetect.DLL
[23:06:47] [debug] #3 705cff6f in ?? () from C:\Users\user\Desktop\Bone County Roleplay\plugins\crashdetect.DLL
[23:06:47] [debug] #4 705d5f7a in ?? () from C:\Users\user\Desktop\Bone County Roleplay\plugins\crashdetect.DLL
[23:06:47] [debug] #5 0046d7b1 in ?? () from C:\Users\user\Desktop\Bone County Roleplay\samp-server.exe
[23:06:47] [debug] #6 00452710 in ?? () from C:\Users\user\Desktop\Bone County Roleplay\samp-server.exe
[23:06:47] [debug] #7 77e0e023 in ?? () from C:\Windows\SysWOW64\ntdll.dll
[23:06:47] [debug] #8 759514ad in ?? () from C:\Windows\syswow64\kernel32.dll
[23:06:47] [debug] #9 004a3d0e in ?? () from C:\Users\user\Desktop\Bone County Roleplay\samp-server.exe
[23:06:47] [debug] #10 68106ac3 in ?? () from C:\Users\user\Desktop\Bone County Roleplay\samp-server.exe
[23:06:47] [debug] #11 004b1c78 in ?? () from C:\Users\user\Desktop\Bone County Roleplay\samp-server.exe

Reply
#10

Show line 9566 from TRRP_MYSQL.pwn

its
pawn Код:
format(randStr[i], 25, "Small Grip");
?

last info is CALLED DIALOG_GRIPS so why format(randStr[i], 25, "Small Grip");
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)