You’ll be surprised to hear it did pretty much nothing :rofl::rofl:
I changed it to only give me scenarios that contain WORLD_VEHICLE and it seems to have solved my problem. Cant find any cars anywhere, can’t find any buses or anything.
Its also wiped out helicopters and boats etc.

EDIT: Here is my scenario list as this is the solution post

NOTE: You still need to run the density modifiers and this only affects traffic, you might still get a ped wandering about somewhere but I havent seen any yet

local scenarios = {
  'WORLD_VEHICLE_ATTRACTOR',
  'WORLD_VEHICLE_AMBULANCE',
  'WORLD_VEHICLE_BICYCLE_BMX',
  'WORLD_VEHICLE_BICYCLE_BMX_BALLAS',
  'WORLD_VEHICLE_BICYCLE_BMX_FAMILY',
  'WORLD_VEHICLE_BICYCLE_BMX_HARMONY',
  'WORLD_VEHICLE_BICYCLE_BMX_VAGOS',
  'WORLD_VEHICLE_BICYCLE_MOUNTAIN',
  'WORLD_VEHICLE_BICYCLE_ROAD',
  'WORLD_VEHICLE_BIKE_OFF_ROAD_RACE',
  'WORLD_VEHICLE_BIKER',
  'WORLD_VEHICLE_BOAT_IDLE',
  'WORLD_VEHICLE_BOAT_IDLE_ALAMO',
  'WORLD_VEHICLE_BOAT_IDLE_MARQUIS',
  'WORLD_VEHICLE_BOAT_IDLE_MARQUIS',
  'WORLD_VEHICLE_BROKEN_DOWN',
  'WORLD_VEHICLE_BUSINESSMEN',
  'WORLD_VEHICLE_HELI_LIFEGUARD',
  'WORLD_VEHICLE_CLUCKIN_BELL_TRAILER',
  'WORLD_VEHICLE_CONSTRUCTION_SOLO',
  'WORLD_VEHICLE_CONSTRUCTION_PASSENGERS',
  'WORLD_VEHICLE_DRIVE_PASSENGERS',
  'WORLD_VEHICLE_DRIVE_PASSENGERS_LIMITED',
  'WORLD_VEHICLE_DRIVE_SOLO',
  'WORLD_VEHICLE_FARM_WORKER',
  'WORLD_VEHICLE_FIRE_TRUCK',
  'WORLD_VEHICLE_EMPTY',
  'WORLD_VEHICLE_MARIACHI',
  'WORLD_VEHICLE_MECHANIC',
  'WORLD_VEHICLE_MILITARY_PLANES_BIG',
  'WORLD_VEHICLE_MILITARY_PLANES_SMALL',
  'WORLD_VEHICLE_PARK_PARALLEL',
  'WORLD_VEHICLE_PARK_PERPENDICULAR_NOSE_IN',
  'WORLD_VEHICLE_PASSENGER_EXIT',
  'WORLD_VEHICLE_POLICE_BIKE',
  'WORLD_VEHICLE_POLICE_CAR',
  'WORLD_VEHICLE_POLICE',
  'WORLD_VEHICLE_POLICE_NEXT_TO_CAR',
  'WORLD_VEHICLE_QUARRY',
  'WORLD_VEHICLE_SALTON',
  'WORLD_VEHICLE_SALTON_DIRT_BIKE',
  'WORLD_VEHICLE_SECURITY_CAR',
  'WORLD_VEHICLE_STREETRACE',
  'WORLD_VEHICLE_TOURBUS',
  'WORLD_VEHICLE_TOURIST',
  'WORLD_VEHICLE_TANDL',
  'WORLD_VEHICLE_TRACTOR',
  'WORLD_VEHICLE_TRACTOR_BEACH',
  'WORLD_VEHICLE_TRUCK_LOGS',
  'WORLD_VEHICLE_TRUCKS_TRAILERS',
  'WORLD_VEHICLE_DISTANT_EMPTY_GROUND'
}

for i, v in ipairs(scenarios) do
  SetScenarioTypeEnabled(v, false)
end

No freaking way :rofl::rofl::rofl::rofl::rofl::rofl::rofl:

Killing me here ahahahaah

Just as recommendation: Make a ‘mini script’ of it, and post it :wink: lots of people complain that the standard ‘disabling scripts’ don’t work properly :wink:

ALTHOUGH! Test it intensively first (to ensure it doesn’t cause issues while disabling the event :wink: )

I’ve added the loop that disables everything to the bottom of the snippet so it can be used :wink: Seems to work perfectly to me, theres no animation events in there or anything

1 Like

Might i ask what kind of game (mode) you are developing btw?

Mine in SA-MP was a “I’m Legend” game mode based on the equally named, movie back in the days (including some infected people here and there) and along the months more people ‘came out’ during ‘safe times’ (day) and also tried to ‘survive’ in that ‘deserted land’ .

