SA-MP Forums Archive
Server Crash with 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 with DIALOG (/showthread.php?tid=615638)



Server Crash with DIALOG - PrettyDiamond - 25.08.2016

Hello all,

I cannt find the bug wiht this dialogs! Can anyone Help me?

PHP код:
else if(dialogid == DIALOG_CBZ)
    {
        if(
response)
        {
            new 
timpzile strval(inputtext);
            if(
timpzile>=0&&timpzile<=30)
            {
                
format(string,256,"Okay, so you set %d days.",timpzile);
                
SCM(playerid,COLOR_YELLOW,string);
                
zile=timpzile;
                
ShowPlayerDialog(playerid,DIALOG_CBO,DIALOG_STYLE_INPUT,""color_red"Write hours(0-24):"," ","OK","");
            }
            else return 
ShowPlayerDialog(playerid,DIALOG_CBZ,DIALOG_STYLE_INPUT,""color_red"Write Days(0-30):"," ","OK","");
        }
    }
    else if(
dialogid == DIALOG_CBO)
    {
        if(
response)
        {
            new 
timpore strval(inputtext);
            if(
timpore>=0&&timpore<=24)
            {
                
format(string,256,"Okay, so you set %d hours.",timpore);
                
SCM(playerid,COLOR_YELLOW,string);
                
ore=timpore;
                
ShowPlayerDialog(playerid,DIALOG_CBM,DIALOG_STYLE_INPUT,""color_red"Write minutes(0-60):"," ","OK","");
            }
            else return 
ShowPlayerDialog(playerid,DIALOG_CBO,DIALOG_STYLE_INPUT,""color_red"Write hours(0-24):"," ","OK","");
        }
    }
    else if(
dialogid == DIALOG_CBM)
    {
        if(
response)
        {
            new 
timpminute strval(inputtext);
            if(
timpminute>=0&&timpminute<=60)
            {
                
format(string,256,"Okay, so you set %d minutes.",timpminute);
                
SCM(playerid,COLOR_YELLOW,string);
                
minute=timpminute;
                
ShowPlayerDialog(playerid,DIALOG_CBS,DIALOG_STYLE_INPUT,""color_red"Write seconds(0-60):"," ","OK","");
            }
            else return 
ShowPlayerDialog(playerid,DIALOG_CBM,DIALOG_STYLE_INPUT,""color_red"Write minutes(0-60):"," ","OK","");
        }
    }
    else if(
dialogid == DIALOG_CBS)
    {
        if(
response)
        {
            new 
timpsecunde strval(inputtext);
            if(
timpsecunde>=0&&timpsecunde<=60)
            {
                
format(string,256,"Okay ,so you set %d seconds.",timpsecunde);
                
SCM(playerid,COLOR_YELLOW,string);
                
SCM(playerid,COLOR_2RED,"");
                
SCM(playerid,COLOR_2RED,"Time begin to run!");
                
secunde=timpsecunde;
                
TextDrawShowForAll(WiiTD4);
                
TextDrawShowForAll(WiiTD5);
                
TextDrawShowForAll(WiiTD6);
                
TextDrawShowForAll(WiiTD7);
                
TextDrawShowForAll(WiiTD8);
                
TextDrawShowForAll(WiiTD9);
                
TextDrawShowForAll(WiiTD10);
                
TextDrawShowForAll(WiiTD11);
                
TextDrawShowForAll(WiiTD12);
                
TextDrawShowForAll(WiiTD13);
                
scurgere=1;
                
UpdateMinute();
            }
            else return 
ShowPlayerDialog(playerid,DIALOG_CBS,DIALOG_STYLE_INPUT,""color_red"Write seconds(0-60):"," ","OK","");
        }
    }
    return 
