#Onx Spotlight and Ox Inventory weapon ~workaround

1 messages · Page 1 of 1 (latest)

brazen folio
#

So i wanted PD to be able to shoot from vehicles if needed, but with ONX vehicles they couldn't, due to the spotlight being registered as a weapon. So i messed a bit with inventory to allow you to use inventory weapons too.

Now this isnt 100% how i want it cause i want to be able to use the spotlight and a weapon, and this works until you pull the weapon then you lose ability to move the spotlight until you swap seats or get out and back in

but anyways this is what i did

ox_inventory/client.lua find this:

    if seat then
        local hasWeapon = GetCurrentPedVehicleWeapon(cache.ped)

        if hasWeapon then
            return Utils.WeaponWheel(true)
        end
    end

    Utils.WeaponWheel(false)
end)```


replace it with this

```lib.onCache('seat', function(seat)
    if seat then
        local hasWeapon = GetCurrentPedVehicleWeapon(cache.ped)

        if hasWeapon then
            -- Check if current vehicle model should be excluded
            local vehicle = cache.vehicle
            local model = GetEntityModel(vehicle)
            
            -- All ONX police vehicles with spotlights
            local spotlightVehicles = {
                [`onx_polalamo`] = true,
                [`onx_polgrang`] = true,
                [`onx_polgrang2`] = true,
                [`onx_polmerit`] = true,
                [`onx_polmerit3`] = true,
                [`onx_poltulip`] = true,
                [`onx_polvigero`] = true,
                [`onx_polaleu`] = true,
                [`onx_polcara`] = true,
                [`onx_poldom`] = true,
                [`onx_polmonar`] = true,
                [`onx_polsand`] = true,
                [`onx_polsandsc`] = true,
                [`onx_polsandxl`] = true,
                [`onx_polsandh`] = true,
                [`onx_polscout`] = true,
                [`onx_polscout2`] = true,
                [`onx_poltavros`] = true,
                [`onx_polbison4`] = true,
                [`onx_polbison`] = true,
                [`onx_polbison2`] = true,
                [`onx_polbison3`] = true,
                [`onx_polbuff`] = true,
                [`onx_polbuffhf`] = true,
                [`onx_poldorado2`] = true,
                [`onx_poldorado`] = true,
                [`onx_polgaunt`] = true,
                [`onx_polcava`] = true,
                [`onx_polvstr`] = true,
                [`onx_polcon`] = true,
                [`onx_polkandra`] = true,
                [`onx_polinvict`] = true,
                [`onx_polinvict2`] = true,
                [`onx_polsem`] = true,
                [`onx_polterm`] = true,
                [`onx_polterm2`] = true,
                [`onx_polregent`] = true,
                [`onx_polregentxl`] = true,
                [`onx_polstalk`] = true,
                [`onx_polverus`] = true,
                
            }
            
            -- Only enable weapon wheel if it's NOT a spotlight vehicle
            if not spotlightVehicles[model] then
                return Utils.WeaponWheel(true)
            end
        end
    end

    Utils.WeaponWheel(false)
end)```
woeful plover
#

This is great. Thanks for this, that was my only hiccup about onx vehicles.

brazen folio
#

im sure or atleast think there may be a way to work em both as that would be dope if you go spot light where you are shooting but this works

sharp shale
brazen folio
#

they are nice! if he had more civ cars i might drop gabz

woeful plover
sharp shale
#

do it daddy

woeful plover
woeful plover
#

But kuz dropped an EVC (Emergency Vehicle Creator) Can legit make ANY vehicle an emergency vehicle.

brazen folio
# wide pelican <a:GottaGo:1340241251345367111>

gabz fallin behind man, love em but no updates in a bit, i like the brighter lights from onx a bit better too, but i do like that gabz has both civ and pd cars so for now onx is our pd car gabz everything else

wide pelican
#

rewatch the onx trailer

pseudo oyster
#

Yea wiseguy is releasing civ stuff too

#

Think he partnered up with prodigy

brazen folio
#

oh im sure he will, just hasnt YET, i learned alot about vehicle tuning from his streams

pseudo oyster
#

kekw What 10min per car?

#

Had a dude claimed to be a car dev. Spent 10mins on each car and called it done. Said gtawiseguy was his mentor kekw

brazen folio
#

HAHA

pseudo oyster
#

Wiseguy spends sometimes hours on 1 car

brazen folio
#

yup

wide pelican
#

5:20 onwards

pseudo oyster
#

True those are civ vehicles

wide pelican
#

that

pseudo oyster
#

hellfire looks sick too

wide pelican
#

gabz + onx

wide pelican
pseudo oyster
#

Show me some picsss

#

Got gabz atm

#

Might go for a new sub at onx nodders

wide pelican
#

just need tp update

brazen folio
#

👀 Blue got all the leaks

wide pelican
brazen folio
#

ohhh you talking about the lightbar stuff?

#

for gabz car

wide pelican
#

yeah

#

im booting my server up for @pseudo oyster so he can see the onx cars

pseudo oyster
brazen folio
# wide pelican yeah

I need to look at that then cause the gabz light i nearly non exsistant comapare to the onx

wide pelican
#

well that will change

#

when idk

pseudo oyster
#

😮 LEAKS

wide pelican
pseudo oyster
#

Bravadooo something something 4x4

wide pelican
#

server up

#

check now

pseudo oyster
#

Fivem server list might be cooked.

brazen folio
#

soooo aside for this anyone have ideas to make both work?

shooting from vehicle and spot light?

pseudo oyster
#

So whats the issueeee sirrrrr

#

Weapon usage + spotlight?

#

Problem iss onx code is most likely escrowed. So we couldnt rebind the spotlight to keybinds. So that falls out of the selection

brazen folio
#

its not even that, the spot light is registered as a vehicle weapon.

#

so ox by default blocks you from pulling inv weapon out without the snippet above, but when i do i can move said spotlight until i change seats since it caches seat

pseudo oyster
#

Hmmmm i cant look rn im on my phone thats why

#

Gimme a sec

brazen folio
#

i think the only other thing i could do is just remove the oncache and then when you pull a gun it switches to gun aiming and when holstered it goes back to spot light

#

sorry not on cache but the check for veh weapon inside of oncache

#

so like this

lib.onCache('seat', function(seat)    
    
end)```