Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flipvehicle to smallresources #54

Open
artur-michalak opened this issue Apr 20, 2024 · 0 comments
Open

Flipvehicle to smallresources #54

artur-michalak opened this issue Apr 20, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@artur-michalak
Copy link
Contributor

artur-michalak commented Apr 20, 2024

The problem

It would be nice if the radialmenu:flipVehicle event was included in smallresources.
This makes more sense than keeping it in the radialmenu.
The event can be called flipVehicle:client:flip or qbx_smallresources:client:flip.

Ideal solution

--- [qbx]/qbx_smallresources/client/flipvehicle.lua
local config = require 'config.client'

RegisterNetEvent('flipVehicle:client:flip', function()
    if cache.vehicle then return end
    local coords = GetEntityCoords(cache.ped)
    local vehicle = lib.getClosestVehicle(coords)
    if not vehicle then return exports.qbx_core:Notify(locale('error.no_vehicle_nearby'), 'error') end
    if lib.progressBar({
        label = locale('progress.flipping_car'),
        duration = config.flipTime,
        useWhileDead = false,
        canCancel = true,
        disable = {
            move = true,
            car = true,
            mouse = false,
            combat = true
        },
        anim = {
            dict = 'mini@repair',
            clip = 'fixing_a_ped'
        },
    })
    then
        SetVehicleOnGroundProperly(vehicle)
        exports.qbx_core:Notify(locale('success.flipped_car'), 'success')
    else
        exports.qbx_core:Notify(locale('error.cancel_task'), 'error')
    end
end)

Alternative solutions

No response

Additional context

No response

@artur-michalak artur-michalak added the enhancement New feature or request label Apr 20, 2024
@qbox-duck qbox-duck bot added this to Issues Apr 20, 2024
@github-project-automation github-project-automation bot moved this to Todo in Issues Apr 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Todo
Development

No branches or pull requests

1 participant