Jump to content
The latest updated version of RAGE Plugin Hook, required to play LSPDFR, can be found inside the LSPDFR download. It is not currently available on the RAGE Plugin Hook website.

[Addon Vehicles][Scripting][Solved]Make add-on police cars work in LSPDFR


Crowmedic

Recommended Posts

I have a custom pack that I've made which contains various add-on vehicles. My question is, what is required to make AI recognize your vehicle as a police car in order to initiate pullovers? In my meta files, I have the following settings:
 - Vehicles.meta has the flags FLAG_LAW_ENFORCEMENT and FLAG_EMERGENCY_SERVICE set for each vehicle
 - Carvariations.meta has <lightSettings value="1" /> and <sirenSettings value="1" /> for each vehicle as well
I also have replaced the vanilla vehicles and they are able to initiate pullovers just fine. Is there something I am missing?

EDIT: I've also confirmed through the RPH console using "Get Game.LocalPlayer.Character.IsInAnyPoliceVehicle();" and "Get Game.LocalPlayer.Character.CurrentVehicle.IsPoliceVehicle;" which both is returning True, which to me indicates that the game is at least seeing it as a police vehicle. However turning lights and sirens on does not prompt AI drivers to react appropriately, such as moving out the way of the vehicle

SOLVED: I figured out that while I had a carvariations.meta file in the mod, it was not listed in the contents.xml file for that mod. This was causing the data to not be added and resulted in the vehicles not having sirens in the base game. I run ELS and that threw me off the scent because ELS will play sirens even if the vehicle doesn't have sirens. I figured it out when "Vehicle.hasSiren" (Or whatever the method is) would return false on the vehicle. Once I found the error in content.xml, the vehicles in question began to operate properly: they could perform pullovers and traffic reacted appropriately to their sirens.

Edited by Crowmedic
Solved Problem
Link to comment
Share on other sites

  • Management Team

We use Game.LocalPlayer.Character.IsInAnyPoliceVehicle to determine whether the car you are in can be used to start a pullover. If that evaluates to true, there should be no issue at least for LSPDFR.

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

Link to comment
Share on other sites

Upon further changes to my DLC.rpf, I moved the files around, assuming I may have had them in the wrong place. I'm now able to get the cars to blip a target vehicle, however, when toggling the siren on, I do not get the prompt that the vehicle has been signaled, and the target vehicle continues along its normal pathing, I'm assuming waiting for me to activate my siren. When tested against my other replacement vehicles, they perform as expected. Vehicles on road still do not react to lights/siren when activated and continue as though no emergency vehicle is present.

Edited by Crowmedic
Link to comment
Share on other sites

  • The title was changed to [Addon Vehicles][Scripting][Solved]Make add-on police cars work in LSPDFR
You should only reply here to ask for more information from Crowmedic or to answer the person's issue.

Reply to this thread only to offer help or assistance to Crowmedic.
If you want support, create your own thread in the appropriate forum. Non-relevant replies, derailing posts, "me too", disinformation and other support requests will be removed without warning.

Guest
You can no longer reply to this support topic as it was started over a year ago. Please make a new thread.


×
×
  • Create New...