So that’s why i’m interested in what you’re planning in a totally “Chernobyl like” world in GTA V haha

Im going for a post-apocolyptic type survival kind of thing

Honestly at this stage I dont know how well its going to turn out, but the idea I have got seems quite interesting to me and I hope I can pull it off.

1 Like

Hmm kinda the same thing as my “I’m Legend Mode” back in the SA-MP (old san andreas) days then i guess :slight_smile: nice :slight_smile:

I made it so that it was indeed like that, but that the players where ‘new inhabitants’ needing to ‘repopulate’ and ‘rehabilitate’ the society again (starting basic jobs etc to get the city running again) :slight_smile:

Wish you all the best and hope it works out, if you might need or want some idea’s don’t hesitate on contacting me in DM/PM, although i currently don’t run/make a ‘post apocalyptic’ server anymore, have ran it for over 9 years or more :slight_smile:
(and scripted EVERY bit of it from scratch :slight_smile: )

1 Like

Yeah I suppose so

I dont want to give too much away publicly incase some speedier dev beats me to it :joy:

Thank you for all your help up to this point and I definitely wont hesitate to contact you for help if I do need it.

I think Id of quite enjoyed your server back in the day, I love post apocolyptic survival settings.

2 Likes

Yeah i know what you mean with sharing idea’s :wink: i have some very awesome things done already but not fully ‘release ready’ (final testing phases" and don’t want to ‘ruin’ those either haha.

BUT don’t worry, i’m not the type to steal stuff, rather one that shares ‘to much’ stuff haha, also a reason why i mentioned PM instead of public discussions :wink: haha

Okay so i have one sync 64 slot server and had alot of issues with AI Cars but most were resolved when changing, traffic density to = 0.1 | parked car = 0.0 | NPCS = 100 . But still had tankers blowing up and cars spawning on top of each other. Down below is what my Traffic density is and the disable AI script i use. Recently added a few lines to the client side and it works so good to disable certian AI so we can have cars on the map still and NPCS because for whatever reason when setting : traffic density to = 0.0 | parked car = 0.0 | NPCS = 100 . NPCs would barley spawn, need them to sell drugs to/ want to. Found line of code here to use https://runtime.fivem.net/doc/natives/#_0x0FC2D89AC25A5814

FILE NAME : trafficadjuster

CONFIG : (CHANGE TO THIS CAN ADJUST TRAFFIC AMOUNT IF NEED BE)

TrafficAmount = 0.1
PedestrianAmount = 100
ParkedAmount = 0
EnableDispatch = false

FILENAME: gd_airport_ai_begone https://github.com/glitchdetector/gd_airport_ai_begone

CLIENTSIDE: (CHANGE TO THIS)

Citizen.CreateThread(function()
– Other stuff normally here, stripped for the sake of only scenario stuff
local SCENARIO_TYPES = {
“WORLD_VEHICLE_MILITARY_PLANES_SMALL”, – Zancudo Small Planes
“WORLD_VEHICLE_MILITARY_PLANES_BIG”, – Zancudo Big Planes
}
local SCENARIO_GROUPS = {
2017590552, – LSIA planes
2141866469, – Sandy Shores planes
1409640232, – Grapeseed planes
“ng_planes”, – Far up in the skies jets
}
local SUPPRESSED_MODELS = {
“SHAMAL”, – They spawn on LSIA and try to take off
“LUXOR”, – They spawn on LSIA and try to take off
“LUXOR2”, – They spawn on LSIA and try to take off
“JET”, – They spawn on LSIA and try to take off and land, remove this if you still want em in the skies
“LAZER”, – They spawn on Zancudo and try to take off
“TITAN”, – They spawn on Zancudo and try to take off
“BARRACKS”, – Regularily driving around the Zancudo airport surface
“BARRACKS2”, – Regularily driving around the Zancudo airport surface
“CRUSADER”, – Regularily driving around the Zancudo airport surface
“RHINO”, – Regularily driving around the Zancudo airport surface
“AIRTUG”, – Regularily spawns on the LSIA airport surface
“RIPLEY”, – Regularily spawns on the LSIA airport surface
-----WILL STOP FROM SPAWNING IN TRAFFIC HELP ONE SYNC/ HELP BLOWING UP AND SPAWNING ON TOP OF EACH OTHER-----
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“armytanker”), true); – Spawn at zancudo
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“docktrailer”), true);-- Spawn on map
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“tr3”), true); – Spawn on map
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“tr2”), true); – Spawn on map
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“tr4”), true); – Spawn on map
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“trflat”), true);-- Spawn on map
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“trailers”), true); – Spawn on map
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“trailers4”), true); – Spawn on map
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“trailers3”), true); – Spawn on map
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“packer”), true); – Spawn on map
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“phantom”), true); – Spawn on map
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“phantom3”), true); – Spawn on map
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“trailers2”), true); – Spawn on map
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“tvtrailer”), true); – Spawn on map
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“trailerlogs”), true); – Spawn on map
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“trailersmall”), true); – Spawn on map
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“boattrailer”), true); – Spawn on map
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“tanker”), true); – Spawn on map
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“tanker2”), true); – Spawn on map
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“trash”), true); – Spawn on map
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“trash2”), true); – Spawn on map
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“airbus”), true); – Spawn on map
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“bus”), true); – Spawn on map
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“coach”), true); – Spawn on map
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“pounder”), true); – Spawn on map
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“pounder2”), true); – Spawn on map
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“stockade”), true); – Spawn on map
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“benson”), true); – Spawn on map (NOT WORKING SOMETIMES)
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“biff”), true); – Spawn on map (NOT WORKING SOMETIMES)
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“mule”), true); – Spawn on map
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“mule2”), true); – Spawn on map
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“mule3”), true); – Spawn on map
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“mule4”), true); – Spawn on map
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“scrap”), true); – Spawn on map
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“sandking”), true); – Spawn on map
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“sandkin2”), true); – Spawn on map
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“dloader”), true); – Spawn on map
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“hauler”), true); – Spawn on map
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“hauler2”), true); – Spawn on map
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“flatbed”), true); – Spawn on map (NOT WORKING SOMETIMES)
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“mixer”), true); – Spawn on map (NOT WORKING)
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“mixer2”), true); – Spawn on map (NOT WORKING)
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“rubble”), true); – Spawn on map (NOT WORKING SOMETIMES)
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“tiptruck”), true); – Spawn on map (NOT WORKING SOMETIMES)
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“tiptruck2”), true); – Spawn on map (NOT WORKING SOMETIMES)
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“scrap”), true); – Spawn on map
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“towtruck”), true); – Spawn on map
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“towtruck2”), true); – Spawn on map
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“taco”), true); – Spawn on map
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“boxville”), true); – Spawn on map
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“boxville2”), true); – Spawn on map
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“boxville3”), true); – Spawn on map
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“boxville4”), true);-- Spawn on map
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“cargobob”), true);-- Spawn on map (DOES NOT STOP 1 FLYING AT ZANCUDO)
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“cargobob2”), true); – Spawn on map
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“cargobob3”), true); – Spawn on map
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“cargobob4”), true); – Spawn on map
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“volatus”), true); – Spawn on map
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“buzzard2”), true); – Spawn on map
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“besra”), true); – Spawn on map
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“lazer”), true); – Spawn on map
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“policeb”), true); – Spawn on map
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“police3”), true); – Spawn on map
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“police4”), true); – Spawn on map
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“police”), true); – Spawn on map
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY(“polmav”), true); – Spawn on map

}

