SA-MP Forums Archive
GetPlayerColor in string? - 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)
+--- Thread: GetPlayerColor in string? (/showthread.php?tid=445834)



GetPlayerColor in string? - Admigo - 23.06.2013

Heey all,

How can i use GetPlayerColor(playerid) in a string?
Example:
pawn Код:
format(globalstring, sizeof(globalstring), "[chat]{%06x}%s(%d){FFFFFF}: %s", GetPlayerColor(playerid)>>> 8,GetPlayeridName(playerid),playerid, text);
SendClientMessageToAll(COLOR_WHITE,globalstring);
So the %h returns the hex color.
This one dont returns the color good and shows a part of hex code in message.

Admigo

EDIT: Fixed by myself. Edited my code for players who want this.


Re: GetPlayerColor in string? - dEcooR - 23.06.2013

maybe make format string and then put the return GetPlayerColor(); or?


Re: GetPlayerColor in string? - Admigo - 23.06.2013

Quote:
Originally Posted by dEcooR
Посмотреть сообщение
maybe make format string and then put the return GetPlayerColor(); or?
I already fixed this.