02.06.2016, 10:18
Hello, i've made /bandana and /setgangcolor yesterday BUT
When /setgangcolor <FAMILY_ID> 00FF000 , it says
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.
I made gangcolor as public variable btw so i can use it in SetPlayerToTeamColor stock.
Best Regards,
Yasubo
When /setgangcolor <FAMILY_ID> 00FF000 , it says
Quote:
"AdmCmd: %s has set gang ID %d's bandana to 'FF000'." |
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;
}
Best Regards,
Yasubo