• DarkRP Wanted/Warrant Fix
    11 replies, posted
Well as CP/Police I can warrant myself and other police officers,swats,chief etc..How do I fix that ? And yes jobs are defined as CP GAMEMODE.CivilProtection = { [TEAM_POLICE] = true, [TEAM_CHIEF] = true, [TEAM_MAYOR] = true, [TEAM_SWAT] = true, }
You'd have to tell your job table that TEAM warrant is false. But if you do that you might want to create another job for corruption if that's something you want.
Well only thing that I want is to prevent police/mayor giving warrant/wanted to another police member or mayor.
I don't know what the warrant function in DarkRP is so you would need to find that and then just do a customCheck on the job for example: customCheck = function(ply) if TEAM_CP then Warrant(TEAM_CP) return false
Hooks/Shared/canRequestWarrant Hooks/Shared/canWanted Hooks/Server/canArrest Functions/Player/Shared/isCP
That's not helping me I need someone that has some experience in DarkRP...Since I think thats "bug" in DarkRP
It is helping you, ButterKing5000's post told you the exact functions you'd need to prevent this.
hook.Add("canWanted", "drpcwanted", function(target, actor, reason) return !target:isCP(), "You can't make cops wanted!" end) hook.Add("canRequestWarrant", "drpcrwarrant", function(target, actor, reason) return !target:isCP(), "You can't warrant a cop!" end) hook.Add("canArrest", "drpcarrest", function(arrester, arrestee) return !arrestee:isCP(), "You can't arrest a cop!" end) untested, I won't tell you where to put these.. You gotta find out that for yourself
Mhm if someone could help me please,I'm not that good with lua.Thanks
We have helped you, use what ButterKing5000 and YunoGasaii posted. You're being given the world and asking for more.
Solution that worked for me: Make .lua put it in autorun/server and add these 2 lines hook.Add("canWanted", "MyMod.canWanted", function(target, actor, reason)return !target:isCP(), "You can't make a cop wanted !"end) hook.Add("canRequestWarrant", "MyMod.canRequestWarrant", function(target, actor, reason)return !target:isCP(), "You can't issue warrant to a cop !"end)
Exactly what I posted..
Sorry, you need to Log In to post a reply to this thread.