Bandana Bug
#1

I'm trying to do an bandana System in my Script....... but when i use the cmd /setgangcolor it always sets the color to black any help

Quote:

CMDetgangcolor(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] != 1)
{
SendClientMessage(playerid, COLOR_GREY, " That gang isn't being used.");
return 1;
}
format(FamilyInfo[family][FamilyBandana],sizeof(color),"%s",color);
SaveFamilies();
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;
}

Reply
#2

I guess this should work but i didnt test it tho.



PHP код:
CMD:setgangcolor(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin] >= || PlayerInfo[playerid][pGangMod] >= 1)
    {
        new 
string[128], familycolor[32];
        if(
sscanf(params"is"familycolor))
        {
            
SendClientMessageEx(playeridCOLOR_GRAD1"USAGE: /setgangcolor [gangID] [hexcolor]");
            return 
1;
        }
        if(
family || family 10) return SendClientMessage(playeridCOLOR_WHITE"Invalid Gang ID.");
        if(
strlen(color) > 6) return SendClientMessage(playeridCOLOR_GREY"Please use hex codes that arent longer then 6 charaters e.g FFFFFF");
        
family -= 1;
        if(
FamilyInfo[family][FamilyTaken] != 1)
        {
            
SendClientMessage(playeridCOLOR_GREY"   That gang isn't being used.");
            return 
1;
        }
        if(
AdminDuty[playerid] != && PlayerInfo[playerid][pAdmin] < 5)
        {
            
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;
        }
        
format(FamilyInfo[family][FamilyBandana], sizeof(color), "%s"color);
        
format(stringsizeof(string), "AdmCmd: %s has set gang ID %d's bandana to '%s'."GetPlayerNameEx(playerid), family+1color);
        
ABroadCast(COLOR_LIGHTREDstring1);
        
SaveGangs();
    }
    return 
1;

Please Rep +1 if i helped you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)