SA-MP Forums Archive
Server allways restarting or crashing, why? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Server allways restarting or crashing, why? (/showthread.php?tid=267407)



Server allways restarting or crashing, why? - Nexotronix - 08.07.2011

Server allways restarting or crashing!
More times it crashin and i see allways in log warnings with sscanf

Код:
 sscanf warning: Strings without a length are deprecated, please add a destination size.
i set lower the sizes of vars and set sizes like this

pawn Код:
if(sscanf(params,"s[MAX_STRING]",action))
i have then this

Код:
sscanf warning: Invalid data length.
[ sscanf warning: Invalid character in data length.
Still restarting why?

Who know reasons of crashes plese write them here!

And how to install this: https://sampforum.blast.hk/showthread.php?tid=262796


Re: Server allways restarting or crashing, why? - Basicz - 08.07.2011

Hmm, no idea.....

pawn Код:
#define MAX_STRING 1 // without brackets :\
if ( sscanf( params, "s["#MAX_STRING"]", action ) )
Or use the manual way...

pawn Код:
if ( sscanf( params, "s[256]", action ) )
Hope that helps!


Re: Server allways restarting or crashing, why? - OUL - 10.07.2011

Hm i was had similar problem before. Well i was this situation:

pawn Код:
fnc(playerid,cells,...)
{
    new
        string[ sizeof (cells) ];
    format(string, sizeof string,.....
    return playerid;
}
So my advice would be to try with

[sizeof(cell)]

In your case ( if I understood your problem good )

pawn Код:
new
   MAX_STRING = sizeof(128);
if(sscanf(params,"s["MAX_STRING"]"))



Re: Server allways restarting or crashing, why? - Outcast - 10.07.2011

Why don't you go manual with it, like Basicz suggested? You'll save some resources on strings that doesn't have to be that big.