problem with /o chat
#1

Hey,i have problem with /o chat,its that everyone sees the chat
but if i write /o,it will show Fog: /o
and if i write more /o lalala
it wont show anything


heres the code


Код:
		if(strcmp(cmdtext, "/o", true) == 0)
		{
		new idx;
		new string[256];
		new sendername[MAX_PLAYER_NAME];
		GetPlayerName(playerid, sendername, sizeof(sendername));
		new length = strlen(cmdtext);
		while ((idx < length) && (cmdtext[idx] <= ' '))
		{
		idx++;
		}
		new offset = idx;
		new resultZ[64];
		while ((idx < length) && ((idx - offset) < (sizeof(resultZ) - 1)))
		{
		resultZ[idx - offset] = cmdtext[idx];
		idx++;
		}
		resultZ[idx - offset] = EOS;
		if(!strlen(resultZ))
		{
		SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /o [ooc chat]");
		return 1;
		}
		{
		format(string, sizeof(string), "%s", resultZ);
		SendPlayerMessageToAll(playerid, string);
		printf("%s", string);
		return 1;
		}
}
Reply
#2

Try changing this:
pawn Код:
SendPlayerMessageToAll(playerid, string);
To:
pawn Код:
SendClientMessageToAll(playerid, string);
Reply
#3

Just a suggestion, but you could also get rid of that command and use a starting character like "!" or "~" at the beginning of your message, then use OnPlayerText to send that to everyone. Much easier IMO.
Reply
#4

this wont work


and to biltong:

thanks for suggestion :P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)