keep-bags icon indicating copy to clipboard operation
keep-bags copied to clipboard

Collision when entering vehicle

Open Llama-Palooza opened this issue 1 year ago • 8 comments

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.

Llama-Palooza avatar Jun 19 '24 18:06 Llama-Palooza

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

swkeep avatar Jun 21 '24 08:06 swkeep

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.

Llama-Palooza avatar Jun 21 '24 16:06 Llama-Palooza

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

swkeep avatar Jun 24 '24 19:06 swkeep

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

Llama-Palooza avatar Jun 24 '24 22:06 Llama-Palooza

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 avatar Jun 25 '24 14:06 Llama-Palooza

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.

Llama-Palooza avatar Jul 03 '24 20:07 Llama-Palooza

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

swkeep avatar Jul 04 '24 07:07 swkeep

I believe there is a baseevents for entering a vehicle as well, I'll check when I get home.

On Thu, Jul 4, 2024, 3:48 AM swkeep @.***> wrote:

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

— Reply to this email directly, view it on GitHub https://github.com/swkeep/keep-bags/issues/27#issuecomment-2208331233, or unsubscribe https://github.com/notifications/unsubscribe-auth/A5V6JSKVVLUXMYJ37LJQCW3ZKT45NAVCNFSM6AAAAABJSR2YUWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMBYGMZTCMRTGM . You are receiving this because you authored the thread.Message ID: @.***>

Llama-Palooza avatar Jul 04 '24 13:07 Llama-Palooza