Problem with Command /setgangcolor
#1

When i try to compile my script it give me these errors:

Код:
D:\GTA San Andreas\NGGGG\gamemodes\FGRP.pwn(32189) : warning 204: symbol is assigned a value that is never used: "string"
D:\GTA San Andreas\NGGGG\gamemodes\FGRP.pwn(32206) : error 017: undefined symbol "family"
D:\GTA San Andreas\NGGGG\gamemodes\FGRP.pwn(32206) : error 017: undefined symbol "color"
D:\GTA San Andreas\NGGGG\gamemodes\FGRP.pwn(32206) : error 029: invalid expression, assumed zero
D:\GTA San Andreas\NGGGG\gamemodes\FGRP.pwn(32206) : fatal error 107: too many error messages on one line
Lines:

Код:
CMD:setgangcolor(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= 1337 || PlayerInfo[playerid][pGangModerator] >= 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(PlayerInfo[playerid][pAdminDuty] == 0) return SendClientMessage(playerid, -1, "You must be ( /aduty ) to use this Command!");
			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;
}
Reply
#2

pawn Код:
CMD:setgangcolor(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 1337 || PlayerInfo[playerid][pGangModerator] >= 1)
    {
        new family, color[15];
        if(sscanf(params, "is[15]", family, color)) SendClientMessageEx(playerid, COLOR_GRAD1, "USAGE: /setgangcolor [gangID] [hexcolor]");
        else if(family < 1 || family > 10) SendClientMessage(playerid, COLOR_WHITE, "Invalid Gang ID.");
        else if(strlen(color) > 6) SendClientMessage(playerid, COLOR_GREY, "Please use hex codes that arent longer then 6 charaters e.g FFFFFF");
        else
        {
            family -= 1;
            if(FamilyInfo[family][FamilyTaken] != 1) SendClientMessage(playerid, COLOR_GREY, "   That gang isn't being used.");
            else if(PlayerInfo[playerid][pAdminDuty] == 0) SendClientMessage(playerid, -1, "You must be ( /aduty ) to use this Command!");
            else
            {
                new string[128];
                FamilyInfo[family][FamilyBandana][0] = EOS;
                strcat(FamilyInfo[family][FamilyBandana], color, 6);
                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;
}
Reply
#3

@Jefff Thanks mate its working great but it don't set color on /families, can u help me with that please
Reply
#4

Show cmd
Reply
#5

bro i have fixed that but when i type /setgangcolor [gangid] [hex=FF0000(which is red color)] but it sets green color... it dont set correct Hex colors
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)