Skip to content
View in the app

A better way to browse. Learn more.

LCPDFR.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Reduce vehicle spawning around player via API

Featured Replies

Hi everyone,

 

Is there a way to reduce vehicle spawning around the player via the API? Something similar to "Chase.TrafficDensityMultiplier" in lspdfr.ini which sets the traffic density multiplier during chases.

 

I would like to create a plugin that lets me change traffic density at will for those times when you just don't want much traffic around you during certain callout situations. The immersion and realism goes down the drain when you're at an accident scene for example and the coroner or ambulance just picked up a body and then proceeds to crash into several vehicles before finally being able to get on its way 😛

 

Or maybe there is a trainer command that can achieve the same result?

  • Author
On 1/15/2022 at 9:43 AM, LMS said:

This is not exposed via the API, but you can look into the density natives or model budget (very effective but less granular).

Thank you very much for that information!

 

Would you be willing to give me some tips as to how I would use either one of these options? I have found:

SET_VEHICLE_DENSITY_MULTIPLIER_THIS_FRAME(float multiplier)

and:

SET_VEHICLE_POPULATION_BUDGET(int budget)

Those two seem to be the most likely options but I must admit that I'm not sure how to use them exactly.

 

To be more clear, I know C# (not on a professional level though) so I am familiar with calling functions etc...I'm just not sure how to code this as a .dll for use with LSPDFR.

 

I have gone through the basic callout creation tutorial but this is obviously not going to be a callout plugin.

 

Thank you again!

  • Management Team

If you do not want to make this a callout plugin, you should look into creating RAGE Plugin Hook plugins. It comes with a plethora of examples and documentation to help get you started. It is also the same framework LSPDFR uses.

 

For those two natives, the first - as evident by the name - needs to be called per frame (that is, each tick) - in order to have an effect. Common ranges are 0.0 - 1.0 (default). The second native I think takes four different levels (might be more) where 0 indicates no traffic at all and I think 3 is the default setting. This is a permanent change and only needs to be called once.

Please do not PM me unless really necessary (knowing you helps). If you think you need my attention in a topic, tag me.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.