Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Autowanted system for DarkRP
- Created by Donkie (http://steamcommunity.com/id/Donkie/)
- 2014-04-25
- */
- /*
- General config
- */
- AUTOWANTED_MAXRANGE = 2000 // Maximum range a police can "see" a crime
- AUTOWANTED_AIMLIMIT = 0.5 // Basically a variable that lets you change how much a policeman can see. Value of 1 means the
- //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
- //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
- //get noticed, try lowering this value.
- AUTOWANTED_BLOCKEDCHECK = true // Enables/Disables the walls check. If this is disabled, the police can wanted people through walls.
- //Return true if this player should be allowed to set people as wanted.
- //This is set as "return ply:isCP()" by default to only let police be able to do it.
- //Setting this to "return true" will make anyone be able to set people as wanted, and because of that, be careful since the window
- //can get quite annoying if you're a gangster and your friends are doing crimes all the time.
- function playerCanReportCrime(ply)
- return ply:isCP()
- end
- /*
- Reasons to check for. Set any of these to false instead of true to disable it.
- */
- AUTOWANTED_REASONS = {}
- AUTOWANTED_REASONS["Possession of Contraband"] = true //Put people as wanted if they're holding any item marked as contraband.
- AUTOWANTED_REASONS["Murder"] = true //Put people as wanted if they murdered someone
- AUTOWANTED_REASONS["Assault"] = true //Put people as wanted if they harm (but not kill) someone
- AUTOWANTED_REASONS["Possession of Illegal Weaponry"] = true //Put people as wanted if they're holding a weapon they're not authorized to use. ->
- //This only works if GAMEMODE.Config.license is set to true. Make sure that weapons such as keys and pocket is added to
- //GAMEMODE.NoLicense table, or they'll get detected as Unauthorized weapons.
- AUTOWANTED_REASONS["Jail Breaking"] = true //Put people as wanted if a non-CP unarrest someones.
- AUTOWANTED_REASONS["Active Terrorist"] = true //Put people as wanted if they're having an AoS job.
- AUTOWANTED_REASONS["Illegal Activity"] = true //Wants people for lockpick, keypad cracking, pickpocketing.
- /*
- Illegal Activity
- */
- function playerCommitingIllegalActivity(ply)
- local wep = ply:GetActiveWeapon()
- if not IsValid(wep) then return false end
- if (wep.IsLockPicking) or (ply.IsLockPicking and ply:IsLockPicking()) or (wep.IsCracking) or (wep.GetPickpocketing and wep:GetPickpocketing()) then return true end
- //ARitz Cracker's ATM mod
- for k,v in pairs(ents.FindByClass("sent_arc_atmhack")) do
- if v.Hacker == ply then
- local atm = v:GetParent()
- if IsValid(atm) and atm.IsAFuckingATM and ply:GetPos():DistToSqr(atm:GetPos()) < (100*100) then
- return true
- end
- end
- end
- return false
- end
- /*
- ArrestOnSight
- */
- local arrestonsightjobs = {}
- arrestonsightjobs[TEAM_TERROR] = true // Example. Will make the gundealer be wanted as soon as a police sees one.
- function playerHasIllegalJob(ply)
- return arrestonsightjobs[ply:Team()]
- end
- /*
- Ignorelist
- 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
- wanted (by autowanted)
- Default: "return true" will make everybody eligible for autowanted.
- */
- function playerCanBeAutowanted(ply)
- return not ply:isCP()
- end
- /*
- Unauthorized weapons
- */
- local allowedteams = {}
- allowedteams[TEAM_GUN] = true // Gundealers can hold guns without being criminals.
- function playerAllowedToHoldGuns(ply)
- 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.
- end
- //List of weapons thats legal.
- aw_legalweapons = {}
- aw_legalweapons["weapon_physcannon"] = true
- aw_legalweapons["weapon_physgun"] = true
- aw_legalweapons["weapon_bugbait"] = true
- aw_legalweapons["gmod_tool"] = true
- aw_legalweapons["gmod_camera"] = true
- aw_legalweapons["keys"] = true
- aw_legalweapons["pocket"] = true
- aw_legalweapons["med_kit"] = true
- aw_legalweapons["door_ram"] = true
- aw_legalweapons["unarrest_stick"] = true
- aw_legalweapons["arrest_stick"] = true
- aw_legalweapons["stunstick"] = true
- aw_legalweapons["nova_mechanic"] = true
- aw_legalweapons["swm_chopping_axe"] = true
- aw_legalweapons["climb_swep2"] = true
- aw_legalweapons["weapon_vape"] = true
- aw_legalweapons["cm_debug_tool"] = true
- aw_legalweapons["weapon_keypadchecker"] = true
- aw_legalweapons["weapon_vape_juicy"] = true
- aw_legalweapons["stungun"] = true
- aw_legalweapons["weapon_polearm"] = true
- aw_legalweapons["guitar"] = true
- aw_legalweapons["realistic_hook"] = true
- aw_legalweapons["paintballgun"] = true
- aw_legalweapons["weapon_mse_katana"] = true
- aw_legalweapons["prokeypadcracker"] = true
- aw_legalweapons["swep_pickpocket"] = true
- aw_legalweapons["weapon_sh_keypadcracker_deploy"] = true
- aw_legalweapons["pro_lockpick_update"] = true
- aw_legalweapons["weapon_arc_atmhack"] = true
- aw_legalweapons["weapon_hack_phone"] = true
- aw_legalweapons["weapon_cloak"] = true
- aw_legalweapons["weapon_dringer"] = true
- aw_legalweapons["tf2_spy_acr_hookblade"] = true
- aw_legalweapons["lockpick"] = true
- aw_legalweapons["weapon_hexshield_local"] = true
- aw_legalweapons["blink"] = true
- /*
- Contraband checking
- ADVANCED USERS
- This function is used to check if an entity is illegal. Add specific classes to the contraclasses table. Or do as I did and
- make a string.find if you want regex.
- */
- local contraclasses = {}
- contraclasses["drug"] = true
- contraclasses["drug_lab"] = true
- contraclasses["wd_explosive"] = true
- contraclasses["adrug_weed_seed"] = true
- contraclasses["eml_meth"] = true
- contraclasses["adrug_weed"] = true
- contraclasses["adrug_weed_plant"] = true
- contraclasses["durgz_alcohol"] = true
- contraclasses["durgz_cocaine"] = true
- contraclasses["durgz_heroine"] = true
- contraclasses["durgz_lsd"] = true
- contraclasses["durgz_weed"] = true
- contraclasses["eml_redp"] = true
- function isContraband(ent)
- if string.find(ent:GetClass(), "money.*print") then return true end // Should get all the moneyprinter cases.
- if contraclasses[ent:GetClass()] then return true end
- return false
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement