SA-MP Forums Archive
What is the correct color codes for SetPlayerColor ? ALPHA? HEX ? HEXADECIMAL ? OR WHAT? - 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: What is the correct color codes for SetPlayerColor ? ALPHA? HEX ? HEXADECIMAL ? OR WHAT? (/showthread.php?tid=608521)



What is the correct color codes for SetPlayerColor ? ALPHA? HEX ? HEXADECIMAL ? OR WHAT? - Yasubo - 02.06.2016

Hello, i've made /bandana and /setgangcolor yesterday BUT

When /setgangcolor <FAMILY_ID> 00FF000 , it says
Quote:

"AdmCmd: %s has set gang ID %d's bandana to 'FF000'."

Why is that?

I also cant find the color list for SetPlayerColor. Did i code something wrong? Please tell me what is it and i would highly appreciate it.

PHP код:
CMD:bandana(playerid, params[])
{
    
gangcolor = FamilyInfo[PlayerInfo[playerid][pGang]][FamilyColor];
    
//SendClientMessage(playerid, COLOR_REALRED, "This command is currently disabled / under maintenance");
    
if(PlayerInfo[playerid][pGang] == 255) return SendClientMessageEx(playerid, COLOR_WHITE, "Your not in a gang.");
    if(
FamilyInfo[PlayerInfo[playerid][pGang]][FamilyColor] == 0) return SendClientMessageEx(playerid, COLOR_GRAD1, "Your gang does not have a bandana set.");
    if(
PlayerInfo[playerid][pBandana] != 1)
    {
        
        
SetPlayerColor(playerid, gangcolor);
         
PlayerInfo[playerid][pBandana] = 1;
         
SendClientMessage(playerid, COLOR_WHITE, "You have toggled your gang bandana ON and you will be indentified as gang-rival");
     }
     else
     {
         
SetPlayerColor(playerid, TEAM_HIT_COLOR);
         
PlayerInfo[playerid][pBandana] = 0;
         
SendClientMessage(playerid, COLOR_WHITE, "You have toggled your gang bandana OFF and you will be identified as civilian");
     }
    return 
1;
} 
PHP код:
CMD:setgangcolor(playerid, params[])
{
    if(
PlayerInfo[playerid][pAdmin] >= 4)
    {
        if(
AdminDuty[playerid] != 1 && PlayerInfo[playerid][pAdmin] < 5 && PlayerInfo[playerid][pGangMod] == 1)
        {
            
SendClientMessage(playerid,COLOR_WHITE, "You're not on-duty as admin. To access your admin commands you must be on-duty. Type /aduty to go on-duty.");
            return 
1;
        }
        new 
string[128], family, color;
        if(
sscanf(params, "ix", family, color))
        {
            
SendClientMessageEx(playerid, COLOR_GRAD1, "USAGE: /setgangcolor [Familyid] [COLOR_COLORNAME]");
            return 
1;
        }
        if(
family < 1 || family > MAX_FAMILY) { SendClientMessage(playerid, COLOR_GREY, "   FamilyNr can't be below 1 or above 14!"); return 1; }
        
family -= 1; // FIX THE FAMILY BUG
        
if(FamilyInfo[family][FamilyTaken] == 0)
        {
            
SendClientMessage(playerid, COLOR_GREY, "   That gang isn't being used.");
            return 
1;
        }
        
FamilyInfo[family][FamilyColor] = color;
        
family +=1;
        
format(string, sizeof(string), "AdmCmd: %s has set gang ID %d's bandana to '%x'.", GetPlayerNameEx(playerid), family, color);
        
ABroadCast(COLOR_LIGHTRED, string, 1);
    }
    else
    {
        
SendClientMessage(playerid, COLOR_GREY, " You are not admin or gang moderator!");
    }
    return 
1;
} 
I made gangcolor as public variable btw so i can use it in SetPlayerToTeamColor stock.

Best Regards,
Yasubo


Re: What is the correct color codes for SetPlayerColor ? ALPHA? HEX ? HEXADECIMAL ? OR WHAT? - Yasubo - 02.06.2016

UPDATE: i was able to make gangcolor as local variable inside /bandana command but it did not help.


Re: What is the correct color codes for SetPlayerColor ? ALPHA? HEX ? HEXADECIMAL ? OR WHAT? - Akbaig - 02.06.2016

lol

Change this


PHP код:
format(string, sizeof(string), "AdmCmd: %s has set gang ID %d's bandana to '%x'.", GetPlayerNameEx(playerid), family, color); 
Into (Under COMMAND setgangcolor)

PHP код:
format(string, sizeof(string), "AdmCmd: %s has set gang ID %d's color to '%x'.", GetPlayerNameEx(playerid), family, color); 



Re: What is the correct color codes for SetPlayerColor ? ALPHA? HEX ? HEXADECIMAL ? OR WHAT? - Sew_Sumi - 02.06.2016

0xffffffff


Re: What is the correct color codes for SetPlayerColor ? ALPHA? HEX ? HEXADECIMAL ? OR WHAT? - Yasubo - 02.06.2016

Quote:
Originally Posted by Akbaig
Посмотреть сообщение
lol

Change this


PHP код:
format(string, sizeof(string), "AdmCmd: %s has set gang ID %d's bandana to '%x'.", GetPlayerNameEx(playerid), family, color); 
Into (Under COMMAND setgangcolor)

PHP код:
format(string, sizeof(string), "AdmCmd: %s has set gang ID %d's color to '%x'.", GetPlayerNameEx(playerid), family, color); 
No changes happen, The problem is still there


Re: What is the correct color codes for SetPlayerColor ? ALPHA? HEX ? HEXADECIMAL ? OR WHAT? - Yasubo - 02.06.2016

Quote:
Originally Posted by Sew_Sumi
Посмотреть сообщение
0xffffffff
What do you mean?


Re: What is the correct color codes for SetPlayerColor ? ALPHA? HEX ? HEXADECIMAL ? OR WHAT? - oMa37 - 02.06.2016

PHP код:
if(sscanf(params, "iH(0xFFFFFFFF)", family, color)) 



Re: What is the correct color codes for SetPlayerColor ? ALPHA? HEX ? HEXADECIMAL ? OR WHAT? - Yasubo - 02.06.2016

Quote:
Originally Posted by oMa37
Посмотреть сообщение
PHP код:
if(sscanf(params, "iH(0xFFFFFFFF)", family, color)) 
[20:12:32] AdmCmd: Yasubo has set gang ID 1's bandana to 'H'.


Re: What is the correct color codes for SetPlayerColor ? ALPHA? HEX ? HEXADECIMAL ? OR WHAT? - justjamie - 02.06.2016

By colors, do you mean the color of the player nametag?


Re: What is the correct color codes for SetPlayerColor ? ALPHA? HEX ? HEXADECIMAL ? OR WHAT? - Yasubo - 02.06.2016

Quote:
Originally Posted by justjamie
Посмотреть сообщение
By colors, do you mean the color of the player nametag?
Yes, its SetPlayerColor(playerid, HEX);

right?

But when i entered
0xFFFFF

Its not showing the correct color.

I guess it can be fixed through making the HEX into string COLOR_BLUE for example and it should be defined in the script. But how?