GithubHelp home page GithubHelp logo

swkeep / keep-oilwell Goto Github PK

View Code? Open in Web Editor NEW
120.0 9.0 43.0 2.44 MB

Nopixel inspired oil company script/job

License: GNU General Public License v3.0

Lua 100.00%
fivem qbcore qbcore-framework

keep-oilwell's Introduction

Keep oilwell

Preview

Dependencies

Key Features

  • NoPixel inspired oil company
  • Owning oilwells
  • ...

Patch 1.1.0 (employees)

  • new notifications when an oilwell part breaks.
  • oilwell owners can employ a person to operate their oilwells for them. (employees have access to crude oil transfer, but when they use it, it sends available oil to the owner's storage, not the employee's storage.)
  • employees should have oilwell job.
  • owners can fire their employees at will employees access will be revoked immediately.
  • removed some data which should not be available on client-side.
  • added script loading report.
  • the CEO have ability to remove any oilwell from now on (this is not a permanent removal therefore oil wells are just flagged as deleted for easy recovery).
  • information menu is now recives data directly from server.

How to update to new patch (database changes):

    1. update your oilrig_position by using ALTER TABLE available at end of sql.sql
    1. import new table oilcompany_employees

Patch 1.0.0

  • (important) if you are using old version make sure you have a backup.

  • balanced oil production for 1 hour

  • to be able to operate oilwells players must be on duty

  • oilwells now take damege and players should fix them or they will stop working

  • new items to fix oilwells

  • transport accepts all oil types

  • new oil types

  • blender new formula and new elemnts

  • qb-target won't despawn with objects

  • fixed qb-target not showing up

  • fixed props blinking

  • fixed props not spawning if players don't have oilwell job

  • better check for job and onduty

  • new withdraw system

  • withdraw purge menu

  • added octane calculation

  • showing oilwell prop before assigning them

  • oilbarell props

  • to be honest there was so many changes i don't remember most of them!

Usage

  • add oilwell by "/create oilwell" and then place and asign it to a player. (admins)
  • or use 'oilwell' item to spawn oilwell

Installation

Step 0:

  • import sql.sql in your database

Step 1:

** qb-core shared items.lua

["oilbarell"] = {
		["name"] = "oilbarell",
		["label"] = "Oil barell",
		["weight"] = 15000,
		["type"] = "item",
		["image"] = "oilBarrel.png",
		["unique"] = true,
		["useable"] = false,
		["shouldClose"] = true,
		["combinable"] = nil,
		["description"] = "Oil Barrel"
},
["oilwell"] = {
		["name"] = "oilwell",
		["label"] = "Oilwell",
		["weight"] = 50000,
		["type"] = "item",
		["image"] = "oilwell.png",
		["unique"] = false,
		["useable"] = true,
		["shouldClose"] = true,
		["combinable"] = nil,
		["description"] = "Oilwell"
},
["reliefvalvestring"] = {
	["name"] = "reliefvalvestring",
	["label"] = "Relief Valve String",
	["weight"] = 4000,
	["type"] = "item",
	["image"] = "relief_valve_string.png",
	["unique"] = false,
	["useable"] = true,
	["shouldClose"] = true,
	["combinable"] = nil,
	["description"] = "Relief Valve String"
},
["oilfilter"] = {
	["name"] = "oilfilter",
	["label"] = "Oil Filter",
	["weight"] = 5000,
	["type"] = "item",
	["image"] = "oil_filter.png",
	["unique"] = false,
	["useable"] = true,
	["shouldClose"] = true,
	["combinable"] = nil,
	["description"] = "Oil Filter"
},
["skewgear"] = {
	["name"] = "skewgear",
	["label"] = "Skew Gear",
	["weight"] = 6000,
	["type"] = "item",
	["image"] = "skew_gear.png",
	["unique"] = false,
	["useable"] = true,
	["shouldClose"] = true,
	["combinable"] = nil,
	["description"] = "Skew Gear"
},
["timingchain"] = {
	["name"] = "timingchain",
	["label"] = "Timing Chain",
	["weight"] = 7000,
	["type"] = "item",
	["image"] = "timing_chain.png",
	["unique"] = false,
	["useable"] = true,
	["shouldClose"] = true,
	["combinable"] = nil,
	["description"] = "Timing Chain"
},
["driveshaft"] = {
	["name"] = "driveshaft",
	["label"] = "Drive Shaft",
	["weight"] = 5000,
	["type"] = "item",
	["image"] = "drive_shaft.png",
	["unique"] = false,
	["useable"] = true,
	["shouldClose"] = true,
	["combinable"] = nil,
	["description"] = "Drive Shaft"
},

