27.03.2013, 17:47
I've been looking at packed strings a lot recently trying to figure out how useful they'd be. After reading some topics here on the forums, a few people have said that most of the native SA-MP functions don't support packed strings.
I ran this:
It printed the messsage in the console, and also sent the client message. My question: what functions don't support packed strings? I also tested a few (~10) other functions which took string arguments, and they worked fine also..
P.S. Not sure why, but it works when the size is only 9 chars, even though the string is 11 chars. Any lower and it produces the error 'initialization data exceeds declared size'. Can someone explain this?
The only thing I can think of that doesn't support packed strings (at least I don't think so) is format().
EDIT: Just tested format() - seems to work both ways (formatting a packed string with normal strings (and other values i.e. floats/ints) and formatting an unpacked string with a packed string in it (%s)).
I ran this:
pawn Код:
new pStr[9 char] = !"Hello World";
print(pStr);
SendClientMessageToAll(-1, pStr);
P.S. Not sure why, but it works when the size is only 9 chars, even though the string is 11 chars. Any lower and it produces the error 'initialization data exceeds declared size'. Can someone explain this?
The only thing I can think of that doesn't support packed strings (at least I don't think so) is format().
EDIT: Just tested format() - seems to work both ways (formatting a packed string with normal strings (and other values i.e. floats/ints) and formatting an unpacked string with a packed string in it (%s)).