I need your help. I can't /su (give wanted stars) to a player...I am trying to /su someone (not a LEO member) and it says: You can't /su a LEO member! (BUT HE ISN'T)
Код:
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;
}