Errors with this command
#1

I got these errors when trying to run this command, could somebody make the command so it compiles correctly?

(33364) : error 003: declaration of a local variable must appear in a compound block
(33364) : warning 217: loose indentation
(33364) : error 017: undefined symbol "string"
(33364) : warning 215: expression has no effect
(33364) : error 001: expected token: ";", but found "]"
(33364) : fatal error 107: too many error messages on one line


Код HTML:
CMD:makegroupleader(playerid, params[]) {
	if(PlayerInfo[playerid][pAdmin] >= 4)
		new string[512], iTargetID, iGroupID;
		if(sscanf(params, "ud", iTargetID, iGroupID))
			return SendClientMessage(playerid, COLOR_GRAD1, SYNTAX_MESSAGE"/makegroupleader [playerid] [groupid(/listgroups)]");

		if(iGroupID > MAX_GROUPS && iGroupID != 255 || iGroupID < 0) {
		    format(string, sizeof(string),"Invalid group, ranges from 0 to %i & 255 - Remove.", MAX_GROUPS);
			SendClientMessage(playerid, COLOR_GREY, string);
			return 1;
		}

		if(IsPlayerConnected(iTargetID)) {
		    if(PlayerData[iTargetID][pGangID] != 255)
		        return SendClientMessage(playerid, COLOR_GRAD1, "The specified player is in a gang.");

			if(iGroupID == 255) {
			    if(pTazer{iTargetID} == 1) {
					RemovePlayerWeapon(iTargetID, 23);
					if(pTazerReplace{iTargetID} > 0)
						GivePlayerValidWeapon(iTargetID, pTazerReplace{iTargetID}, 60000);
					pTazer{iTargetID} = 0;
		            pTazerReplace{iTargetID} = 0;
				}
                format(string, sizeof(string), "Your leadership has been taken by Administrator %s.", getPlayerName(playerid));
			    SendClientMessage(iTargetID, COLOR_LIGHTBLUE, string);

			    format(string, sizeof(string), "You have taken %s leadership.", getPlayerName(iTargetID));
			    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);

			    format(string, sizeof(string), "%s has taken %s leadership.", getPlayerName(playerid), getPlayerName(iTargetID));
  				Log("logs/makeleader.log", string);

			    PlayerData[iTargetID][pRank] = 255;
			    PlayerData[iTargetID][pDivision] = 255;
			    PlayerData[iTargetID][pLeader] = 255;
				PlayerData[iTargetID][pFaction] = 255;

				HitmanBadge[iTargetID] = 255;
			    return 1;
			}

			if(GroupData[iGroupID][g_szGroupName][0] == 0)
			    return SendClientMessage(playerid, COLOR_GRAD1, "The specified group has not been setup.");

			if(GroupData[iGroupID][g_iDisabled] == 1)
		    	return SendClientMessage(playerid, COLOR_GRAD1, "You cannot make anyone the leader of this group, it's disabled.");

			new iRankCount = 0;
			for(new i = 0; i < MAX_GROUP_RANKS; i++) {
				if(strlen(GroupRanks[iGroupID][i]) >= 1 && strcmp(GroupRanks[iGroupID][i], "None", true)) {
				    ++iRankCount;
				}
			}
			PlayerData[iTargetID][pLeader] = iGroupID;
			PlayerData[iTargetID][pRank] = iRankCount-1;
			PlayerData[iTargetID][pFaction] = iGroupID;
			PlayerData[iTargetID][pDivision] = 0;

			format(string, sizeof(string), "You have been made the leader of the %s by Administrator %s.", GroupData[iGroupID][g_szGroupName], getPlayerName(playerid));
			SendClientMessage(iTargetID, COLOR_LIGHTBLUE, string);

			format(string, sizeof(string), "You have made %s the leader of the %s.", getPlayerName(iTargetID), GroupData[iGroupID][g_szGroupName]);
			SendClientMessage(playerid, COLOR_LIGHTBLUE, string);

			format(string, sizeof(string), "%s had made %s the leader of %s (%i).", getPlayerName(playerid), getPlayerName(iTargetID), GroupData[iGroupID][g_szGroupName], iGroupID);
  			Log("logs/makeleader.log", string);

			PlayerData[iTargetID][pDuty] = 0;
			SetPlayerToTeamColor(iTargetID);
		}
	}
	else Invalid_Admin(playerid);
	return 1;
}
Reply


Messages In This Thread
Errors with this command - by Rydur - 02.01.2014, 11:45
Re: Errors with this command - by WhiteNigger - 02.01.2014, 11:52
Re: Errors with this command - by Konstantinos - 02.01.2014, 11:56
Re: Errors with this command - by Rydur - 02.01.2014, 12:10
Re: Errors with this command - by camaro8 - 02.01.2014, 12:14
Re: Errors with this command - by Rydur - 02.01.2014, 12:16
Re: Errors with this command - by camaro8 - 02.01.2014, 12:20
Re: Errors with this command - by Rydur - 02.01.2014, 12:26
Re: Errors with this command - by HB - 02.01.2014, 12:30
Re: Errors with this command - by Rydur - 02.01.2014, 13:06

Forum Jump:


Users browsing this thread: 1 Guest(s)