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.

Method to get suspect LVehicle reference during traffic stop?

Featured Replies

I'd like to make a plugin that lets you call in peds' IDs during a traffic stop from inside your car, with more detailed information that just number of citations and active warrants. Some basic randomly chosen charges is the plan for now.

 

I've been looking through the API reference and I've found IsPlayerPerformingPullover, but I haven't found anything to get the currently stopped vehicle or ped. Is there any way to get a reference to either one of those?

I really think that the way you can do that is getting the vehicle by the position ahead of your car as they always will be there...

[sharedmedia=downloads:files:6360]

  • Management Team

The current API does not allow you to explicitly retrieve the vehicle being pulled over, but the way alexslx suggested should work out. Let me know if you want the functionality being incorporated into the next release.

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

  • Author

Thanks for the replies, I'll go ahead and do it that way then. Would the Vehicle returned by SHDN cast to LVehicle and reference the same instance the pullover script is using? I want to be sure I will have the correct instance so the ID my script uses is the same ID the ped gives the player.

 

LMS, what would be the possibility of getting a traffic stop/on foot ID check to fire an event that provides the PersonaData in a list? I could just hook a handler to it and not worry about the vehicle, and use it as a way to know if the player has actually checked for IDs or not.

  • Management Team

Thanks for the replies, I'll go ahead and do it that way then. Would the Vehicle returned by SHDN cast to LVehicle and reference the same instance the pullover script is using? I want to be sure I will have the correct instance so the ID my script uses is the same ID the ped gives the player.

 

LMS, what would be the possibility of getting a traffic stop/on foot ID check to fire an event that provides the PersonaData in a list? I could just hook a handler to it and not worry about the vehicle, and use it as a way to know if the player has actually checked for IDs or not.

 

I'll see what I can do.

 

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

  • Management Team

Are you okay with something like this?

                if (Functions.IsPlayerPerformingPullover())
                {
                    LHandle pullover = Functions.GetCurrentPullover();
                    if (pullover != null)
                    {
                        LVehicle vehicle = Functions.GetPulloverVehicle(pullover);
                        if (vehicle != null && vehicle.Exists())
                        {
                            vehicle.AttachBlip().Color = BlipColor.Cyan;
                            if (vehicle.HasDriver)
                            {
                                LPed driver = vehicle.GetPedOnSeat(VehicleSeat.Driver);
                                if (driver != null && driver.Exists())
                                {
                                    string name = driver.PersonaData.FullName;
                                    Functions.PrintText("--- Pulling over: " + name + " ---", 10000);

                                    // Looking up the driver will make the vehicle explode.
                                    Functions.PedLookedUpInPoliceComputer += delegate(PersonaData data)
                                        {
                                            if (data.FullName == name)
                                            {
                                                DelayedCaller.Call(parameter => vehicle.Explode(), this, Common.GetRandomValue(5000, 10000));
                                            }
                                        };
                                }
                            }
                        }
                    }
                }

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

  • Author

 

Are you okay with something like this?

                if (Functions.IsPlayerPerformingPullover())
                {
                    LHandle pullover = Functions.GetCurrentPullover();
                    if (pullover != null)
                    {
                        LVehicle vehicle = Functions.GetPulloverVehicle(pullover);
                        if (vehicle != null && vehicle.Exists())
                        {
                            vehicle.AttachBlip().Color = BlipColor.Cyan;
                            if (vehicle.HasDriver)
                            {
                                LPed driver = vehicle.GetPedOnSeat(VehicleSeat.Driver);
                                if (driver != null && driver.Exists())
                                {
                                    string name = driver.PersonaData.FullName;
                                    Functions.PrintText("--- Pulling over: " + name + " ---", 10000);

                                    // Looking up the driver will make the vehicle explode.
                                    Functions.PedLookedUpInPoliceComputer += delegate(PersonaData data)
                                        {
                                            if (data.FullName == name)
                                            {
                                                DelayedCaller.Call(parameter => vehicle.Explode(), this, Common.GetRandomValue(5000, 10000));
                                            }
                                        };
                                }
                            }
                        }
                    }
                }

 

Yes that would work perfectly, thank you!

 

 

Are you okay with something like this?

                if (Functions.IsPlayerPerformingPullover())
                {
                    LHandle pullover = Functions.GetCurrentPullover();
                    if (pullover != null)
                    {
                        LVehicle vehicle = Functions.GetPulloverVehicle(pullover);
                        if (vehicle != null && vehicle.Exists())
                        {
                            vehicle.AttachBlip().Color = BlipColor.Cyan;
                            if (vehicle.HasDriver)
                            {
                                LPed driver = vehicle.GetPedOnSeat(VehicleSeat.Driver);
                                if (driver != null && driver.Exists())
                                {
                                    string name = driver.PersonaData.FullName;
                                    Functions.PrintText("--- Pulling over: " + name + " ---", 10000);

                                    // Looking up the driver will make the vehicle explode.
                                    Functions.PedLookedUpInPoliceComputer += delegate(PersonaData data)
                                        {
                                            if (data.FullName == name)
                                            {
                                                DelayedCaller.Call(parameter => vehicle.Explode(), this, Common.GetRandomValue(5000, 10000));
                                            }
                                        };
                                }
                            }
                        }
                    }
                }

 

Looks good, my suggestions:

1) Make possible to modify the information before the player check the ID? so we can integrate other plugins with pullovers?

2) Make possible to disable pullovers (Functions.PlayerTogglePullovers(true/false)) -> I'm very bad with functions names.

[sharedmedia=downloads:files:6360]

  • Author

2) Make possible to disable pullovers (Functions.PlayerTogglePullovers(true/false)) -> I'm very bad with functions names.

 

I have no idea how reliable it would be, but could you use something like this in the script's Process()?

if(Functions.IsPlayerPerformingPullover() && bArePulloversDisabled)
    Functions.ForceEndPullover();

Setting bArePulloversDisabled = true whenever you'd want to "disable" them, and false otherwise?

I have no idea how reliable it would be, but could you use something like this in the script's Process()?

if(Functions.IsPlayerPerformingPullover() && bArePulloversDisabled)
    Functions.ForceEndPullover();

Setting bArePulloversDisabled = true whenever you'd want to "disable" them, and false otherwise?

 

A global setting will be good, but I really think disabling pullover in a specific vehicle sounds good. For example, having a friend's (with a friendly ped) vehicle or something like that. Maybe checking if the vehicle driver have the group cop or the group special with the relationship "friendly" with cops solve that problem.

[sharedmedia=downloads:files:6360]

  • Management Team

Looks good, my suggestions:

1) Make possible to modify the information before the player check the ID? so we can integrate other plugins with pullovers?

2) Make possible to disable pullovers (Functions.PlayerTogglePullovers(true/false)) -> I'm very bad with functions names.

 

Sure.

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.