SA-MP Forums Archive
[Solved]Problem with /me messages always showing black - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [Solved]Problem with /me messages always showing black (/showthread.php?tid=92347)



[Solved]Problem with /me messages always showing black - speedruntrainer - 19.08.2009

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.


Re: Problem with /me messages always showing black - member - 19.08.2009

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




Re: Problem with /me messages always showing black - speedruntrainer - 19.08.2009

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