📄
jaksam's scripts documentation
  • 💻jaksam's scripts
    • Home
    • How to update the scripts
    • Fix server crash on script start
    • Issues with items
    • Manually set ESX shared object
    • Common FAQ
    • Nexus Terms
    • LICENSE
  • ⚠️FiveM escrow system errors
    • Home
    • Error parsing script ... <\1>
    • Failed to verify protected resource
    • You lack the required entitlement
    • What to do if nothing is fixing the errors
  • 💼Jobs Creator
    • Home
    • Installation
    • FAQ
    • Modules
    • Replacing default scripts names
    • Replacing default events names
    • Updating script from old versions
    • QBCore Jobs Injection
    • Client
      • Notifications
        • Replace default notifications
        • Replace help notification/TextUI
      • Actions
        • Using the actions in a radial/external menu
        • Replace default search action
        • Get player allowed actions
        • Open actions menu
        • Integrate external impound script
        • Vehicle repaired
        • Get if local player is handcuffed
      • Duty
        • Duty status toggled
        • Toggle current duty status
      • Buyable vehicles
        • Vehicle spawned
        • Vehicle parked
      • Garage owned
        • Vehicle spawned
        • Vehicle parked
      • Temporary garage
        • Vehicle spawned
        • Vehicle parked
      • Replace Stash/Safe/Armory
      • Replace default billing
      • Progress bar
    • Server
      • Armory
        • Add weapon to armory
        • Remove weapon from armory
        • Get player armory weapons
        • Get all armory weapons
      • Boss
        • Add society account money
        • Remove society account money
        • Get job account money
        • On player fired
        • On player hired
      • Buyable vehicles
        • Get if player is owner of vehicle plate
        • Get all vehicles of player
        • On vehicle bought
        • Get player vehicles in marker ID
      • Crafting table
        • Item crafted
      • Duty
        • Duty status changed
        • Get if a player is on duty
      • Harvest
        • Item harvested
      • Market
        • Item sold
      • Process
        • Item processed
      • Shop
        • Item bought
      • Search/Steal action
        • Item stolen
        • Account stolen
        • Weapon stolen
      • Set handcuffs state
  • 💰Robberies Creator
    • Home
    • Installation
    • FAQ
    • Modules
    • How to edit minigames
    • Client
      • Progress bar
      • Replace default police alert
      • Notifications
        • Replace default notifications
        • Replace default help notifications
    • Server
      • Heist started
      • Heist finished
      • Police alerted
      • Step completed
  • 💡Missions Creator
    • Home
    • Installation
    • How to start
    • How to add minigames
    • Client
      • Replace default police alert
      • On entity spawn
      • Notifications
        • Replace default notifications
        • Replace default help notifications
        • Replace default mugshot notifications
    • Server
      • Police alerted
      • On mission start
      • On mission failed
      • On mission success
  • 🛒Shops Creator
    • Home
    • Installation
    • How to use images for items
    • Client
      • Replace default police alert
      • Notifications
        • Replace default notifications
        • Replace default help notifications
    • Server
      • Police alerted
      • Shop bought
      • Shop sold
      • Get what objects can be sold in shop ID
      • Get objects in shop ID
  • 🚗Dealerships Creator
    • Home
    • Installation
    • Adding custom vehicles/classes
    • Client
      • On test drive vehicle spawn
      • Notifications
        • Replace default notifications
        • Replace default help notifications
      • Showroom
        • On showroom enter
        • On showroom exit
        • Get Is Player In Showroom
        • Get Is Player Doing Test Drive
    • Server
      • On vehicle given
      • On vehicle resell
  • 🏁Races Creator
    • Home
    • Installation
    • Client
      • Replace default police alert
      • Notifications
        • Replace default notifications
        • Replace default help notifications
    • Server
      • Police alerted
  • 📍Blips Creator
    • Home
    • Installation
    • FAQ
    • How to use custom sprites
    • Client
      • Open menu manually
  • 🚪Doors Creator
    • Home
    • Installation
    • FAQ
    • Modules
    • Change doors icon
    • Admin bypass lock
    • Client
      • Replace default notifications
      • Get closest door
      • Toggle icon display
      • Replace default police alert
      • Get door ID from entity
    • Server
      • Refresh database
      • Police alerted
      • Get door ID data
      • Get building ID data
      • Get all buildings list
      • Get all doors list
      • Set door ID state (locked/unlocked)
      • Lockpicked door
      • Create building
      • Create door
      • Delete door
      • Update door
  • 💊Drugs Creator
    • Home
    • Installation
    • FAQ
    • Modules
    • Client
      • Replace default notifications
      • Progress bar
      • Replace default mugshot notifications
      • Replace default help notifications
      • Replace default police alert
      • Manually start drugs effects
      • NPC Selling
        • Disable default selling method for NPCs
        • Add ped to selling blacklist
        • Remove ped from selling blacklist
        • Manually sell to a NPC
        • NPC accepted drug
    • Server
      • Fields
        • Item harvested
      • Harvestable items
        • Item harvested
      • Laboratories
        • Successful craft
      • Sellings
        • Sold to pusher
        • Sold in boat
        • Sold in plane
        • Sold to NPC
        • Sold to narcos
      • Police alerted
      • Pocket crafting finished
  • 🚜Farming Creator
    • Home
    • Installation
    • Client
      • Replace default notifications
      • Progress bar
      • Replace default help notifications
      • Replace default police alert
    • Server
      • Police alerted
      • Item farmed
  • 🛰️Trackers Creator
    • Home
    • Installation
    • FAQ
    • Optimization
    • Client
      • Replace default notifications
      • Panic button pressed
      • Manually start panic button
    • Server
      • Panic button pressed
      • Player lost signal
      • Player set new private frequency
  • 🔑Vehicles Keys
    • Home
    • Installation
    • FAQ
    • How to give keys with /car command
    • Fix hotwiring bought car
    • Lock/unlock vehicle
    • Client
      • Self give current vehicle plate
      • Self give vehicle plate
      • Self remove vehicle plate
      • Open remote UI menu
      • Open keys list
      • Toggle hotwiring
      • Get if local player owns a plate
      • Get owned plates of local player
      • Toggle closest vehicle lock
      • Switch vehicle lock
      • Vehicle locked/unlocked
      • Replace/Disable default progress bar
      • Refresh self owned vehicles
      • Replace default police alert
      • Notifications
        • Replace default notifications
        • Replace default help notifications
      • Bypass start vehicle check
    • Server
      • Refresh player owned vehicles
      • Get if player ID owns a plate
      • Vehicle locked/unlocked
      • Player hotwired a vehicle
      • Player lockpicked a vehicle
      • Give keys to identifier
      • Remove keys from identifier
      • Give keys to player ID
      • Remove keys from player ID
      • Vehicle window broken
      • Get player ID keys
      • Get identifier keys
      • Police alerted
      • Alarms
        • Alarm activated (player vehicle)
        • Alarm activated (NPC vehicle)
  • 🧾Billing UI
    • Home
    • Installation
    • Client
      • Activate billing mode
      • Open billing menu
      • Replace default notifications
      • Pay a bill
      • Send a bill
      • View invoices
    • Server
      • Create bill
      • Delete bill
      • Refresh bill
      • On bill created
      • On bill paid
  • ✅Easy allowlist
    • Home
    • Installation
    • FAQ
    • Commands usage
    • How to enable Discord features
    • External deferrals
    • Server
      • Allowlist
        • Remove identifier from allowlist
        • Add identifier to allowlist
      • Queue
        • Set player queue priority
        • Set discord role queue priority
        • Set identifier queue priority
        • Remove identifier queue priority
        • Remove discord role queue priority
        • Get count of players currently in queue
        • Get queue info
  • 👜Luxury Clothes Theft
    • Home
    • Installation
    • Client
      • Replace default notifications
