26.06.2014, 18:08
Hello guys, I have issue with cmdtext[] string.
When I use as cmdtext /mycommand it outputs:
Before /mycommand
m
y
c
o
m
m
a
n
d
*NOTHING HERE*
It should output cmdtext string again, but this while loop ruins it.. why?
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[]) {
new
i;
printf("Before %s\n", cmdtext);
while (cmdtext[i++] != ' ') {
printf("%c", cmdtext[i]);
}
printf("After %s", cmdtext); //thats issue
return 0;
}
Before /mycommand
m
y
c
o
m
m
a
n
d
*NOTHING HERE*
It should output cmdtext string again, but this while loop ruins it.. why?