Npc problem

Hello, I will add it, I have a script with which you can change the density with which you want npc to appear. Both in traffic and peds. But I get ambulances, LSPDs and firefighters how can I disable them?

have a look @ https://runtime.fivem.net/doc/natives and in the input box, enter “dispatchservice”, then click on the function

EnableDispatchService(int dispatchService, bool toggle)

…with that you can enable/disable some of them.

besides, thx for the suggestion for adding a ped/traffic density entry to my menu, i almost got used to open the graphics settings for that.

1 Like

Oh thanks, where should I put it, in the script?

open the scirpt in your editor of preference (i.e. NotePadPlus for me), and assimilate it. done :slight_smile:
erm, just search for any function in the script, which starts/contains “ped”, “traffic”, “density” or something which comes into mind when working on a traffic ped script. lets say, you find the function

 SetPedDensityMultiplierThisFrame

in the script, then just copy that name-of-the-function (as i did for pasting it here), and paste that in the runtime wiki search box.
in some descriptions are some code snippets, showing where to insert certain functions - since SetPedDensityMultiplierThisFrame contains “ThisFrame”, you can depend on that it needs to be called in a looped/OnTick method, each frame.
i try to avoid these “short”-timed functions, not always successful tho, lol

1 Like

I hardly understand anything. Isn’t there any kind of video or something?

ooh, well… yes, just seach for “fivem script” in YT, and look out for a channel/guy “Jeva” - for gathering information on how all this shit is put together, these videos are a good start.
most videos are about scripting in LUA - i prefer C#, but most if not all functions are similar - once that magical click occurs to you, its rather hard to get started, we all were where you are now.

may i suggest you to lurk around here and there, read some topics which interest you, and just invest time in it. wisdom comes from failing - rinse and repeat.

oh, look what i found in another tab: Jeva - Start Somewhere in FiveM Scripting
have fun watching, i might read for some minutes on those damned navigation wheels - painful to get through…

1 Like

Thnak you <3!