PDA

View Full Version : Change player icon color


abineri
19/03/2010, 07:16 PM
How do you change a players icon color on the mini map?

Las Venturas CNR
19/03/2010, 07:34 PM
SetPlayerColor(playerid, 0xFFFF00AA);


Replace 0xFFFF00AA with the color hex you wish to set the player color as.
Use this function under "OnPlayerSpawn" (Call back)

scottygraham1990
08/12/2011, 07:46 PM
any one got a fs so people can change the own name color

grand.Theft.Otto
08/12/2011, 09:12 PM
Why would you reply in a 2010 topic ? ......

MP2
08/12/2011, 09:13 PM
Well, seeing as he did..


#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.