Change player icon color
#1

How do you change a players icon color on the mini map?
Reply
#2

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)
Reply
#3

any one got a fs so people can change the own name color
Reply
#4

Why would you reply in a 2010 topic ? ......
Reply
#5

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


Forum Jump:


Users browsing this thread: 3 Guest(s)