SHARE
TWEET

Untitled

a guest Nov 16th, 2019 102 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --
  2. -- Created by IntelliJ IDEA.
  3. -- User: Sling
  4. -- Date: 06-03-2019
  5. -- Time: 19:11
  6. -- Made for CiviliansNetwork
  7. --
  8.  
  9. Citizen.CreateThread(function()
  10.   while true do
  11.     Citizen.Wait(0) -- prevent crashing
  12.  
  13.     -- These natives have to be called every frame.
  14.     SetVehicleDensityMultiplierThisFrame(0.00) -- set traffic density to 0
  15.     SetPedDensityMultiplierThisFrame(5.0) -- set npc/ai peds density to 0
  16.     SetRandomVehicleDensityMultiplierThisFrame(0.0) -- set random vehicles (car scenarios / cars driving off from a parking spot etc.) to 0
  17.     SetParkedVehicleDensityMultiplierThisFrame(0.6) -- set random parked vehicles (parked car scenarios) to 0
  18.     SetScenarioPedDensityMultiplierThisFrame(0.0, 0.0) -- set random npc/ai peds or scenario peds to 0
  19.     SetGarbageTrucks(false) -- Stop garbage trucks from randomly spawning
  20.     SetRandomBoats(false) -- Stop random boats from spawning in the water.
  21.     SetCreateRandomCops(false) -- disable random cops walking/driving around.
  22.     SetCreateRandomCopsNotOnScenarios(false) -- stop random cops (not in a scenario) from spawning.
  23.     SetCreateRandomCopsOnScenarios(false) -- stop random cops (in a scenario) from spawning.
  24.  
  25.     local x,y,z = table.unpack(GetEntityCoords(PlayerPedId()))
  26.     -- ClearAreaOfVehicles(x, y, z, 1000, false, false, false, false, false)
  27.     -- RemoveVehiclesFromGeneratorsInArea(x - 500.0, y - 500.0, z - 500.0, x + 500.0, y + 500.0, z + 500.0);
  28.   end
  29. end)
  30.  
  31.  
  32.  
  33. weapon_types = {
  34.   "WEAPON_ANIMAL",
  35.   "WEAPON_UNARMED",
  36.   "WEAPON_ADVANCEDRIFLE",
  37.   "WEAPON_AIRSTRIKE_ROCKET",
  38.   "WEAPON_APPISTOL",
  39.   "WEAPON_ASSAULTRIFLE",
  40.   "WEAPON_ASSAULTRIFLE_MK2",
  41.   "WEAPON_ASSAULTSHOTGUN",
  42.   "WEAPON_ASSAULTSMG",
  43.   "WEAPON_AUTOSHOTGUN",
  44.   "WEAPON_BALL",
  45.   "WEAPON_BAT",
  46.   "WEAPON_BATTLEAXE",
  47.   "WEAPON_BOTTLE",
  48.   "WEAPON_BRIEFCASE",
  49.   "WEAPON_BRIEFCASE_02",
  50.   "WEAPON_BULLPUPRIFLE",
  51.   "WEAPON_BULLPUPSHOTGUN",
  52.   "WEAPON_BZGAS",
  53.   "WEAPON_CARBINERIFLE",
  54.   "WEAPON_CARBINERIFLE_MK2",
  55.   "WEAPON_COMBATMG",
  56.   "WEAPON_COMBATMG_MK2",
  57.   "WEAPON_COMBATPDW",
  58.   "WEAPON_COMBATPISTOL",
  59.   "WEAPON_COMPACTLAUNCHER",
  60.   "WEAPON_COMPACTRIFLE",
  61.   "WEAPON_CROWBAR",
  62.   "WEAPON_DAGGER",
  63.   "WEAPON_DBSHOTGUN",
  64.   "WEAPON_DIGISCANNER",
  65.   "WEAPON_FIREEXTINGUISHER",
  66.   "WEAPON_FIREWORK",
  67.   "WEAPON_FLARE",
  68.   "WEAPON_FLAREGUN",
  69.   "WEAPON_FLASHLIGHT",
  70.   "WEAPON_GOLFCLUB",
  71.   "WEAPON_GRENADE",
  72.   "WEAPON_GRENADELAUNCHER",
  73.   "WEAPON_GRENADELAUNCHER_SMOKE",
  74.   "WEAPON_GUSENBERG",
  75.   "WEAPON_HAMMER",
  76.   "WEAPON_HATCHET",
  77.   "WEAPON_HEAVYPISTOL",
  78.   "WEAPON_HEAVYSHOTGUN",
  79.   "WEAPON_HEAVYSNIPER",
  80.   "WEAPON_HOMINGLAUNCHER",
  81.   "WEAPON_KNIFE",
  82.   "WEAPON_KNUCKLE",
  83.   "WEAPON_MACHETE",
  84.   "WEAPON_MACHINEPISTOL",
  85.   "WEAPON_MARKSMANPISTOL",
  86.   "WEAPON_MARKSMANRIFLE",
  87.   "WEAPON_MG",
  88.   "WEAPON_MICROSMG",
  89.   "WEAPON_MINIGUN",
  90.   "WEAPON_MINISMG",
  91.   "WEAPON_MOLOTOV",
  92.   "WEAPON_MUSKET",
  93.   "WEAPON_NIGHTSTICK",
  94.   "WEAPON_PASSENGER_ROCKET",
  95.   "WEAPON_PETROLCAN",
  96.   "WEAPON_PIPEBOMB",
  97.   "WEAPON_PISTOL",
  98.   "WEAPON_PISTOL_MK2",
  99.   "WEAPON_PISTOL50",
  100.   "WEAPON_POOLCUE",
  101.   "WEAPON_PROXMINE",
  102.   "WEAPON_PUMPSHOTGUN",
  103.   "WEAPON_RAILGUN",
  104.   "WEAPON_REMOTESNIPER",
  105.   "WEAPON_REVOLVER",
  106.   "WEAPON_RPG",
  107.   "WEAPON_SAWNOFFSHOTGUN",
  108.   "WEAPON_SMG",
  109.   "WEAPON_SMG_MK2",
  110.   "WEAPON_SMOKEGRENADE",
  111.   "WEAPON_SNIPERRIFLE",
  112.   "WEAPON_SNOWBALL",
  113.   "WEAPON_SNSPISTOL",
  114.   "WEAPON_SPECIALCARBINE",
  115.   "WEAPON_STICKYBOMB",
  116.   "WEAPON_STINGER",
  117.   "WEAPON_STUNGUN",
  118.   "WEAPON_SWITCHBLADE",
  119.   "WEAPON_VINTAGEPISTOL",
  120.   "WEAPON_WRENCH"
  121. }
  122.  
  123. weapon_names = {}
  124.  
  125. for index, value in ipairs(weapon_types) do
  126.   weapon_names[GetHashKey(value)] = value
  127. end
  128.  
  129. relationshipgroups = {
  130.   "AGGRESSIVE_INVESTIGATE",
  131.   "AMBIENT_GANG_BALLAS",
  132.   "AMBIENT_GANG_CULT",
  133.   "AMBIENT_GANG_FAMILY",
  134.   "AMBIENT_GANG_HILLBILLY",
  135.   "AMBIENT_GANG_LOST",
  136.   "AMBIENT_GANG_MARABUNTE",
  137.   "AMBIENT_GANG_MEXICAN",
  138.   "AMBIENT_GANG_SALVA",
  139.   "AMBIENT_GANG_WEICHENG"
  140.   -- "COP",
  141.   -- "FIREMAN",
  142.   -- "GANG_1",
  143.   -- "GANG_10",
  144.   -- "GANG_2",
  145.   -- "GANG_9",
  146.   -- "PRIVATE_SECURITY",
  147.   -- "SECURITY_GUARD"
  148. }
  149.  
  150. group_names = {}
  151.  
  152. for index, value in ipairs(relationshipgroups) do
  153.   group_names[GetHashKey(value)] = value
  154. end
  155.  
  156. police = true
  157. ems = true
  158.  
  159. Citizen.CreateThread(function()
  160.     Citizen.Wait(30000)
  161.     for i = 1, 15 do
  162.         EnableDispatchService(i, false)
  163.     end
  164. end)
  165.  
  166. Citizen.CreateThread(function()
  167.     local function should_delete(tab, val)
  168.         for index, value in ipairs(tab) do
  169.             if GetHashKey(value) == val then
  170.                 return true
  171.             end
  172.         end
  173.         return false
  174.     end
  175.  
  176.     while true do
  177.         Citizen.Wait(1000)
  178.         local handle, ped = FindFirstPed()
  179.         local success
  180.         repeat
  181.             if (should_delete(relationshipgroups,GetPedRelationshipGroupHash(ped)) or GetBestPedWeapon(ped) ~= GetHashKey("WEAPON_UNARMED")) and IsPedHuman(ped) and not IsPedAPlayer(ped) and not IsEntityDead(ped) and GetDistanceBetweenCoords(GetEntityCoords(ped),3060.0478515625,-4715.671875,40.261618614197,false) > 800.0 then
  182.         if weapon_names[GetBestPedWeapon(ped)] ~= nil then
  183.           ped_weapon = weapon_names[GetBestPedWeapon(ped)]
  184.         elseif GetBestPedWeapon(ped) ~= nil then
  185.           ped_weapon = GetBestPedWeapon(ped)
  186.         else
  187.           ped_weapon = "Unknown"
  188.         end
  189.         if group_names[GetPedRelationshipGroupHash(ped)] ~= nil then
  190.           ped_group = group_names[GetPedRelationshipGroupHash(ped)]
  191.         elseif GetPedRelationshipGroupHash(ped) ~= nil then
  192.           ped_group = GetPedRelationshipGroupHash(ped)
  193.         else
  194.           ped_group = "Unknown"
  195.         end
  196.                 local vehicle = GetVehiclePedIsIn(ped,false)
  197.  
  198.         ped_model = GetEntityModel(ped)
  199.  
  200.         if vehicle ~= 0 then
  201.           ped_vehicle = GetDisplayNameFromVehicleModel(GetEntityModel(vehicle))
  202.           SetEntityAsMissionEntity(vehicle, true, true)
  203.           DeleteVehicle(vehicle)
  204.           Citizen.Wait(100)
  205.         else
  206.           ped_vehicle = "None"
  207.                 end
  208.  
  209.         ped_posx = 0
  210.         ped_posy = 0
  211.         ped_posz = 0
  212.         ped_posx, ped_posy, ped_posz = table.unpack(GetEntityCoords(ped,false))
  213.  
  214.         if IsEntityVisible(ped) then
  215.           SetPedDropsWeaponsWhenDead(ped,false)
  216.           if not GetPedConfigFlag(ped,52,1) then SetPedConfigFlag(ped,52,true) end
  217.           if not GetPedConfigFlag(ped,62,1) then SetPedConfigFlag(ped,62,true) end
  218.           if not GetPedConfigFlag(ped,292,1) then SetPedConfigFlag(ped,292,true) end
  219.           SetEntityAsNoLongerNeeded(ped)
  220.           SetEntityInvincible(ped, true)
  221.           SetEntityVisible(ped, false, false)
  222.           -- print("NPCDelete - "..ped_weapon.." - "..ped_group.." - "..ped_vehicle.." - "..ped_model.." - "..ped_posx..","..ped_posy..","..ped_posz)
  223.         end
  224.  
  225.         Citizen.Wait(100)
  226.             end
  227.             success, ped = FindNextPed(handle)
  228.         until not success
  229.         EndFindPed(handle)
  230.         DisablePlayerVehicleRewards(PlayerId())
  231.     end
  232. end)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top