[Solved]Problem with /me messages always showing black
#1

Hello, I have a problem. The /me message colors are always black. And NOT from the players color.
This is the code:

pawn Код:
if(!strcmp(cmdtext, "/me", true, 3)) // 3 is the length of /me
  {
    if(cmdtext[3] == 0) {
      SendClientMessage(playerid, 0xFF0000FF, "USAGE: /me [action]");
      return 1;
    }
    new str[128];
    new playerColor;
    GetPlayerName(playerid, str, sizeof(str));
    format(str, sizeof(str), "* %s %s", str, cmdtext[4]);
    GetPlayerColor(playerid);
    SendClientMessageToAll(playerColor, str);
    return 1;
    }
Can someone help me? Thanks.
Reply
#2

That's because you do nothing with playerColor, it remains as zero and you do nothing with GetPlayerColor.

Change
pawn Код:
GetPlayerColor(playerid);
to:
pawn Код:
playerColor = GetPlayerColor(playerid);
It's even in the Wiki:
https://sampwiki.blast.hk/wiki/GetPlayerColor

Reply
#3

Hey, I looked at the wiki. Then an error that came up was probably my fault >_>
Thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)