CMD:su
#1

I had a RP server...I found a bug. I can't /su a criminal! (I can't /su a player who isn't a cop)
Check this:
Код:
if (Team_SFPD(playerid) || Team_LSPD(playerid) ||
			Team_FBI(playerid) ||  Team_EDLS(playerid) && PlayerInfo[playerid][pDivision] == 2 ||
			(Team_EDLS(playerid) && PlayerInfo[playerid][pRank] >= 5) || Team_LVPD(playerid) ||
			PlayerInfo[playerid][pMember] == 11 || PlayerInfo[playerid][pLeader] == 11 || PlayerInfo[playerid][pMember] == 13 || PlayerInfo[playerid][pLeader] == 13)
	{
And this:

Код:
CMD:su(playerid, params[])
{
	if(PlayerInfo[playerid][pJailed] > 0)
	{
		SendClientMessageEx(playerid, COLOR_WHITE, "You cannot use this in jail/prison.");
		return 1;
	}

	new giveplayerid, crime[64];
	if(sscanf(params, "us[64]", giveplayerid, crime)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: (/su)spect [playerid] [crime discription]");

	if (Team_SFPD(playerid) || Team_LSPD(playerid) ||
			Team_FBI(playerid) ||  Team_EDLS(playerid) && PlayerInfo[playerid][pDivision] == 2 ||
			(Team_EDLS(playerid) && PlayerInfo[playerid][pRank] >= 5) || Team_LVPD(playerid) ||
			PlayerInfo[playerid][pMember] == 11 || PlayerInfo[playerid][pLeader] == 11 || PlayerInfo[playerid][pMember] == 13 || PlayerInfo[playerid][pLeader] == 13)
	{
		if(IsPlayerConnected(giveplayerid))
		{
			if(giveplayerid != INVALID_PLAYER_ID)
			{
				if(giveplayerid == playerid)
				{
					SendClientMessageEx(playerid, COLOR_GREY, "You cannot suspect yourself!");
					return 1;
				}
				if(IsACop(giveplayerid))
				{
					SendClientMessageEx(playerid, COLOR_GREY, "You cannot /su an LEO!");
					return 1;
				}
				if (gTeam[giveplayerid] != 2 || PlayerInfo[playerid][pMember] != 2 || PlayerInfo[playerid][pLeader] != 2)
				{
					if (WantedPoints[giveplayerid]>=6)
					{
						SendClientMessageEx(playerid, COLOR_GRAD2, "Target is already most wanted.");
						return 1;
					}
					WantedPoints[giveplayerid] += 1;
					SetPlayerCriminal(giveplayerid,playerid, crime);
					return 1;
				}
				else
				{
					SendClientMessageEx(playerid, COLOR_GRAD2, "   You can't suspect an LEO!");
				}
			}
		}
		else
		{
			SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player specified.");
			return 1;
		}
	}
	else
	{
		SendClientMessageEx(playerid, COLOR_GRAD2, "   You are not a Cop / FBI / Coastguard!");
	}
	return 1;
}
FIX THE SECOND CODE AND THEN COMMENT IT (FIXED)

Thanks
Reply
#2

Can someone fix it?
Reply
#3

Help me please! I can't compile it
Reply
#4

Can u send me /makeleader ? ._.
Код:
CMD:su(playerid, params[])
{
	if(PlayerInfo[playerid][pJailed] > 0)
	{
		SendClientMessageEx(playerid, COLOR_WHITE, "You cannot use this in jail/prison.");
		return 1;
	}

	new giveplayerid, crime[64];
	if(sscanf(params, "us[64]", giveplayerid, crime)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: (/su)spect [playerid] [crime discription]");

	if (PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3 || PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1 ||
	PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2 ||  PlayerInfo[playerid][pMember] == 4 && PlayerInfo[playerid][pDivision] == 2 ||
	(PlayerInfo[playerid][pMember] == 4 && PlayerInfo[playerid][pRank] >= 5) || PlayerInfo[playerid][pMember] == 7 || PlayerInfo[playerid][pLeader] == 7 ||
	PlayerInfo[playerid][pMember] == 11 || PlayerInfo[playerid][pLeader] == 11 || PlayerInfo[playerid][pMember] == 13 || PlayerInfo[playerid][pLeader] == 13)
	{
		if(IsPlayerConnected(giveplayerid))
		{
			if(giveplayerid != INVALID_PLAYER_ID)
			{
				if(giveplayerid == playerid)
				{
					SendClientMessageEx(playerid, COLOR_GREY, "You cannot suspect yourself!");
					return 1;
				}
				if(IsACop(giveplayerid))
				{
					SendClientMessageEx(playerid, COLOR_GREY, "You cannot /su an LEO!");
					return 1;
				}
				if (gTeam[giveplayerid] != 2 || PlayerInfo[playerid][pMember] != 2 || PlayerInfo[playerid][pLeader] != 2)
				{
					if (WantedPoints[giveplayerid]>=6)
					{
						SendClientMessageEx(playerid, COLOR_GRAD2, "Target is already most wanted.");
						return 1;
					}
					WantedPoints[giveplayerid] += 1;
					SetPlayerCriminal(giveplayerid,playerid, crime);
					return 1;
				}
				else
				{
					SendClientMessageEx(playerid, COLOR_GRAD2, "   You can't suspect an LEO!");
				}
			}
		}
		else
		{
			SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player specified.");
			return 1;
		}
	}
	else
	{
		SendClientMessageEx(playerid, COLOR_GRAD2, "   You are not a Cop / FBI / Coastguard!");
	}
	return 1;
}
Reply
#5

post errors!!!
Reply
#6

That is some very ugly code, it's no wonder you have problems who the hell would want to work with that non-sense it's a joke the logic is assbackwards.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)