Powered by GitBook
On this page
  • Generic script
  • esx_vehicleshop
  • First step
  • Second step
  • esx_advancedvehicleshop
  • qb-vehicleshop
  • First step
  • Second step
  • okokVehicleShop
  • s4-vehicleshop
  • t1ger_dealerships
  • First step
  • Second step

Was this helpful?

  1. Vehicles Keys

Fix hotwiring bought car

PreviousHow to give keys with /car commandNextLock/unlock vehicle

Last updated 1 year ago

Was this helpful?

Generic script

If after you purchase a vehicle you have to hotwire it, you only have to add in your script code, after you know that the vehicle is added in owned_vehicles / player_vehicles table (depending on the framework)

You may want to add a Citizen.Wait(2000) before that line in case the vehicle wasn't yet in the table in the moment you triggered the event

esx_vehicleshop

First step

Go to esx_vehicleshop/server/main.lua and search for the following code:

And add this line

exports["vehicles_keys"]:refreshPlayerOwnedVehicles(playerId)

Second step

Go to esx_vehicleshop/server/main.lua (the same file as before) and search for the following code:

And add this line

exports["vehicles_keys"]:refreshPlayerOwnedVehicles(source)

esx_advancedvehicleshop

Go to esx_advancedvehicleshop/server/main.lua and search for the following code:

And add this line

exports["vehicles_keys"]:refreshPlayerOwnedVehicles(source)

qb-vehicleshop

First step

Go to qb-vehicleshop/server.lua and you will have to add the following code after all exports.oxmysql:insert

In the example, it will be shown only one time, but you have to add it multiple times

And add the following code

SetTimeout(1000, function() 
    exports["vehicles_keys"]:refreshPlayerOwnedVehicles( pData.PlayerData.source )
end)

In certain parts, you will have to replace pData with something else, here it will show where to add the code and on what pData depends

Note: the green circles showed in the screenshot must match, so if the first one is for example targetPlayer, the second one must be targetPlayer as well

Second step

Go to qb-vehicleshop/server.lua (the same file as before) and replace all these events (they are at the bottom of the file)

TriggerClientEvent('vehiclekeys:client:SetOwner', buyerId, plate)

with the following code

exports["vehicles_keys"]:refreshPlayerOwnedVehicles(buyerId)

okokVehicleShop

Go to okokVehicleShop/sv_utils.lua and search for the following code:

And add this line

exports["vehicles_keys"]:refreshPlayerOwnedVehicles(_source)

s4-vehicleshop

Go to s4-vehicleshop/server.lua and search for the following code:

And add the following code:

SetTimeout(1000, function() 
    exports["vehicles_keys"]:refreshPlayerOwnedVehicles(src)
end)

Note: this code will work for both oxmysql and ghmattimysql versions

t1ger_dealerships

First step

Go to t1ger_dealerships/server/main.lua and add the following line below all codes (more than one) like as shown in the example

exports['t1ger_keys']:UpdateKeysToDatabase(props.plate, true)

And add the following line

exports["vehicles_keys"]:refreshPlayerOwnedVehicles(xPlayer.source)

Second step

Go to t1ger_dealerships/server/main.lua (same file as before) and search for the following code:

And add the following line

exports["vehicles_keys"]:refreshPlayerOwnedVehicles(xPlayer.source)
🔑
this simple line of code