Array question??
#1

Hello guys, how is that possible? I have one dialog string used in two parts of strcat

First part length is (calculated by letter count web): 256
Second part length is (calculated by letter count web): 162

Together it is 406 big array.

But why, when I have now this array only 400 and it shows the FULL dialog? (With all two parts)
Reply
#2

First of all - 256 + 162 is 418. Possible reasons - destination array is too small, or something.
Show me your code because the description is a little chaotic.
Reply
#3

Yeah, sorry it is 418 but it doesnt matter it is same when it showing full dialog code at 400 big array

Code:
pawn Код:
new dialog[400];
strcat(dialog, "Zadaj meno tvojej postavy v tvare: {FF9900}Meno_Priezvisko\n{A9C4E4}Uisti sa, ћe si zadal {FFCC00}veľkй {A9C4E4}začiatočnй pнsmeno mena a priezviska.\n\n{FF9900}Varovanie: {A9C4E4}Nepouћнvaj {FFCC00}čнslice, medzery, {A9C4E4}alebo nejakй {FFCC00}znaky!\n\n");
strcat(dialog, "{FF9900}Varovanie č.2: {A9C4E4}Pokiaľ sa v mene vyskytnъ {FFCC00}nadбvky, {A9C4E4}alebo {FFCC00}urбћky,\n{A9C4E4}tvoja postava bude do niekoľkэch{FF6633}vymazanб!");
ShowPlayerDialog(playerid, 7, DIALOG_STYLE_INPUT, "{FF9900}M{FFCC00}eno postavy {FF9900}(slot č.1)", dialog, "Vytvoriť", "Spдť");
Reply
#4

Exactly what I told about - the destination is too small
pawn Код:
new dialog [400];
You are trying to fit 418 ( + 1) Cells into 400 cells - that's impossible.
pawn Код:
new dialog [420];
Now you can fit 419 characters. Yay!
Reply
#5

Nah! You dont understand me!

When I use this:

new dialog[400]; IT SHOWS FULL CODE!! nothing missing

I know that I have it small but it is still working!
Reply
#6

Welp, no idea. All \n count as 1 character, but even then it's >400 chars long (and printing it shows that it's cut off)
Reply
#7

Actually tried to debug strlen of this full string and it is 413 and its true. (Becouse when I put 412 one character was missing..)

But why when this message
Код:
Zadaj meno tvojej postavy v tvare: {FF9900}Meno_Priezvisko\n{A9C4E4}Uisti sa, ћe si zadal {FFCC00}veľkй {A9C4E4}začiatočnй pнsmeno mena a priezviska.\n\n{FF9900}Varovanie: {A9C4E4}Nepouћнvaj {FFCC00}čнslice, medzery, {A9C4E4}alebo nejakй {FFCC00}znaky!\n\n{FF9900}Varovanie č.2: {A9C4E4}Pokiaľ sa v mene vyskytnъ {FFCC00}nadбvky, {A9C4E4}alebo {FFCC00}urбћky,\n{A9C4E4}tvoja postava bude do niekoľkэch{FF6633}vymazanб!
is still 418 long, don't understand

//EDIT: probably got it, I have five \n symbols to start new line (and I guess this symbol count as one) thats it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)