SA-MP Forums Archive
Is that string problem ? - 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: Is that string problem ? (/showthread.php?tid=492396)



Is that string problem ? - BodyBoardVEVO - 03.02.2014

What is max string allowed ?

pawn Код:
dcmd_test(playerid,params[])
{
    #pragma unused params
    #pragma unused playerid
    new string[2000];
    strcat(string, "{B7B7B7)LEVEL 1 COMMANDS\n");
    strcat(string, "{FFFFFF)/test /test /test /test /test /test /test /test\n");
    strcat(string, "/test /test /test /test /test /test /test /test\n\n");
    strcat(string, "{B7B7B7)LEVEL 2 COMMANDS\n");
    strcat(string, "{FFFFFF)/test /test /test /test /test /test /test /test\n");
    strcat(string, "/test /test /test /test /test /test /test /test\n\n");
    strcat(string, "{B7B7B7)LEVEL 3 COMMANDS\n");
    strcat(string, "{FFFFFF)/test /test /test /test /test /test /test /test\n");
    strcat(string, "/test /test /test /test /test /test /test /test\n\n");
    strcat(string, "{B7B7B7)LEVEL 4 COMMANDS\n");
    strcat(string, "{FFFFFF)/test /test /test /test /test /test /test /test\n");
    strcat(string, "/test /test /test /test /test /test /test /test\n\n");
    strcat(string, "{B7B7B7)LEVEL 5 COMMANDS\n");
    strcat(string, "{FFFFFF)/test /test /test /test /test /test /test /test\n");
    strcat(string, "/test /test /test /test /test /test /test /test\n\n");
    strcat(string, "{B7B7B7)LEVEL 6 COMMANDS\n");
    strcat(string, "{FFFFFF)/test /test /test /test /test /test /test /test\n");
    strcat(string, "/test /test /test /test /test /test /test /test\n\n");
    strcat(string, "{B7B7B7)LEVEL 7 COMMANDS\n");
    strcat(string, "{FFFFFF)/test /test /test /test /test /test /test /test\n");
    strcat(string, "/test /test /test /test /test /test /test /test\n\n");
    strcat(string, "{B7B7B7)LEVEL 8 COMMANDS\n");
    strcat(string, "{FFFFFF)/test /test /test /test /test /test /test /test\n");
    strcat(string, "/test /test /test /test /test /test /test /test\n\n");
    strcat(string, "{B7B7B7)LEVEL 9 COMMANDS\n");
    strcat(string, "{FFFFFF)/test /test /test /test /test /test /test /test\n");
    strcat(string, "/test /test /test /test /test /test /test /test\n\n");
    strcat(string, "{B7B7B7)LEVEL 10 COMMANDS\n");
    strcat(string, "{FFFFFF)/test /test /test /test /test /test /test /test\n");
    strcat(string, "/test /test /test /test /test /test /test /test\n\n");
    ShowPlayerDialog(playerid, 9999, DIALOG_STYLE_MSGBOX, "Admin Commands", string, "Close", "Accept");
    return 1;
}
Even colors doesnt show...
What may be a problem ?




Re: Is that string problem ? - iZN - 03.02.2014

{B7B7B7) > {B7B7B7}

You are adding ) in the last and about the limit, that's around 2000+ afaik.

Also what the hell you are doing here

pawn Код:
#pragma unused params // No need of this in ZCMD, but yes in DCMD.
#pragma unused playerid // Why you are making it unusable, when it is needed below.



Re: Is that string problem ? - Konstantinos - 03.02.2014

It should be: {RRGGBB}
but you typed: {RRGGBB)

You used ")" instead of "}". The maxinum size I've used in dialog (testing purposes only) is 4073. Higher than that:
-> Run time error 3: "Stack/heap collision (insufficient stack size)".


Re: Is that string problem ? - BodyBoardVEVO - 03.02.2014

Yes, about colors ty and about unused playerid, didnt see
But what is about string, is 2000 allowed ?

EDIT: 4073 may be true, because few minutes ago i used 5000 string and it freezed ingame


Re: Is that string problem ? - ACI - 03.02.2014

SA-MP has a limitation of setting the cell size of a string (I/O): 128


Re: Is that string problem ? - Konstantinos - 03.02.2014

Quote:
Originally Posted by ACI
Посмотреть сообщение
SA-MP has a limitation of setting the string I/O max cell size: 128
That's not true about dialogs. SA-MP Wiki says as max size in info (dialog) is 2048 but more than that can be used without problems. Also max client message lenght is 144, it was 128 in the past.


Re: Is that string problem ? - ACI - 03.02.2014

Didn't noticed that or else I would have written correct: https://sampwiki.blast.hk/wiki/Limits


Re: Is that string problem ? - iZN - 03.02.2014

Quote:
Originally Posted by ACI
Посмотреть сообщение
Didn't noticed that or else I would have written correct: https://sampwiki.blast.hk/wiki/Limits
Well there are some mistakes in wiki, I won't follow wiki much though. It is best to search for your question at the forums, or try that by yourself.


Re: Is that string problem ? - BodyBoardVEVO - 03.02.2014

Alright, thanks you all...
Seems to work fine.

+rep Konstantinos and IZN