How to update the bandana color to textdraw?
#1

the bandana code is this
Код:
CMD:bandana(playerid, params[])
{
    if(PlayerInfo[playerid][pGang] == -1)
	{
	    return SendClientMessage(playerid, COLOR_GREY, "You are not apart of a gang at the moment.");
	}

	if(!PlayerInfo[playerid][pBandana])
	{
	    PlayerInfo[playerid][pBandana] = 1;
	    SendClientMessage(playerid, COLOR_AQUA, "You have enabled your bandana. Your nametag color has been set to your gang color.");
	}
	else
	{
	    PlayerInfo[playerid][pBandana] = 0;
	    SendClientMessage(playerid, COLOR_AQUA, "You have disabled your bandana. Your nametag color was reset back to normal.");
	}

	return 1;
}
and the textdraw code is this

Код:
{
		    format(string, sizeof(string), "%s\n{F40E0E}HP: %.0f - {FFFFFF}AR: %.0f", GetPlayerRPName(playerid), GetPlayerHealth(playerid), GetPlayerArmour(playerid));
			PlayerInfo[playerid][pSpecialTag] = CreateDynamic3DTextLabel(string, COLOR_WHITE, 0.0, 0.0, 0.2, 20.0, .attachedplayer = playerid, .testlos = 1);
        }
once i used /bandana it didn't color the textdraw can someone make me?
Reply
#2

That's not a textdraw...

You also do nothing in the format line, or the createdynamic3dtextlabel line to make the color of it change to anything other than the default 'white' that you are using.
Reply
#3

You are using WHITE 3dtext color. change COLOR_WHITE to something else if you want to change the color
Reply
#4

I meant there, when i used bandana for example my gang color is RED it should turn to color RED but its still White lol can you tell me how to update?
Reply
#5

All you need to do is do a condition check, and have the color added in the same section below...

Код:
format(string, sizeof(string), "{FF0000}%s\n{F40E0E}HP: %.0f - {FFFFFF}AR: %.0f", GetPlayerRPName(playerid), GetPlayerHealth(playerid), GetPlayerArmour(playerid));
Or if you don't display anything more on the text label you could change the color in the start of the textlabel itself.

Код:
PlayerInfo[playerid][pSpecialTag] = CreateDynamic3DTextLabel(string, COLOR_RED, 0.0, 0.0, 0.2, 20.0, .attachedplayer = playerid, .testlos = 1);
Both of these, are not intended for use, it's simply to show you where whatever needs adding/changing. You will need to make some condition check to check what the players gang is, and what color they will have.

The top way to change would be the best one to actually change, especially if civilians as such have no 'color'.
Reply
#6

Quote:
Originally Posted by Sew_Sumi
Посмотреть сообщение
All you need to do is do a condition check, and have the color added in the same section below...

Код:
format(string, sizeof(string), "{FF0000}%s\n{F40E0E}HP: %.0f - {FFFFFF}AR: %.0f", GetPlayerRPName(playerid), GetPlayerHealth(playerid), GetPlayerArmour(playerid));
Or if you don't display anything more on the text label you could change the color in the start of the textlabel itself.

Код:
PlayerInfo[playerid][pSpecialTag] = CreateDynamic3DTextLabel(string, COLOR_RED, 0.0, 0.0, 0.2, 20.0, .attachedplayer = playerid, .testlos = 1);
Both of these, are not intended for use, it's simply to show you where whatever needs adding/changing. You will need to make some condition check to check what the players gang is, and what color they will have.

The top way to change would be the best one to actually change, especially if civilians as such have no 'color'.
it makes me pissed off how ever i tried that one already, but i fail it stays color red, i meant in my help request is when i used bandana it didn't update the textdraw its still white for example i used color blue bandana it should turn unto color blue fk
Reply
#7

Use the first scenario, and update the string/textdraw.

Show how you tried prior.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)