19.10.2009, 10:02
Hi pawner,
I'm doing this post, for advise all scripter that strtock function, that there is in default server kit includes (gl_common.inc), have limited function.
If we want for example, take a parameter of normal /command, if parameter is longer than 19 characters, strtock SEE ONLY FIRST 19 characters.
This because temp variables on strtock function is smaller: new result[20];
Than i recommend all that if you use gl_common.inc and you want take a long name/parameter (as a PlayerName that is 20 char max now) on your GM, you must change This:
On for example, this:
I have seen this problem before creating this post: http://forum.sa-mp.com/index.php?top...1242#msg781242
Good work.
I'm doing this post, for advise all scripter that strtock function, that there is in default server kit includes (gl_common.inc), have limited function.
If we want for example, take a parameter of normal /command, if parameter is longer than 19 characters, strtock SEE ONLY FIRST 19 characters.
This because temp variables on strtock function is smaller: new result[20];
Than i recommend all that if you use gl_common.inc and you want take a long name/parameter (as a PlayerName that is 20 char max now) on your GM, you must change This:
Код:
new result[20];
Код:
new result[64];
Quote:
Originally Posted by SoeH
I don't know why....
I have this: Код:
if (strcmp(cmd, "/changenick", true)==0) { tmp = strtok(cmdtext, idx); printf("length: %d",strlen(tmp)); return 1; } ![]() My log say: Код:
[20:19:32] length: 19 ![]() |
Good work.
