The method I am currently using to disable AI in my server can be seen in the following image
However the issue I have with this is that it does not work perfectly! Every so often I will spot the odd vehicle, or the odd pedestrian or the odd parked car. For the nature of the server I am trying to create I cannot have this happen at all.
Yes for the most part it does the job, however it doesn’t take long at all before you see something
As shown here:
Is the loop you’re calling it in set ‘fast enough’?
Since if the loop might not be ‘fast enough’ it might not work as desired if I follow what’s said on the Natives page of FiveM (that it should be in a loop), and since it also is called… ThisFrame, i suppose it should be called faster?
“A bit of topic”, So many years we’ve/i’ve played on SA-MP (old San Andreas) server where we went trough INSANE extends with making bots manually to make the server look alive, and here i keep seeing people asking on how to disable AI and ‘the alive world’
Hmm i’ve just read your post on another topic where you say it happens (more frequently) around car parks?
My theory is that those are vehicle generators (either from a script or game (suspect the latter though)), and that PED’s a re ‘spawned into them’ due to the game/script activating the vehicle(s), using the ‘instructions’ set in the vehicle meta files (which tell the game which drivers can drive it).
You can do it in two ways to get it all out of the game, one is to make a ‘scanner’ with a radius to detect peds in for example a radius of about 100 around you and ‘delete detected peds’ (CHECK IF THEY ARE NOT PLAYERS OF COURSE! ).
Another option which happened ON ACCIDENT when i ‘fucked up big time’ when i was ADDING peds and vehicles to my server to spawn in the normal cycle is to ‘mess with’ the popcylce.dat (from the original game) and stream that one as popcycle.meta.
When i ‘fucked up’ one small part in that one, it was litterally enough to disable ALL traffic haha so i bet ‘tuning it’ to your needs will give you the option to ‘destroy all population’ like a ‘mad scientist’ (sorry could not resist haha)
BUT keep in mind: Doing it with streamed files like popcycle will NOT give you the
ability to ‘re-enable’ it script wise though (if you want to be able to toggle it on and off)
Yeah that about what i meant indeed, (not fully 'up to speed" with GTA V and all the event names in it (and FiveM yet), but do remember such events from IV to indeed).
Suspect that if he investigates the use of popcycle PROPERLY haha that he will be able to get rid of nearly (if not) all peds and vehicles.
I accidentally messed up some line breaks and reverted since i didn’t care about ‘no traffic’ so didn’t looked into it further, but my game was ‘completly dead of peds’ though haha
The loop I had the two functions in were running in Citizen.Wait(0), couldn’t make it any faster if I tried safely.
The radius idea could work quite well actually thinking about it and would prevent the need to mess around with the popcycle.
My goal is to remove all traffic and all AI entirely, I’m not fussed about the option to re-enable it via a script as I just need it gone.
Im not sure I quite understand what is meant by the SetRandomEventFlag() and GetRandomEventFlag natives, would I just SetRandomFlag(false) and hope that works?
This indeed… BUT! keep in mind: that if you are in ‘bad luck’ and a “public helicopter spawns” at the airport… you remove/delete the pilot… well figure out the rest
Just try indeed the randomflag tip from faxes, and see how that responds (just like he said: only need to set it once)
EDIT: ALTOUGH thinking about "old memories’… In GTA IV i’ve had the issue that some flags would ‘auto reset’ if you entered a new zone for example! Not sure AT ALL how GTA V handles this though.
I’ve come up with an idea, its crazy, but its fool proof, I’m gonna write a quick C# program to read the contents of scenarios.meta for me, its going to give me every name of each scenario, and I will just disable all of them, no need for ped density or nothing then
Euhm… not 100% certain of that is a ‘completely good idea’
I know for example that I also call quite some scenario’s for animations i use, and some scenario’s are also used in game for the player and i’m not 100% sure if that would affect the player (on for example entering/leaving’ the vehicle)
It sounds like an insane solution, but i’m definitly interested what happens hahahahah
(If it causes a "meltdown’ please tell me