Is that string problem ?
#1

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 ?

Reply
#2

{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.
Reply
#3

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)".
Reply
#4

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
Reply
#5

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

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.
Reply
#7

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

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.
Reply
#9

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

+rep Konstantinos and IZN
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)