while true do
    for _, sctyp in next, SCENARIO_TYPES do
        SetScenarioTypeEnabled(sctyp, false)
    end
    for _, scgrp in next, SCENARIO_GROUPS do
        SetScenarioGroupEnabled(scgrp, false)
    end
    for _, model in next, SUPPRESSED_MODELS do
        SetVehicleModelIsSuppressed(GetHashKey(model), true)
    end
    Wait(10000)
end

end)

Thank you for sharing, it would be amazing if you shared it as a finished resource, it would help alot of people. Added it to my server, thanks!

2 Likes

was this ever released? I am still trying to figure how to remove everything not owned by playes from the server. And i still can’t figure out how.

1 Like

where do i put this?

1 Like

I’ve not been in the FiveM scene for some time now, but I’m back. I will be compiling my aforementioned script into a resource very shortly and hopefully end some of your suffering.

I will mark this as the new solution, here is the released resource that will disable AI.

Excuse my Ignorance, Is there a way to disable AI completely EXCEPT for an area?
To be more specific, I want to disable AI Completely EXCEPT for the beach area (Del perro, Vespucci, San Andreas, Vespucci Beach, Del Perro Beach)…That’s because I’m using a Sell Zone for drugs, and I’d need to keep NPCs ONLY there…Is there some way to achieve that? I’m kinda lost on this…

Maybe you can show me how to enable them only there with your IHateAI script, or tell me some resource to spawn NPCs in that area that won’t get deleted by your script?

Thanks In Advance

Hey, there is no way that you can do this by altering the script to allow peds to spawn in a specific area (well this is kind of a lie, there is a way, but it would be messier than what I’m about to describe). However I will clarify that the script only prevents peds from spawning, and you could make your own script that checks to see if a player is in that given area and manually spawn your own peds with that script.

Unfortunately I don’t know of any resources out there that will do this, but I have found a post that details spawning a ped and getting them to do a particular action once they have spawned, hopefully you can take what you need from it to get what you’re looking for

1 Like

Will Try your script and mess around a little with the one suggested, Thank you very much for the quick and usefull reply.

1 Like