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.

[Solved] Set a ped as the vehicle owner / contraband

Featured Replies

  • Community Team

Looking through the API the only thing I found was this:

Functions.SetVehicleOwnerName(cVehicle, Functions.GetPersonaForPed(Victim).FullName);

It does not appear to work when tested in game. I'm not sure how others are doing it, as when I looked at open source projects there was nothing set.

 

And since i'm here I have the same issue with adding drugs to a ped using:

Functions.AddPedContraband(pedMan, ContrabandType.Narcotics, "COCAINE");

Which I also found in the API. 

Edited by SuperPyroManiac
Solved

  • Management Team
On 8/19/2019 at 9:41 PM, SuperPyroManiac said:

Looking through the API the only thing I found was this:


Functions.SetVehicleOwnerName(cVehicle, Functions.GetPersonaForPed(Victim).FullName);

It does not appear to work when tested in game. I'm not sure how others are doing it, as when I looked at open source projects there was nothing set.

 

And since i'm here I have the same issue with adding drugs to a ped using:


Functions.AddPedContraband(pedMan, ContrabandType.Narcotics, "COCAINE");

Which I also found in the API. 

 

Thanks for your report! I will have a look at those functions and report back.

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
On 8/19/2019 at 9:41 PM, SuperPyroManiac said:

Looking through the API the only thing I found was this:


Functions.SetVehicleOwnerName(cVehicle, Functions.GetPersonaForPed(Victim).FullName);

It does not appear to work when tested in game. I'm not sure how others are doing it, as when I looked at open source projects there was nothing set.

 

And since i'm here I have the same issue with adding drugs to a ped using:


Functions.AddPedContraband(pedMan, ContrabandType.Narcotics, "COCAINE");

Which I also found in the API. 

 

I just tested it on my end, both functions work fine for me. Here is the code I used:

 

Ped victim = new Ped(Game.LocalPlayer.Character.GetOffsetPositionFront(5));
Vehicle vehicle = new Vehicle(victim.GetOffsetPositionFront(5));
API.Functions.SetVehicleOwnerName(vehicle, API.Functions.GetPersonaForPed(victim).FullName);
API.Functions.AddPedContraband(victim, ContrabandType.Narcotics, "COCAINE");

 

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

  • Author
  • Community Team

Interesting, i'm using the latest versions of RPH and LSPDFR. both API and in game. My callouts have no errors or warnings with the functions yet when I run the plates or search (Default LSPDFR and also other plugins such as police radio) it shows a different owner than the ped, and drugs don't show at all. Using it the same way to showed as above.

 

 

            cVehicle = new Vehicle(VehicleModels[new Random().Next(VehicleModels.Length)], SpawnPoint);
            cVehicle.IsPersistent = true;
            cVehicle.EngineHealth = 0;
            cVehicle2 = new Vehicle(VehicleModels[new Random().Next(VehicleModels.Length)], cVehicle.GetOffsetPosition(new Vector3(0, 7.0f, 0)));
            cVehicle2.IsPersistent = true;
            cVehicle2.EngineHealth = 0;
            cVehicle2.Rotation = new Rotator(0f, 0f, 180f);
            CustomScenes.SimpleFunctions.Damage(cVehicle, 200, 200);
            CustomScenes.SimpleFunctions.Damage(cVehicle2, 200, 200);
            Victim = cVehicle.CreateRandomDriver();
            Victim.IsPersistent = true;
            Victim.BlockPermanentEvents = true;
            Victim2 = cVehicle2.CreateRandomDriver();
            Victim2.IsPersistent = true;
            Victim2.BlockPermanentEvents = true;
            Victim.Tasks.LeaveVehicle(cVehicle, LeaveVehicleFlags.LeaveDoorOpen);
            Victim2.Tasks.LeaveVehicle(cVehicle2, LeaveVehicleFlags.LeaveDoorOpen);
            Victim.Health = 200;
            Victim2.Health = 200;
            Functions.SetVehicleOwnerName(cVehicle, Functions.GetPersonaForPed(Victim).FullName);
            Functions.SetVehicleOwnerName(cVehicle2, Functions.GetPersonaForPed(Victim2).FullName);

Entire callout is here: https://github.com/SuperPyroManiac/SuperCallouts/blob/master/SuperCallouts/Callouts/CarAccident2.cs

(This is near line 100)

 

I just find it confusing because your method is the exact same other than I have extra properties setup as well but that shouldn't make a different? should it?

As for the drugs, I have the exact same function used in my mafia callout yet, no drugs. 

Functions.AddPedContraband(MafiaDudes1, ContrabandType.Narcotics, "COCAINE");

 

Either way I appropriate the help.

  • Management Team
On 8/26/2019 at 10:47 PM, SuperPyroManiac said:

Interesting, i'm using the latest versions of RPH and LSPDFR. both API and in game. My callouts have no errors or warnings with the functions yet when I run the plates or search (Default LSPDFR and also other plugins such as police radio) it shows a different owner than the ped, and drugs don't show at all. Using it the same way to showed as above.

 

Entire callout is here: https://github.com/SuperPyroManiac/SuperCallouts/blob/master/SuperCallouts/Callouts/CarAccident2.cs

(This is near line 100)

 

I just find it confusing because your method is the exact same other than I have extra properties setup as well but that shouldn't make a different? should it?

As for the drugs, I have the exact same function used in my mafia callout yet, no drugs. 

Functions.AddPedContraband(MafiaDudes1, ContrabandType.Narcotics, "COCAINE");

 

Either way I appropriate the help.

 

I just copied your code and ran it as an external callout and it works fine. The ped names match the vehicle records. How are you loading your callout?

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

  • Author
  • Community Team
3 hours ago, LMS said:

 

I just copied your code and ran it as an external callout and it works fine. The ped names match the vehicle records. How are you loading your callout?

Now that just boggles my mind.

 

I just use a main.cs that I learned from Albo's tutorials.

https://github.com/SuperPyroManiac/SuperCallouts/blob/master/SuperCallouts/Main.cs

 

The difference is I have settings.cs return a bool for each callout in the ini file. Then when I go to enable to callout I have it check the bool first.

if (Settings.CarAccident) { Functions.RegisterCallout(typeof(Callouts.CarAccident)); Game.LogTrivial("SuperCallouts: CarAccident Enabled"); }

 

  • Management Team
On 8/28/2019 at 7:45 PM, SuperPyroManiac said:

Now that just boggles my mind.

 

I just use a main.cs that I learned from Albo's tutorials.

https://github.com/SuperPyroManiac/SuperCallouts/blob/master/SuperCallouts/Main.cs

 

The difference is I have settings.cs return a bool for each callout in the ini file. Then when I go to enable to callout I have it check the bool first.


if (Settings.CarAccident) { Functions.RegisterCallout(typeof(Callouts.CarAccident)); Game.LogTrivial("SuperCallouts: CarAccident Enabled"); }

 

 

Nothing unusual, it should work. You place your callout in plugins/lspdfr right?

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

  • Author
  • Community Team
9 hours ago, LMS said:

 

Nothing unusual, it should work. You place your callout in plugins/lspdfr right?

 

I re-created my project, and just copy and pasted all of the classes over, and that fixed it. This makes no sense to me but either way it works now. So strange, thank you for the help though.

  • Management Team
8 hours ago, SuperPyroManiac said:

 

I re-created my project, and just copy and pasted all of the classes over, and that fixed it. This makes no sense to me but either way it works now. So strange, thank you for the help though.

 

Good to hear you got it working at least!

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.