Quote:
Originally Posted by Luis the Lobster
Okay My /o command is bugged but I cannot see anything wrong :/
pawn Код:
if (strcmp("/o", cmdtext, true, 3) == 0) { if(!strlen(cmdtext)) return SendClientMessage(playerid, COLOR_YELLOW, "Usage: /o [chat]"); new str[256]; GetPlayerName(playerid, str, sizeof(str)); format(str, sizeof(str), "[OOC] %s: %s", str, cmdtext); SendClientMessageToAll(COLOR_GREEN, str); return 1; }
When I type /o it just does what is does in the Picture
|
you need strtok, which is a small snippet that will get a string/result after space example.
/o' 'message.... ' ' is the space and strtok will get the message after it.