Advertisement
Guest User

Untitled

a guest
Dec 7th, 2016
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.22 KB | None | 0 0
  1. /*
  2. Autowanted system for DarkRP
  3. Created by Donkie (http://steamcommunity.com/id/Donkie/)
  4. 2014-04-25
  5. */
  6.  
  7. /*
  8. General config
  9. */
  10. AUTOWANTED_MAXRANGE = 2000 // Maximum range a police can "see" a crime
  11. AUTOWANTED_AIMLIMIT = 0.5 // Basically a variable that lets you change how much a policeman can see. Value of 1 means the
  12. //CP needs to look exactly at the position of the crime. Value of -1 means he can look even in the opposite direction and still
  13. //technically "see" the crime. 0.5 means a FOV of 90, which should be set as default. If you feel that you saw a crime, but it didn't
  14. //get noticed, try lowering this value.
  15. AUTOWANTED_BLOCKEDCHECK = true // Enables/Disables the walls check. If this is disabled, the police can wanted people through walls.
  16.  
  17. //Return true if this player should be allowed to set people as wanted.
  18. //This is set as "return ply:isCP()" by default to only let police be able to do it.
  19. //Setting this to "return true" will make anyone be able to set people as wanted, and because of that, be careful since the window
  20. //can get quite annoying if you're a gangster and your friends are doing crimes all the time.
  21. function playerCanReportCrime(ply)
  22. return ply:isCP()
  23. end
  24.  
  25. /*
  26. Reasons to check for. Set any of these to false instead of true to disable it.
  27. */
  28. AUTOWANTED_REASONS = {}
  29. AUTOWANTED_REASONS["Possession of Contraband"] = true //Put people as wanted if they're holding any item marked as contraband.
  30. AUTOWANTED_REASONS["Murder"] = true //Put people as wanted if they murdered someone
  31. AUTOWANTED_REASONS["Assault"] = true //Put people as wanted if they harm (but not kill) someone
  32. AUTOWANTED_REASONS["Possession of Illegal Weaponry"] = true //Put people as wanted if they're holding a weapon they're not authorized to use. ->
  33. //This only works if GAMEMODE.Config.license is set to true. Make sure that weapons such as keys and pocket is added to
  34. //GAMEMODE.NoLicense table, or they'll get detected as Unauthorized weapons.
  35. AUTOWANTED_REASONS["Jail Breaking"] = true //Put people as wanted if a non-CP unarrest someones.
  36. AUTOWANTED_REASONS["Active Terrorist"] = true //Put people as wanted if they're having an AoS job.
  37. AUTOWANTED_REASONS["Illegal Activity"] = true //Wants people for lockpick, keypad cracking, pickpocketing.
  38.  
  39.  
  40. /*
  41. Illegal Activity
  42. */
  43. function playerCommitingIllegalActivity(ply)
  44. local wep = ply:GetActiveWeapon()
  45. if not IsValid(wep) then return false end
  46.  
  47. if (wep.IsLockPicking) or (ply.IsLockPicking and ply:IsLockPicking()) or (wep.IsCracking) or (wep.GetPickpocketing and wep:GetPickpocketing()) then return true end
  48.  
  49. //ARitz Cracker's ATM mod
  50. for k,v in pairs(ents.FindByClass("sent_arc_atmhack")) do
  51. if v.Hacker == ply then
  52. local atm = v:GetParent()
  53. if IsValid(atm) and atm.IsAFuckingATM and ply:GetPos():DistToSqr(atm:GetPos()) < (100*100) then
  54. return true
  55. end
  56. end
  57. end
  58.  
  59. return false
  60. end
  61.  
  62. /*
  63. ArrestOnSight
  64. */
  65. local arrestonsightjobs = {}
  66. arrestonsightjobs[TEAM_TERROR] = true // Example. Will make the gundealer be wanted as soon as a police sees one.
  67.  
  68. function playerHasIllegalJob(ply)
  69. return arrestonsightjobs[ply:Team()]
  70. end
  71.  
  72. /*
  73. Ignorelist
  74.  
  75. Make this return false if you don't want the player to be autowanted. Put for example "return not ply:isCP()" to prevent all cops from being
  76. wanted (by autowanted)
  77.  
  78. Default: "return true" will make everybody eligible for autowanted.
  79. */
  80. function playerCanBeAutowanted(ply)
  81. return not ply:isCP()
  82. end
  83.  
  84.  
  85. /*
  86. Unauthorized weapons
  87. */
  88. local allowedteams = {}
  89. allowedteams[TEAM_GUN] = true // Gundealers can hold guns without being criminals.
  90.  
  91. function playerAllowedToHoldGuns(ply)
  92. return ply:isCP() or ply:getDarkRPVar("HasGunlicense") //If the player is a police, or he exists in one of the allowedteams, he can carry guns.
  93. end
  94.  
  95. //List of weapons thats legal.
  96. aw_legalweapons = {}
  97. aw_legalweapons["weapon_physcannon"] = true
  98. aw_legalweapons["weapon_physgun"] = true
  99. aw_legalweapons["weapon_bugbait"] = true
  100. aw_legalweapons["gmod_tool"] = true
  101. aw_legalweapons["gmod_camera"] = true
  102. aw_legalweapons["keys"] = true
  103. aw_legalweapons["pocket"] = true
  104. aw_legalweapons["med_kit"] = true
  105. aw_legalweapons["door_ram"] = true
  106. aw_legalweapons["unarrest_stick"] = true
  107. aw_legalweapons["arrest_stick"] = true
  108. aw_legalweapons["stunstick"] = true
  109. aw_legalweapons["nova_mechanic"] = true
  110. aw_legalweapons["swm_chopping_axe"] = true
  111. aw_legalweapons["climb_swep2"] = true
  112. aw_legalweapons["weapon_vape"] = true
  113. aw_legalweapons["cm_debug_tool"] = true
  114. aw_legalweapons["weapon_keypadchecker"] = true
  115. aw_legalweapons["weapon_vape_juicy"] = true
  116. aw_legalweapons["stungun"] = true
  117. aw_legalweapons["weapon_polearm"] = true
  118. aw_legalweapons["guitar"] = true
  119. aw_legalweapons["realistic_hook"] = true
  120. aw_legalweapons["paintballgun"] = true
  121. aw_legalweapons["weapon_mse_katana"] = true
  122. aw_legalweapons["prokeypadcracker"] = true
  123. aw_legalweapons["swep_pickpocket"] = true
  124. aw_legalweapons["weapon_sh_keypadcracker_deploy"] = true
  125. aw_legalweapons["pro_lockpick_update"] = true
  126. aw_legalweapons["weapon_arc_atmhack"] = true
  127. aw_legalweapons["weapon_hack_phone"] = true
  128. aw_legalweapons["weapon_cloak"] = true
  129. aw_legalweapons["weapon_dringer"] = true
  130. aw_legalweapons["tf2_spy_acr_hookblade"] = true
  131. aw_legalweapons["lockpick"] = true
  132. aw_legalweapons["weapon_hexshield_local"] = true
  133. aw_legalweapons["blink"] = true
  134.  
  135. /*
  136. Contraband checking
  137.  
  138. ADVANCED USERS
  139. This function is used to check if an entity is illegal. Add specific classes to the contraclasses table. Or do as I did and
  140. make a string.find if you want regex.
  141. */
  142. local contraclasses = {}
  143. contraclasses["drug"] = true
  144. contraclasses["drug_lab"] = true
  145. contraclasses["wd_explosive"] = true
  146. contraclasses["adrug_weed_seed"] = true
  147. contraclasses["eml_meth"] = true
  148. contraclasses["adrug_weed"] = true
  149. contraclasses["adrug_weed_plant"] = true
  150. contraclasses["durgz_alcohol"] = true
  151. contraclasses["durgz_cocaine"] = true
  152. contraclasses["durgz_heroine"] = true
  153. contraclasses["durgz_lsd"] = true
  154. contraclasses["durgz_weed"] = true
  155. contraclasses["eml_redp"] = true
  156. function isContraband(ent)
  157. if string.find(ent:GetClass(), "money.*print") then return true end // Should get all the moneyprinter cases.
  158. if contraclasses[ent:GetClass()] then return true end
  159.  
  160. return false
  161. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement