[Script Help] Help Me
#1

This My Problem

Код:
CMD:setgangcolor(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= 4)
	{
		if(AdminDuty[playerid] != 1 && PlayerInfo[playerid][pAdmin] < 4)
	    {
	        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[32];
		if(sscanf(params, "is", family, color))
		{
			SendClientMessageEx(playerid, COLOR_GRAD1, "USAGE: /Setgangcolor [Familyid] [Hex Color]");
			return 1;
		}
		if(family < 0 || family > 14) return SendClientMessage(playerid, COLOR_WHITE, "Invalid Gang ID.");

		if(FamilyInfo[family][FamilyTaken] == 0)
		{
			SendClientMessage(playerid, COLOR_GREY, "   That gang isn't being used.");
			return 1;
		}
	    format(FamilyInfo[family][FamilyBandana], sizeof(color), color);
		format(string, sizeof(string), "AdmCmd: %s has set gang ID %d's bandana to '%s'.", GetPlayerNameEx(playerid), family, color);
		ABroadCast(COLOR_LIGHTRED, string, 1);
	}
	return 1;
}


CMD:bandana(playerid, params[])
{
	new string[128], gangcolor;
	if(PlayerInfo[playerid][pGang] == 255) return SendClientMessageEx(playerid, COLOR_WHITE, "Your not in a gang.");
	if(FamilyInfo[PlayerInfo[playerid][pGang]][FamilyBandana] == 0) return SendClientMessageEx(playerid, COLOR_GRAD1, "Your gang does not have a bandana set.");
	gangcolor = strval(FamilyInfo[PlayerInfo[playerid][pGang]][FamilyBandana]);
	if(PlayerInfo[playerid][pBandana] != 1)
	{
		SetPlayerColor(playerid, gangcolor);
 		PlayerInfo[playerid][pBandana] = 1;
 	}
 	else
 	{
 	    SetPlayerColor(playerid, TEAM_HIT_COLOR);
 	    PlayerInfo[playerid][pBandana] = 0;
 	}
	return 1;
}
If I Set Color Using Hex (0x/00FFFF/AA) And I Use /Bandana Its Color Black Can Someone Help Me Or Give Me The Proper Code ? Or PM Me Thanks Who Helping Me
Reply
#2

Anyone Can Help Me ??
Reply
#3

You should convert it to hex instead of strings, right now you would need to use numbers. For example try it with 4278255615, that should give your gang a magenta color.

Step 1: Change the enum var of FamilyBandana to integer (simply remove the string brackets).
Step 2: Change the lines below in the set command from
pawn Код:
new string[128], family, color[32];
        if(sscanf(params, "is", family, color))

..

        format(FamilyInfo[family][FamilyBandana], sizeof(color), color);

..

        format(string, sizeof(string), "AdmCmd: %s has set gang ID %d's bandana to '%s'.", GetPlayerNameEx(playerid), family, color);
to
pawn Код:
new string[128], family, color;
        if(sscanf(params, "ix", family, color))

..

        FamilyInfo[family][FamilyBandana] = color;

..

        format(string, sizeof(string), "AdmCmd: %s has set gang ID %d's bandana to '%x'.", GetPlayerNameEx(playerid), family, color);
Step 3: Change this line from the bandana command from
pawn Код:
gangcolor = strval(FamilyInfo[PlayerInfo[playerid][pGang]][FamilyBandana]);
to
pawn Код:
gangcolor = FamilyInfo[PlayerInfo[playerid][pGang]][FamilyBandana];
I don't know if you use that value anywhere else but there you go.
Reply
#4

thanks sir u are best scripter thx agian i will try it if working
Reply
#5

Even i replied to a old post, i tried this.

I maked my self slot leader gang 1
and set gang 1 color
and it says "This gang isnt being used" but its already taken.
and when i setgangcolor to gang 14, that is a untaken, its gives color.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)