Skip to content
This repository has been archived by the owner on Jan 6, 2021. It is now read-only.

Error when collect #2

Open
DioneB opened this issue Oct 17, 2018 · 3 comments
Open

Error when collect #2

DioneB opened this issue Oct 17, 2018 · 3 comments

Comments

@DioneB
Copy link

DioneB commented Oct 17, 2018

if I use the command and another player collects the box he does not receive any weapons

@Vechro
Copy link
Owner

Vechro commented Oct 17, 2018

I haven't dealt with FiveM at all recently but I'll probably look into it either the coming weekend or next week.

@DioneB
Copy link
Author

DioneB commented Oct 17, 2018

Okay Bro, Thanks, i'm busy here too, but I will try to find a solution later, if I find the solution I send a PR here in the repo

@Vechro
Copy link
Owner

Vechro commented Nov 8, 2018

Hey, I know it's a little late but I looked into it and there doesn't seem to be an easy way of fixing this. I'll write up some of the stuff I tried for future reference, maybe you can figure all this out.

I tried not adding any weapons in the CreateAmbientPickup at all and then listening for the CEventNetworkPlayerCollectedAmbientPickup event to maybe somehow give the player the weapon they requested for through the event handler, if you clicked the link you'll see that it doesn't give you the pickup ID unlike CEventNetworkPlayerCollectedPickup right above it (I wasn't aware of this beforehand, I documented the event as I was testing) so I can't tie a pickup event with a cratedrop request, essentially meaning that I won't know which pickup the player picked up if there are multiple pickups on the ground.

The reason I'm using CreateAmbientPickup instead of CreatePickup is because when I tried the latter it refused to obey the laws of gravity (it's not cratedrop if the crate won't drop), it was just stuck midair with no way of activating its physics and I didn't find a better native for creating a pickup (further evidenced by the fact that CreateAmbientPickup is also used by Rockstar in am_ammo_drop.c script)

I also tried removing the weapon case model and using the default weapon model, because through testing I discovered that it synced between players without any work on my side (one person created the pickup and another player picked it up without issues). When I applied this to cratedrop it turned out the pickups break when I attach the crate and parachute to them (worked fine with the weapon case), you could see the pickup but you were unable to pick it up, you just walked over it without anything happening. Doing this without any AttachEntityToEntity natives also isn't ideal.

I hope all of this helps. I might keep trying but for now I didn't figure out a way of doing it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants