29.05.2013, 11:05
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:
And this:
FIX THE SECOND CODE AND THEN COMMENT IT (FIXED)
Thanks
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) {
Код:
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; }
Thanks