SA-MP Forums Archive
How to send client message with player color - 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: How to send client message with player color (/showthread.php?tid=273002)



How to send client message with player color - mariomako - 30.07.2011

Hello,

i have this code in onplayertext:

Код:
if(GetPVarInt(playerid, "Muted"))
	{
		SCM(playerid, COLOR_ORANGE, "You're muted and can't talk!","Vie ste zamolceni, nemozete da zboruvate!");
	    return 0;
	}
	else
	{
		new string[128], pName[MAX_PLAYER_NAME];
		GetPlayerName(playerid, pName, sizeof(pName));
		format(string, sizeof(string), "%s[%i]: {FFFFFF}%s",pName, playerid, text);
		SendClientMessageToAll(GetPlayerColor(playerid), string);
		return 0;
	}
But i have black player name ever. What is problem?


Re: How to send client message with player color - MadeMan - 30.07.2011

You have to use SetPlayerColor.

https://sampwiki.blast.hk/wiki/GetPlayerColor


Re: How to send client message with player color - PrawkC - 30.07.2011

your way of describing your probably is horrible btw.. You have black player name ever? Huh?? I can only assume when their muted there name goes black, if so then you've done the if wrong, try if(GetPVarInt(playerid, "Muted") == 1) or w/e you've set muted as/


Re: How to send client message with player color - mariomako - 30.07.2011

my color name is ok,
this is problem: http://pic.mk/images/samp001312065988.png


AW: Re: How to send client message with player color - Nero_3D - 30.07.2011

Quote:
Originally Posted by mariomako
Посмотреть сообщение
my color name is ok,
this is problem: http://pic.mk/images/samp001312065988.png
If you had opend that \/ wiki page and read what stood there you would have known why that happens

Quote:
Originally Posted by MadeMan
Посмотреть сообщение
You have to use SetPlayerColor.

https://sampwiki.blast.hk/wiki/GetPlayerColor
There is also a fix provided on that page /\