SA-MP Forums Archive
Server crash on dialog - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Server crash on dialog (/showthread.php?tid=438985)



Server crash on dialog - CJay9209 - 23.05.2013

hey guys - got this inside ondialogresponse :

pawn Код:
if(dialogid == TSYS_DIALOG_BANK_MENU) {
        if(!response) return SendClientMessage(playerid, TSYS_COLOR_BRIGHTRED, "Input Cancelled by user!");
        switch(listitem) {
            case 0:{
                format(string1,sizeof(string1),"%s's Bank Statement.",TSYSPlayerInfo[playerid][name]);
                format(string2,sizeof(string2),"Branch Info: %s \nClient Name: %s \nAccount Number: #%d \nAccount Balance: $%d",TSYSBankInfo[bankid][name],TSYSPlayerInfo[playerid][name],TSYSPlayerInfo[playerid][acc],TSYSPlayerInfo[playerid][bank]);
                ShowPlayerDialog(playerid, TSYS_DIALOG_BANK_STATEMENT, DIALOG_STYLE_MSGBOX, string1, string2, "Close", "");
            }
            case 1:{
                ShowPlayerDialog(playerid, TSYS_DIALOG_BANK_WITHDRAW, DIALOG_STYLE_INPUT, "RPG Bank System: ", "Please enter the amount you wish to withdraw from your bank account.", "Submit", "Cancel");
            }
            case 2:{
                ShowPlayerDialog(playerid, TSYS_DIALOG_BANK_DEPOSIT, DIALOG_STYLE_INPUT, "RPG Bank System: ", "Please enter the amount you wish to deposit into your bank account.", "Submit", "Cancel");
            }
        }
    }
basically either on displaying the msgbox dialog or hitting the close button the server crashes. Code compiles great! Any idea why server is crashing?


Re: Server crash on dialog - CJay9209 - 23.05.2013

Will do thanks for the suggestion


Re: Server crash on dialog - CJay9209 - 24.05.2013

ok have debugged a little further. I get:
Код:
[21:19:23] [debug] Server crashed while executing RPGD.amx
[21:19:23] [debug] AMX backtrace:
[21:19:23] [debug] #0 native CallLocalFunction () [00471e90] from samp-server.exe
[21:19:23] [debug] #1 0001fc64 in public OnDialogResponse (playerid=0, dialogid=567, response=0, listitem=-1, inputtext[]=@0x045ee478 "") at D:\Games\GTA San Andreas\server\pawno\include\TSYS\tsys_core.lib:342
[21:19:23] [debug] System backtrace:
[21:19:23] [debug] #0 004010b6 in ?? () from D:\Games\GTA San Andreas\server\samp-server.exe
[21:19:23] [debug] #1 689c39e2 in ?? () from D:\Games\GTA San Andreas\server\plugins\crashdetect.DLL
[21:19:23] [debug] #2 689c5e26 in ?? () from D:\Games\GTA San Andreas\server\plugins\crashdetect.DLL
[21:19:23] [debug] #3 689bbf3f in ?? () from D:\Games\GTA San Andreas\server\plugins\crashdetect.DLL
[21:19:23] [debug] #4 689c3a0e in ?? () from D:\Games\GTA San Andreas\server\plugins\crashdetect.DLL
[21:19:23] [debug] #5 0046da61 in ?? () from D:\Games\GTA San Andreas\server\samp-server.exe
[21:19:23] [debug] #6 004527d0 in ?? () from D:\Games\GTA San Andreas\server\samp-server.exe
[21:19:23] [debug] #7 00498ba9 in ?? () from D:\Games\GTA San Andreas\server\samp-server.exe
[21:19:23] [debug] #8 004a3fce in ?? () from D:\Games\GTA San Andreas\server\samp-server.exe
Now here is the code in question. To be honest I'm not sure what is going wrong. Is there a limitation to what I can hook using ALS?
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    AC_ODR(playerid, dialogid, response, listitem, inputtext);
    BSYS_ODR(playerid, dialogid, response, listitem, inputtext);
    VSYS_ODR(playerid, dialogid, response, listitem, inputtext);
    return CallLocalFunction("TSYS_OnDialogResponse", "iiiis", playerid, dialogid, response, listitem, inputtext);
}

#if defined _ALS_OnDialogResponse
    #undef OnDialogResponse
#else
    #define _ALS_OnDialogResponse
#endif
#define OnDialogResponse TSYS_OnDialogResponse
Line 342 where the crash is is at the return line.


Re: Server crash on dialog - CJay9209 - 24.05.2013

ok thanks - I've fixed the empty string issue for now but I'm gonna update as soon as I can then