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.

Interacting with drug packages

Featured Replies

Hello there.

 

Sometimes when you frisk a ped, a drug package spawns in front of him. I try to add a feature to my mod, which lets the player decide if he wants to register it or just take and sell it later (as it was possible in True Crime).

 

Here my problem: The player seems to be able to collect those packages (which use the model PROP_DRUG_PACKAGE_02), but until now I'm unable to find any further information about it anywhere. 

 

Where is the information about drug packages stored? It doesn't seem to be accessible in a managed way. I could neither find information about it in the ped object of the ped who dropped it, nor in the ped object of the player who collected it. It also doesn't seem related to the contraband collection, even though it can contain drugs too. But they won't cause a drug package to spawn when frisking their owner.

 

A workaround would be to monitor all nearby objects and if there is a drug package, the player crosses it's position and it disappears, to register it as a collected package on my own. But this would be a hack and I'm sure there must be a better way. Any ideas?

 

Thanks in advance!

  • Management Team

If you manually spawn the drug package model, can you still collect it? I would assume, though. Perhaps there is no record being kept and it is just how that object works.

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

  • Author
15 hours ago, LMS said:

If you manually spawn the drug package model, can you still collect it? I would assume, though. Perhaps there is no record being kept and it is just how that object works.

 

 No, when I spawn it manually, i can't collect it. There must be some separate logic handling this behavior.

  • Author

What do you mean by create a pickup with that model?

The packages dropped by suspects can already be picked up, but I just don't know what happens to them after they have been picked up. I just need to keep track of them, but they don't seem to exist before they are dropped and after they have been picked up.

On 4/16/2022 at 8:30 PM, Yosus said:

What do you mean by create a pickup with that model?

The packages dropped by suspects can already be picked up, but I just don't know what happens to them after they have been picked up. I just need to keep track of them, but they don't seem to exist before they are dropped and after they have been picked up.

Hi, what do you want to do once you've managed to keep them on you?

by Mytical.

  • Management Team
On 4/16/2022 at 2:30 PM, Yosus said:

What do you mean by create a pickup with that model?

The packages dropped by suspects can already be picked up, but I just don't know what happens to them after they have been picked up. I just need to keep track of them, but they don't seem to exist before they are dropped and after they have been picked up.

 

Sorry, I thought you were perhaps trying to recreate the effect. I do not think the information is stored anywhere, they are just custom game pickups that do not do anything. Since we do not expose the pickup handle, I think the best way would be to scan the area for objects of a known type (drug package) and then infer that the player collected them if they no longer exist.

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

  • Author
On 4/19/2022 at 6:45 PM, LMS said:

 

Sorry, I thought you were perhaps trying to recreate the effect. I do not think the information is stored anywhere, they are just custom game pickups that do not do anything. Since we do not expose the pickup handle, I think the best way would be to scan the area for objects of a known type (drug package) and then infer that the player collected them if they no longer exist.

 

Ok, thanks! That's exactly the workaround I had in mind, but I thought that maybe I missed something. I will solve it this way.

 

On 4/19/2022 at 11:14 AM, Mytical49 said:

Hi, what do you want to do once you've managed to keep them on you?

 

Do you know the game "True Crime"? In this game you were a cop too and you could frisk suspects, collect their drugs and then either bring them to the police department and get rewarded with GoodCop-XP and money (I think) or sell it to a pawn shop and get rewarded with BadCop-XP and (more) money. 
I want to create something like that.

6 minutes ago, Yosus said:

 

Ok, thanks! That's exactly the workaround I had in mind, but I thought that maybe I missed something. I will solve it this way.

 

 

Do you know the game "True Crime"? In this game you were a cop too and you could frisk suspects, collect their drugs and then either bring them to the police department and get rewarded with GoodCop-XP and money (I think) or sell it to a pawn shop and get rewarded with BadCop-XP and (more) money. 
I want to create something like that.

I see, it may be stupid but if I was you i will create a variable and when you take a drog package the variable take one and for exemple when you sell it lost one.

by Mytical.

  • Author
On 4/20/2022 at 7:04 PM, Mytical49 said:

I see, it may be stupid but if I was you i will create a variable and when you take a drog package the variable take one and for exemple when you sell it lost one.

 

Yeah, storing the information is not a problem. I just thought that this information would be stored and handled somewhere already. If that would have been the case, implementing a separate "store" would have interfered with the existing logic, as the drug package would still be in the inventory after selling it.

  • Management Team

The LSPDFR update today includes an event that is fired whenever contraband is found. The contraband class now also exposes a potential pickup object handle, if any. See: 

 

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

  • Author
14 hours ago, LMS said:

The LSPDFR update today includes an event that is fired whenever contraband is found. The contraband class now also exposes a potential pickup object handle, if any. See: 

 

 

Wow, great! Thanks!

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.