problem with bandan -
IggyKlipz - 24.05.2017
when I set the gangbandana I get no errors or warning but ig when I type /bandana it says >Your gang does not have a bandana set.< but ive set it loads of times
CMD

etgangcolor(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;
if(sscanf(params, "ix", 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;
}
color = FamilyInfo[family][FamilyBandana];
format(string, sizeof(string), "AdmCmd: %s has set gang ID %d's bandana to '%x'.", 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 = 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;
}
Re: problem with bandan -
rockhopper - 24.05.2017
In the setgangcolor your using this "color = FamilyInfo[family][FamilyBandana];" but in the bandana command your using "if(FamilyInfo[PlayerInfo[playerid][pGang]][FamilyBandana] == 0)" Well those are two different variables. try replacing the bandana command one to "if(FamilyInfo[family][FamilyBandana] == 0)"
Re: problem with bandan -
IggyKlipz - 24.05.2017
i did it but still the same problem
Re: problem with bandan -
rockhopper - 24.05.2017
You know you have to first use the /setgangcolor command and set a color and then only it will work.
Re: problem with bandan -
Abagail - 24.05.2017
You're setting the color variable to the bandana's current set variable in the set command, which should be the other way around from what I can see.
Код:
FamilyInfo[PlayerInfo[playerid][pGang][FamilyBandana] = color;
Re: problem with bandan -
IggyKlipz - 24.05.2017
lol I know this ive tried it I set it with /setgangcolor 1 0x40FFFFFF and I switched it I thought it might of helped before it was just the same
Re: problem with bandan -
JasonRiggs - 24.05.2017
Код:
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;
if(sscanf(params, "ix", 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;
}
FamilyInfo[family][FamilyBandana];
format(string, sizeof(string), "AdmCmd: %s has set gang ID %d's bandana to '%x'.", GetPlayerNameEx(playerid), family, color);
ABroadCast(COLOR_LIGHTRED, string, 1);
}
return 1;
}
Try this
Re: problem with bandan -
IggyKlipz - 24.05.2017
it works but now instead of a color it goes just black instead of any color
Re: problem with bandan -
JasonRiggs - 24.05.2017
Yeah, therr was a mistake in the code i sent you, now it should work
Код:
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;
if(sscanf(params, "ix", 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;
}
FamilyInfo[family][FamilyBandana] = params;
format(string, sizeof(string), "AdmCmd: %s has set gang ID %d's bandana to '%x'.", GetPlayerNameEx(playerid), family, color);
ABroadCast(COLOR_LIGHTRED, string, 1);
}
return 1;
}
Re: problem with bandan -
IggyKlipz - 24.05.2017
ill test and if work ill rep you