What is the correct color codes for SetPlayerColor ? ALPHA? HEX ? HEXADECIMAL ? OR WHAT?
#1

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(playeridparams[])
{
    
gangcolor FamilyInfo[PlayerInfo[playerid][pGang]][FamilyColor];
    
//SendClientMessage(playerid, COLOR_REALRED, "This command is currently disabled / under maintenance");
    
if(PlayerInfo[playerid][pGang] == 255) return SendClientMessageEx(playeridCOLOR_WHITE"Your not in a gang.");
    if(
FamilyInfo[PlayerInfo[playerid][pGang]][FamilyColor] == 0) return SendClientMessageEx(playeridCOLOR_GRAD1"Your gang does not have a bandana set.");
    if(
PlayerInfo[playerid][pBandana] != 1)
    {
        
        
SetPlayerColor(playeridgangcolor);
         
PlayerInfo[playerid][pBandana] = 1;
         
SendClientMessage(playeridCOLOR_WHITE"You have toggled your gang bandana ON and you will be indentified as gang-rival");
     }
     else
     {
         
SetPlayerColor(playeridTEAM_HIT_COLOR);
         
PlayerInfo[playerid][pBandana] = 0;
         
SendClientMessage(playeridCOLOR_WHITE"You have toggled your gang bandana OFF and you will be identified as civilian");
     }
    return 
1;

PHP код:
CMD:setgangcolor(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin] >= 4)
    {
        if(
AdminDuty[playerid] != && PlayerInfo[playerid][pAdmin] < && 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], familycolor;
        if(
sscanf(params"ix"familycolor))
        {
            
SendClientMessageEx(playeridCOLOR_GRAD1"USAGE: /setgangcolor [Familyid] [COLOR_COLORNAME]");
            return 
1;
        }
        if(
family || family MAX_FAMILY) { SendClientMessage(playeridCOLOR_GREY"   FamilyNr can't be below 1 or above 14!"); return 1; }
        
family -= 1// FIX THE FAMILY BUG
        
if(FamilyInfo[family][FamilyTaken] == 0)
        {
            
SendClientMessage(playeridCOLOR_GREY"   That gang isn't being used.");
            return 
1;
        }
        
FamilyInfo[family][FamilyColor] = color;
        
family +=1;
        
format(stringsizeof(string), "AdmCmd: %s has set gang ID %d's bandana to '%x'."GetPlayerNameEx(playerid), familycolor);
        
ABroadCast(COLOR_LIGHTREDstring1);
    }
    else
    {
        
SendClientMessage(playeridCOLOR_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
Reply
#2

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

lol

Change this


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

PHP код:
format(stringsizeof(string), "AdmCmd: %s has set gang ID %d's color to '%x'."GetPlayerNameEx(playerid), familycolor); 
Reply
#4

0xffffffff
Reply
#5

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

Change this


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

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

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

PHP код:
if(sscanf(params"iH(0xFFFFFFFF)"familycolor)) 
Reply
#8

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

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)