Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

Collision when entering vehicle #27

Open
Llama-Palooza opened this issue Jun 19, 2024 · 8 comments
Open

Collision when entering vehicle #27

Llama-Palooza opened this issue Jun 19, 2024 · 8 comments

Comments

@Llama-Palooza
Copy link

Just like most weapons on back resources, back packs can sometimes cause collision issues when entering vehicles, causing it to tornado like crazy. The fix for this is simple. Add an export to remove/add bags that we can add to the event handler for entering a vehicle.

@swkeep
Copy link
Owner

swkeep commented Jun 21, 2024

It's technically disabled it, but I guess it's not disabled for other players

https://github.com/swkeep/keep-bags/blob/main/client/clothing.lua#L70

@Llama-Palooza
Copy link
Author

It's technically disabled it, but I guess it's not disabled for other players

https://github.com/swkeep/keep-bags/blob/main/client/clothing.lua#L70

Ya, I saw that too, but it seems the collisions get enabled again sometimes. Any chance of an export to remove and add bags back that we can utilize? That way when anyone gets in a vehicle, they bags get removed and then are added again when they exit a vehicle.

@swkeep
Copy link
Owner

swkeep commented Jun 24, 2024

I created an active thread (aedf43b) to check for vehicles, but I think I need to do more to ensure they don't spawn within that 250ms window :)

@Llama-Palooza
Copy link
Author

I will add that and test. Thank you for the update.

@Llama-Palooza
Copy link
Author

Llama-Palooza commented Jun 25, 2024

I created an active thread (aedf43b) to check for vehicles, but I think I need to do more to ensure they don't spawn within that 250ms window :)

So I use this event for removing weapons on players back and re-adding them, it seems to work just fine. I'm thinking this may be better to use than the while true loop, any thoughts? Obviously this is for a qb server.

EDIT
This seems to be working fine for me. I'm not sure if it's better than the while true loop, but it is working and I haven't had an issue yet.

RegisterNetEvent('QBCore:Client:VehicleInfo', function(data)
    if data.event == "Entered" then
        BodyAttachment:clearAll()      
    elseif data.event == "Left" then
        Load()
    end
end)```

@Llama-Palooza
Copy link
Author

I created an active thread (aedf43b) to check for vehicles, but I think I need to do more to ensure they don't spawn within that 250ms window :)

So I use this event for removing weapons on players back and re-adding them, it seems to work just fine. I'm thinking this may be better to use than the while true loop, any thoughts? Obviously this is for a qb server.

EDIT This seems to be working fine for me. I'm not sure if it's better than the while true loop, but it is working and I haven't had an issue yet.

RegisterNetEvent('QBCore:Client:VehicleInfo', function(data)
    if data.event == "Entered" then
        BodyAttachment:clearAll()      
    elseif data.event == "Left" then
        Load()
    end
end)```

This seems to work really well so far and haven't had issues as of yet.

@swkeep
Copy link
Owner

swkeep commented Jul 4, 2024

Thank you for the information
However, my script needs to work in ESX as well, so I can't directly use it
I will probably make a bridge within my Harmony to allow it to use both events
https://github.com/esx-framework/esx_core/blob/c80916c3e3b14e3cfce6102801b382e59c49bd27/%5Bcore%5D/es_extended/client/modules/actions.lua#L70

@Llama-Palooza
Copy link
Author

Llama-Palooza commented Jul 4, 2024 via email

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