15.11.2011, 19:42
Quote:
I have a big problem with Wanted system , work only if you kill an civil or Cop
2) The maximum wanted is 10 , but if you give to a player wanted 6 and then give him again wanted (eg . 8 ) the wanted level pass the maximum level Код:
if(strcmp(cmd, "/suspect", true) == 0 || strcmp(cmd, "/su", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) return SendClientMessage(playerid, -1, "USAGE: /(su)spect [PlayerID/PartOfName] [WantedLevel] [Reason]"); new playa; new money; playa = ReturnUser(tmp); tmp = strtok(cmdtext, idx); money = strval(tmp); if (IsACop(playerid)) { if(IsPlayerConnected(playa)) { if(playa != INVALID_PLAYER_ID) { new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[64]; while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } result[idx - offset] = EOS; result[0] = toupper(result[0]); if(!strlen(result)) return SendClientMessage(playerid, -1, "USAGE: /(su)spect [PlayerID/PartOfName] [WantedLevel] [Reason]"); if (gTeam[playa] == 2 || IsACop(playa)) return SendClientMessage(playerid, -1, "You can't Suspect a Cop!"); if(money > 10) return SendClientMessage(playerid, COLOR_GREY, "Maximum wanted level is 10!"); if(money == 0) return SendClientMessage(playerid, COLOR_GREY, "Minimum wanted level is 0!"); if(WantedLevel[playa] > 9) return SendClientMessage(playerid, COLOR_GREY, "That player have Maxim Wanted Level! (Wanted 10)"); WantedLevel[playa] += money; new wl = WantedLevel[playa]; SetPlayerWantedLevel(playa, wl); GetPlayerName(playa, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), "You commited a crime ( %s ) [+%d],Raportat de: %s",result,money,sendername); SendClientMessage(playa, COLOR_LIGHTRED, string); for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(PlayerInfo[i][pMember] == 1 || PlayerInfo[i][pLeader] == 1 || PlayerInfo[i][pMember] == 2 || PlayerInfo[i][pLeader] == 2 || PlayerInfo[i][pMember] == 3 || PlayerInfo[i][pLeader] == 3) { format(string, sizeof(string), "HQ: All units APB: Reporter: %s.",sendername); SendClientMessage(i, 0x0000C1FF, string); format(string, sizeof(string), "HQ: Crime: %s[+%d], Suspect: %s. ",result,money,giveplayer); SendClientMessage(i, 0x0000C1FF, string); } } } } } } else return SendClientMessage(playerid, COLOR_GREY, "You are not a Cop!"); } return 1; } |