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.

Is there a way to turn on vehicle's hazard lights?

Featured Replies

Hi, I'm developing a callout pack for lspdfr and I'm looking a way to turn on a vehicle's hazard lights or indicators. I don't care if I have to use another API that is not rageplugin or lspdfr api. Thank you.

Edited by mmods
I forgot to write a word.

  • Author
6 hours ago, willpv23 said:

I imagine you would call this native:

 

image.png

Thanks but how can I implement this on my script?

RAGEPluginHook also exposes this native directly within the Vehicle class. You can use:

 

https://docs.ragepluginhook.net/html/P_Rage_Vehicle_IndicatorLightsStatus.htm

 

To set both lights as visible, use VehicleIndicatorLightsStatus.Both. As far as I know, GTA V does not have a native hazard light function, so you'd have to process this between VehicleIndicatorLightsStatus.None and VehicleIndicatorLightsStatus.Both to create the effect that the lights are flashing.

Edited by liverlande

  • Author
1 hour ago, liverlande said:

RAGEPluginHook also exposes this native directly within the Vehicle class. You can use:

 

https://docs.ragepluginhook.net/html/P_Rage_Vehicle_IndicatorLightsStatus.htm

 

To set both lights as visible, use VehicleIndicatorLightsStatus.Both. As far as I know, GTA V does not have a native hazard light function, so you'd have to process this between VehicleIndicatorLightsStatus.None and VehicleIndicatorLightsStatus.Both to create the effect that the lights are flashing.

Thanks for the support. I have tried this and it worked for me.

NativeFunction.CallByName<uint>("SET_VEHICLE_INDICATOR_LIGHTS", vehicle1, 0, true);
NativeFunction.CallByName<uint>("SET_VEHICLE_INDICATOR_LIGHTS", vehicle1, 1, true);

 

please stop using NativeFunction.CallByXYZ as it causes performance issues, use NativeFunction.Natives.NATIVE_NATIVE instead.

  • Management Team
27 minutes ago, NoNameSet said:

please stop using NativeFunction.CallByXYZ as it causes performance issues, use NativeFunction.Natives.NATIVE_NATIVE instead.

 

I'm not sure where you got that information, but it is not true. The fastest way to call a native is calling it by hash, as that removes the overhead from converting from a string to a hash first. CallByName will also still be faster than using Natives as there is no runtime binding. I am not saying that the differences are big (they are in fact almost non-existent), but dynamic invocation will always be the slowest just due to the nature of how it works. It's the same as having a static call or a VTable call, of course there is no big difference, but ultimately the indirection will cost you a few cycles.

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

1 hour ago, NoNameSet said:

please stop using NativeFunction.CallByXYZ as it causes performance issues, use NativeFunction.Natives.NATIVE_NATIVE instead.

 

38 minutes ago, LMS said:

 

I'm not sure where you got that information, but it is not true. The fastest way to call a native is calling it by hash, as that removes the overhead from converting from a string to a hash first. CallByName will also still be faster than using Natives as there is no runtime binding. I am not saying that the differences are big (they are in fact almost non-existent), but dynamic invocation will always be the slowest just due to the nature of how it works. It's the same as having a static call or a VTable call, of course there is no big difference, but ultimately the indirection will cost you a few cycles.

 

I agree with LMS.

 

I believe when we call "NativeFunction.Natives.NATIVE_NATIVE", it will call "NativeFunction.CallByHash" at the end, because all those native functions are represented by HASHES in the lower level.

 

And I also believe that RPH has a map that convert a native names into hashes.

 

If we talk about the best performance, I think ""NativeFunction.CallByHash" is the best one.

 

 

Edited by Pazzi

36 minutes ago, LMS said:

 

I'm not sure where you got that information, but it is not true. The fastest way to call a native is calling it by hash, as that removes the overhead from converting from a string to a hash first. CallByName will also still be faster than using Natives as there is no runtime binding. I am not saying that the differences are big (they are in fact almost non-existent), but dynamic invocation will always be the slowest just due to the nature of how it works. It's the same as having a static call or a VTable call, of course there is no big difference, but ultimately the indirection will cost you a few cycles.

weird, I remember something being said that it was causing fps issues a while ago. 

Anyway glad it's fine and thanks for the info, truly thought there was an issue with it though.

  • Management Team
12 minutes ago, Pazzi said:

I believe when we call "NativeFunction.Natives.NATIVE_NATIVE", it will call "NativeFunction.CallByHash" at the end, because all those native functions are represented by HASHES in the lower level.

 

And I also believe that RPH has a map that convert a native names into hashes.

 

That is correct. It works like this Dynamic -> Name -> Hash -> Address. Ultimately you want to call the address. So if you call with a hash already you can skip the first two lookup stages.

 

11 minutes ago, NoNameSet said:

weird, I remember something being said that it was causing fps issues a while ago. 

Anyway glad it's fine and thanks for the info, truly thought there was an issue with it though.

 

No problem, most of the time FPS issues come from calling an expensive native way too often. 

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.