09.05.2013, 18:53
So I have made a command /su and when I want to /su [playerid] [crime id] the crime ID will set the prison time for that crime ID, so say /su 1 1 you have 10min of prison... now lets say you do /su 1 1 then /su 1 2 now it will take the 10min from the first /su 1 1 then take the 15min from the /su 1 2 and add them to each other so it would be 25min of jail for those two crimes. but here is the thing when I su someone it just sets the prison time for that ID does not add them together for each set of crimes. Hope you understand me...
Код:
CMD:su(playerid, params[]) { new playerb, string[128], crime; if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command."); if(!IsACop(playerid) && !IsFBI(playerid) && !IsNG(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not an LEO."); if(!PlayerInfo[playerid][pFacDuty]) return SendClientMessage(playerid, COLOR_GREY, "You must be on duty to use this command."); if(sscanf(params, "ui", playerb, crime)) { SendClientMessage(playerid, COLOR_WHITE, "** [USAGE]: /su [playerid] [Crime ID]"); return 1; } if(crime < 0 || crime > 12) return SendClientMessage(playerid, COLOR_GREY, "Crimes are between 1 and 12."); if(!IsPlayerLoggedIn(playerb)) return SendClientMessage(playerid, COLOR_GREY, "Invalid player id."); if(IsACop(playerb) && !IsFBI(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You can't charge an LEO."); if(PlayerInfo[playerb][pWanted] >= 6) return SendClientMessage(playerid, COLOR_GREY, "Player has the maximum wanted level possible."); switch(crime) { case 1: { AddDodWantedLevel(playerb, params); PlayerPlaySound(playerid,1054,0.0,0.0,0.0); PlayerPlaySound(playerb,1054,0.0,0.0,0.0); PlayerInfo[playerb][pPrisonTime] = 10*60; format(string, sizeof(string), "You have been sued for 'FFC violation' by %s. You're now on wanted level %d.", RPN(playerid), PlayerInfo[playerb][pWanted]); SendClientMessage(playerb, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "%s: %s has charged %s for 'FFC violation'. Their now on wanted level %d.", RPFN(playerid), RPN(playerid), RPN(playerb), PlayerInfo[playerb][pWanted]); foreach(Player, i) { if(IsACop(i) || IsAGov(i) || IsFBI(i) || IsNG(i)) { SendClientMessage(i, COLOR_DEPTRADIO, string); PlayCrimeReportForPlayer(i, playerb, 19); } } } case 2: { AddDodWantedLevel(playerb, params); PlayerPlaySound(playerid,1054,0.0,0.0,0.0); PlayerPlaySound(playerb,1054,0.0,0.0,0.0); PlayerInfo[playerb][pPrisonTime] = 15*60; format(string, sizeof(string), "You have been sued for 'Failure to Comply' by %s. You're now on wanted level %d.", RPN(playerid), PlayerInfo[playerb][pWanted]); SendClientMessage(playerb, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "%s: %s has charged %s for 'Failure to Comply'. Their now on wanted level %d.", RPFN(playerid), RPN(playerid), RPN(playerb), PlayerInfo[playerb][pWanted]); foreach(Player, i) { if(IsACop(i) || IsAGov(i) || IsFBI(i) || IsNG(i)) { SendClientMessage(i, COLOR_DEPTRADIO, string); PlayCrimeReportForPlayer(i, playerb, 19); } } } } return 1; }