Change player icon 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)
+--- Thread: Change player icon color (
/showthread.php?tid=135219)
Change player icon color -
abineri - 19.03.2010
How do you change a players icon color on the mini map?
Re: Change player icon color -
Las Venturas CNR - 19.03.2010
pawn Код:
SetPlayerColor(playerid, 0xFFFF00AA);
Replace 0xFFFF00AA with the color hex you wish to set the player color as.
Use this function under "OnPlayerSpawn" (Call back)
Re: Change player icon color -
scottygraham1990 - 08.12.2011
any one got a fs so people can change the own name color
Re: Change player icon color -
grand.Theft.Otto - 08.12.2011
Why would you reply in a 2010 topic ? ......
Re: Change player icon color -
MP2 - 08.12.2011
Well, seeing as he did..
pawn Код:
#include <a_samp>
#define dcmd(%1,%2,%3) if((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
enum pcolor_data
{
pcolor_name[16],
pcolor_hex
}
new pColors[][pcolor_data] = {
{"red", 0xFF0000FF},
{"green", 0x00FF00FF},
{"blue", 0x0000FFFF}
};
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(color, 5, cmdtext);
return 0;
}
dcmd_color(playerid, params[])
{
for(new i=0; i<sizeof(pColors); i++)
{
if(!strcmp(params, pColors[i][pcolor_name], true))
{
SetPlayerColor(playerid, pColors[i][pcolor_hex]);
new string[128];
format(string, sizeof(string), "Color set to '%s'.", pColors[i][pcolor_name]);
SendClientMessage(playerid, pColors[i][pcolor_hex], string);
return 1;
}
}
SendClientMessage(playerid, 0xFF0000FF, "VALID COLORS: red green blue");
return 1;
}
http://pastebin.com/UeDr7atz
Made with dcmd. If you're planning to reply saying "where do I download dcmd" - search first.