Step 2:

** qb-core shared jobs.lua

['oilwell'] = {
        label = 'Oil Company',
        defaultDuty = true,
        offDutyPay = false,
        grades = {
            ['0'] = {
                name = 'Oilwell Operator',
                payment = 50
            },
            ['1'] = {
                name = 'Oilwell Operator tier 2',
                payment = 75
            },
            ['2'] = {
                name = 'Event Driver tier 2',
                payment = 100
            },
            ['3'] = {
                name = 'Sales',
                payment = 125
            },
            ['4'] = {
                name = 'CEO',
                isboss = true,
                payment = 150
            },
        },
},

Step 3: tooltip

  • in qb-inventory\js\app.js find FormatItemInfo() there is if statement like: if (itemData.name == "id_card")
  • track where all of elseif statments are ended then add code below.
else if (itemData.name == "oilbarell") {
	$(".item-info-title").html("<p>" + itemData.label + "</p>");
	$(".item-info-description").html("<p>Gal: " + itemData.info.gal + "</p>" + "<p>Type: " + itemData.info.type + "</p>" + "<p>Octane: " + itemData.info.avg_gas_octane + "</p>");
}

Support

Donation

Keep oilwell Keep oilwell Keep oilwell Keep oilwell Keep oilwell Keep oilwell Keep oilwell Keep oilwell Keep oilwell

keep-oilwell's People

Contributors

swkeep avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

keep-oilwell's Issues

Blinking props

So i noticed when a user flys in every sprop thats being spawned starts blinking, if i restart the script props are static but if you restart fivem its all on the blink again.

sql error

[ script:keep-oilwell] SCRIPT ERROR: @keep-oilwell/server/server_lib/Server_GlobalScirptData.lua:630: keep-oilwell was unable to execute a query!
[ script:keep-oilwell] Table 'zap765645-1.oilrig_cdu' doesn't exist
[ script:keep-oilwell] SELECT * FROM oilrig_cdu []

Not sure how to handle this. I executed the sql as it was, and even attempted to run it manually. The oilrig_cdu table is in.

Pump Menu Blank

The pump menu is blank. Is this a known issue or just me?

image

view info sometimes returns different parts status for different people

After debuging the script
image

with

QBCore.Functions.CreateCallback('keep-oilwell:server:oilwell_metadata', function(source, cb, oilrig_hash)
local oil_well = GlobalScirptData:getByHash(oilrig_hash)
print(oil_well.metadata.part_info.belt, oil_well.metadata.part_info.polish, oil_well.metadata.part_info.clutch)
if not oil_well then cb(false) return end
cb(oil_well.metadata)
end)

it seems to get called 1x for each oilrig when you open the menu, and for some people it returns the wrong well even tho they sending in the right hash?

a couple more issues.

First one when you change the pump speed, everyone sees multiple pumps all stacked on top of each other.

2nd See the images
oil1
OIL2

getting 2 client side errors

Help

I dont understand this

image

menuv/menuv.lua =
image

Suggestion

i think it should be cool if you sell the oil

Sorry, heres my next one :(

I dont mean to be a pain with the issues! it looks like a really indepth job and id like to get it to work

[ script:drp-oiljob] Error loading script @menuv/menuv.lua in resource drp-oiljob: @menuv/menuv.lua:23: assertion failed!
[ script:drp-oiljob] stack traceback:
[ script:drp-oiljob] [C]: in function 'assert'
[ script:drp-oiljob] @menuv/menuv.lua:23: in main chunk

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.