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(playerid, params[])
{
    if(
PlayerInfo[playerid][pAdmin] >= 3 || PlayerInfo[playerid][pGangMod] >= 1)
    {
        new 
string[128], family, color[32];
        if(
sscanf(params, "is", family, color))
        {
            
SendClientMessageEx(playerid, COLOR_GRAD1, "USAGE: /setgangcolor [gangID] [hexcolor]");
            return 
1;
        }
        if(
family < 1 || family > 10) return SendClientMessage(playerid, COLOR_WHITE, "Invalid Gang ID.");
        if(
strlen(color) > 6) return SendClientMessage(playerid, COLOR_GREY, "Please use hex codes that arent longer then 6 charaters e.g FFFFFF");
        
family -= 1;
        if(
FamilyInfo[family][FamilyTaken] != 1)
        {
            
SendClientMessage(playerid, COLOR_GREY, "   That gang isn't being used.");
            return 
1;
        }
        if(
AdminDuty[playerid] != 1 && 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(string, sizeof(string), "AdmCmd: %s has set gang ID %d's bandana to '%s'.", GetPlayerNameEx(playerid), family+1, color);
        
ABroadCast(COLOR_LIGHTRED, string, 1);
        
SaveGangs();
    }
    return 
1;
} 
Please Rep +1 if i helped you.
Reply


Forum Jump:


Users browsing this thread: