[QB] qb_tk_gasstations - Player Owned Gas Stations & Fuel system

qb_tk_gasstations

[ Video ]
[ ESX version ]

About

  • Well-optimized

    • 0.01ms | Idle
    • 0.01ms - 0.10ms | In usage
  • Uses FiveM Asset Escrow system, but if there is anything you would like to get changed or added to the editable file, contact me and I can probably change it!

  • Features

    • By default, players can purchase one gas station (can be changed in the config)
    • Once bought, they can go to their gas station and start editing it
    • Players can:
      • Buy more gas (If set to true in config, they will need to use a truck to pick up the gas)
      • Change the gas price
      • Withdraw or deposit money
      • Rename their gas station
      • Transfer the ownership of the gas station
      • Or sell their gas station
    • You can only buy gas in gas stations that have an owner or you can enable non player owned gas stations that have unlimited fuel
    • All the money other players spend on your gas station’s gas will go to your gas station’s bank account
  • Exports

    • exports.qb_tk_gasstations:GetFuel(veh)
      • Get fuel level of a vehicle
    • exports.qb_tk_gasstations:SetFuel(veh, fuel)
      • Set fuel level of a vehicle
Screenshots

4

Config

7

Purchase (14.99€ + VAT)


My other QBCore Scripts


Code is accessible No
Subscription-based No
Lines (approximately) ~2000
Requirements qb-core, qb-menu, qb-input
Support Yes
2 Likes

What does this do to legacyfuel? Replace it totally ? How do you update vehicle fuel etc?

Hey! With this script you won’t need LegacyFuel at all, this will completely replace it. Forgot to add the exports to the post, but they have now been added. You can update and get the vehicle fuel level with them.

1 Like

Update 1.0.1

  • Added config option to disable gas station shop marker

Update 1.0.2

  • Fixed data not loading on server restart

hi is your script compatible with keep-oilwell ?

Would this be compatible with ps-fuel, am i able to replace the exports?

There isn’t a direct compatibility with keep-oilwell, but I’ve added a new server side event qb_tk_gasstations:addGas(amount, index) which lets you add more gas to a station. I’ve also changed the closestOwnGasStation variable to not be local so you can access it in the editable client file too which should let you add compatibility if you want to.

1 Like

I’m not really familiar with how ps-fuel works. What would you exactly need to get access to in my script?

Update 1.0.3

  • Fixed petrol cans not working as intended

Update 1.0.4

  • Added a new config option Config.DebugMode
  • Added a new config option Config.VehCheckDist
  • Fixed Config.ShopBlip.UseBlip not working as intended

Got the script in but when I walk up to hit E to look at the stations it won’t do anything.

Hey! Can send me a dm with some more information (script version etc.) and I’ll help you?

Update 1.0.5

  • Fixed error happening in rare occasions when connecting to server

Update 1.0.6

  • Moved menus to editable client file

Hey, this is great! But can anyone tell me how to make this work with qb hud?

1 Like

a little suggestion try create target models using qb-target and polyzones to create a more stable and clean feel for players like for example create a target model for the fuel pumps

but hey nice script keep up the amazing work :blush:

1 Like

Hey! You just need to change the exports inside qb-hud from exports['LegacyFuel'] to exports['qb_tk_gasstations'].

1 Like

Thank you for the feedback! Totally agree with you, maybe one day when I have some spare time I’ll add possibility to use target too. 3D text is the only option at the moment as I just converted this from ESX and the 3D text was used there.

Cant get it working lad on qb core followed the read me and it doesnt start the script

Have you got rid of legacy and changed the exports?