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


Messages In This Thread
CMD:su - by SupermanV - 29.05.2013, 11:05
Re: CMD:su - by SupermanV - 29.05.2013, 11:10
Re: CMD:su - by SupermanV - 29.05.2013, 11:30
Re: CMD:su - by Admin22 - 29.05.2013, 13:19
Respuesta: CMD:su - by Samp4lifes - 29.05.2013, 16:09
Re: CMD:su - by Pottus - 29.05.2013, 16:12

Forum Jump:


Users browsing this thread: 2 Guest(s)