1
Код:
[00:34:42] [debug] Server crashed while executing ******.amx
[00:34:42] [debug] AMX backtrace:
[00:34:42] [debug] #0 native CallRemoteFunction () from samp03svr
[00:34:42] [debug] #1 000458e0 in __SendClientMessage (playerid=2, color=-16382209, string[]=@00161f40 "") at D:\sampserver37utils\avt\pawno\include\AudioHideV2.inc:71
[00:34:42] [debug] #2 0005c74c in public DR_OnDialogResponse (playerid=2, dialogid=35, response=1, listitem=-1, inputtext[]=@0119b500 "10") at D:\sampserver37utils\*****.pwn:3271
[00:34:42] [debug] #3 00042b50 in public OnDialogResponse (playerid=2, dialogid=35, response=1, listitem=-1, inputtext[]=@0119b500 "10") at D:\sampserver37utils\avt\pawno\include\easyDialog.inc:135
[00:34:42] [debug] Native backtrace:
[00:34:42] [debug] #0 b744de8b in _ZN10StackTraceC1EPv () from plugins/crashdetect.so
[00:34:42] [debug] #1 b7446bcf in _ZN11CrashDetect20PrintNativeBacktraceERSoPv () from plugins/crashdetect.so
[00:34:42] [debug] #2 b7447dbc in _ZN11CrashDetect20PrintNativeBacktraceEPv () from plugins/crashdetect.so
[00:34:42] [debug] #3 b7448226 in _ZN11CrashDetect11OnExceptionEPv () from plugins/crashdetect.so
[00:34:42] [debug] #4 b744dadc in ?? () from plugins/crashdetect.so
[00:34:42] [debug] #5 b77a2d08 in __kernel_rt_sigreturn () from linux-gate.so.1
[00:34:42] [debug] #6 080df82b in ?? () from ./samp03svr
[00:34:42] [debug] #7 080950e4 in ?? () from ./samp03svr
[00:34:42] [debug] #8 b744994b in _ZN11CrashDetect13DoAmxCallbackEiPiS0_ () from plugins/crashdetect.so
[00:34:42] [debug] #9 b744c8f8 in ?? () from plugins/crashdetect.so
[00:34:42] [debug] #10 b7450916 in amx_Exec () from plugins/crashdetect.so
[00:34:42] [debug] #11 b7448be6 in _ZN11CrashDetect9DoAmxExecEPii () from plugins/crashdetect.so
[00:34:42] [debug] #12 b744c659 in ?? () from plugins/crashdetect.so
[00:34:42] [debug] #13 b73b388a in ?? () from plugins/streamer.so
[00:34:42] [debug] #14 080a682f in ?? () from ./samp03svr
[00:34:42] [debug] #15 080b2c44 in ?? () from ./samp03svr
[00:34:42] [debug] #16 08071d38 in ?? () from ./samp03svr
[00:34:42] [debug] #17 08071e32 in ?? () from ./samp03svr
[00:34:42] [debug] #18 0807bc50 in ?? () from ./samp03svr
[00:34:42] [debug] #19 080aed3d in ?? () from ./samp03svr
[00:34:42] [debug] #20 080aef02 in ?? () from ./samp03svr
[00:34:42] [debug] #21 080aa13a in ?? () from ./samp03svr
[00:34:42] [debug] #22 b748ba63 in __libc_start_main () from /lib/i386-linux-gnu/i686/cmov/libc.so.6
LINE 3271

SCM(playerid,COLOR_2RED,"Time begin to run!");

Thanks for any Help


Re: Server Crash with DIALOG - Stinged - 25.08.2016

Are all dialogs crashing? Or just DIALOG_CBS?


Re: Server Crash with DIALOG - Konstantinos - 25.08.2016

Код:
#0 native CallRemoteFunction () from samp03svr
#1 000458e0 in __SendClientMessage (playerid=2, color=-16382209, string[]=@00161f40 "") at D:\sampserver37utils\avt\pawno\include\AudioHideV2.inc:71
The issue with CallRemoteFunction is very well-known: passing empty strings will result to a server crash.
From what I see in the logs, the string was passed in __SendClientMessage is empty. Can you post that function from AudioHideV2.inc file?


Re: Server Crash with DIALOG - PrettyDiamond - 25.08.2016

@Stinged only DIALOG_CBS

@Konstantinos

Quote:

stock __SendClientMessage(playerid, color, const string[])
{
if(!_AHLoaded)return _SendClientMessage(playerid,color,string);
return CallRemoteFunction("AH_SendClientMessage","ixs",pl ayerid,color,string); <---- LINE 71
}

I deactivate my AudioHide stuff, then all works fine! But i need the AudioHide include. How can i Handle this`?


Re: Server Crash with DIALOG - Stinged - 25.08.2016

Replace it with this:

pawn Код:
stock __SendClientMessage(playerid, color, const string[])
{  
    if(!_AHLoaded)return _SendClientMessage(playerid,color,string);

    if (!string[0]) return CallRemoteFunction("AH_SendClientMessage","ixs",playerid,color,"\1");
    return CallRemoteFunction("AH_SendClientMessage","ixs",playerid,color,string);
}



Re: Server Crash with DIALOG - PrettyDiamond - 25.08.2016

@Stinged very thx this fixed the bug +REPed

@Konstantinos this helped me to find the way to a solution. Btw i know "The issue with CallRemoteFunction is very well-known: passing empty strings will result to a server crash." but this dont fix the bug, what can appear for eacht other in millions diferent types. Also i +REPed you