cmdtext string problem
#1

Hello guys, I have issue with cmdtext[] string.

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;
}
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?
Reply


Messages In This Thread
cmdtext string problem - by Riwerry - 26.06.2014, 18:08
Re: cmdtext string problem - by Djole1337 - 26.06.2014, 18:10
Re: cmdtext string problem - by Riwerry - 26.06.2014, 18:53
AW: cmdtext string problem - by Nero_3D - 26.06.2014, 19:33

Forum Jump:


Users browsing this thread: 1 Guest(s)