diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..dfe0770 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Auto detect text files and perform LF normalization +* text=auto diff --git a/Readme.md b/Readme.md new file mode 100644 index 0000000..f756d73 --- /dev/null +++ b/Readme.md @@ -0,0 +1,207 @@ +# A Vanilla Unicorn Job for QBCore Framework + + + + +## Please note + +- Please make sure u use the latest dependencies aswell as core for this in order to work. + +- This Job has been tested on the latest build as of 4/5/2022. + + +## Dependencies : + +QBCore Framework - https://github.com/qbcore-framework/qb-core + +PolyZone - https://github.com/mkafrin/PolyZone + +qb-target - https://github.com/BerkieBb/qb-target (Only needed if not using draw text) + +qb-input - https://github.com/qbcore-framework/qb-input + +qb-menu - https://github.com/qbcore-framework/qb-menu + + +## Credits : + +- AndyaUK for his amazing help in ideas, snippets, morale and everything inbetween. + +## Insert into @qb-smallresources --> server --> consumables.lua +``` +QBCore.Functions.CreateUseableItem("v-class", function(source, item) + local src = source + local Player = QBCore.Functions.GetPlayer(src) + TriggerClientEvent("consumables:client:Drink", src, item.name) +end) + +QBCore.Functions.CreateUseableItem("v-hulk", function(source, item) + local src = source + local Player = QBCore.Functions.GetPlayer(src) + TriggerClientEvent("consumables:client:DrinkAlcohol", src, item.name) +end) + +QBCore.Functions.CreateUseableItem("v-dancerz", function(source, item) + local src = source + local Player = QBCore.Functions.GetPlayer(src) + TriggerClientEvent("consumables:client:DrinkAlcohol", src, item.name) +end) + +QBCore.Functions.CreateUseableItem("v-unicorn", function(source, item) + local src = source + local Player = QBCore.Functions.GetPlayer(src) + TriggerClientEvent("consumables:client:DrinkAlcohol", src, item.name) +end) + +QBCore.Functions.CreateUseableItem("v-sparkles", function(source, item) + local src = source + local Player = QBCore.Functions.GetPlayer(src) + TriggerClientEvent("consumables:client:DrinkAlcohol", src, item.name) +end) + +QBCore.Functions.CreateUseableItem("v-oldfashioned", function(source, item) + local src = source + local Player = QBCore.Functions.GetPlayer(src) + TriggerClientEvent("consumables:client:DrinkAlcohol", src, item.name) +end) + +QBCore.Functions.CreateUseableItem("v-manhattan", function(source, item) + local src = source + local Player = QBCore.Functions.GetPlayer(src) + TriggerClientEvent("consumables:client:DrinkAlcohol", src, item.name) +end) + +QBCore.Functions.CreateUseableItem("v-espressomartini", function(source, item) + local src = source + local Player = QBCore.Functions.GetPlayer(src) + TriggerClientEvent("consumables:client:DrinkAlcohol", src, item.name) +end) + +QBCore.Functions.CreateUseableItem("v-margarita", function(source, item) + local src = source + local Player = QBCore.Functions.GetPlayer(src) + TriggerClientEvent("consumables:client:DrinkAlcohol", src, item.name) +end) +``` + + + +## Insert into @qb-smallresources --> config.lua +``` +Consumeables = { + +ConsumeablesDrink = { + + ["v-class"] = math.random(30, 40), +} + +ConsumeablesAlcohol = { + ["v-hulk"] = math.random(30, 40), + ["v-dancerz"] = math.random(30, 40), + ["v-unicorn"] = math.random(30, 40), + ["v-sparkles"] = math.random(30, 40), + ["v-oldfashioned"] = math.random(30, 40), + ["v-margarita"] = math.random(30, 40), + ["v-manhattan"] = math.random(30, 40), + ["v-espressomartini"] = math.random(30, 40), +} +``` + +## Insert into @qb-core/shared/items.lua + +``` +QBShared.Items = { +-- Vanilla Unicorn Job +["v-shots-pack"] = {["name"] = "v-shots-pack", ["label"] = "Shots Pack", ["weight"] = 1600, ["type"] = "item", ["image"] = "v-shots-pack.png", ["unique"] = false, ["useable"] = true, ["shouldClose"] = true, ["combinable"] = nil, ["description"] = "A Pack of 8 Shots. 2 of Each Flavour"}, + ["shot-absinthe"] = {["name"] = "shot-absinthe", ["label"] = "Absinthe Shot", ["weight"] = 200, ["type"] = "item", ["image"] = "shot-absinthe.png", ["unique"] = false, ["useable"] = true, ["shouldClose"] = true, ["combinable"] = nil, ["description"] = "A Shot of Absinthe."}, + ["shot-snakebite"] = {["name"] = "shot-snakebite", ["label"] = "Snakebite Shot", ["weight"] = 200, ["type"] = "item", ["image"] = "shot-snakebite.png", ["unique"] = false, ["useable"] = true, ["shouldClose"] = true, ["combinable"] = nil, ["description"] = "A Shot of Snake Bite."}, + ["shot-redsnapper"] = {["name"] = "shot-redsnapper", ["label"] = "RedSnapper Shot", ["weight"] = 200, ["type"] = "item", ["image"] = "shot-redsnapper.png", ["unique"] = false, ["useable"] = true, ["shouldClose"] = true, ["combinable"] = nil, ["description"] = "A Shot of Red Snapper."}, + ["shot-fireball"] = {["name"] = "shot-fireball", ["label"] = "Fireball Shot", ["weight"] = 200, ["type"] = "item", ["image"] = "shot-frieball.png", ["unique"] = false, ["useable"] = true, ["shouldClose"] = true, ["combinable"] = nil, ["description"] = "A Shot of Fireball."}, + ["vodka-crate"] = {["name"] = "vodka-crate", ["label"] = "Vodka Crate", ["weight"] = 2000, ["type"] = "item", ["image"] = "vodka-crate.png", ["unique"] = false, ["useable"] = true, ["shouldClose"] = true, ["combinable"] = nil, ["description"] = "A Crate of 10 Vodka Bottles"}, + ["whiskey-box"] = {["name"] = "whiskey-box", ["label"] = "Whiskey Box", ["weight"] = 1600, ["type"] = "item", ["image"] = "whiskey-box.png", ["unique"] = false, ["useable"] = true, ["shouldClose"] = true, ["combinable"] = nil, ["description"] = "A Box of 6 Whiskey Bottles"}, + ["beer-crate"] = {["name"] = "beer-crate", ["label"] = "Beer Crate", ["weight"] = 1800, ["type"] = "item", ["image"] = "beer-crate.png", ["unique"] = false, ["useable"] = true, ["shouldClose"] = true, ["combinable"] = nil, ["description"] = "A Crate of 12 Beers"}, + ["fruit-box"] = {["name"] = "fruit-box", ["label"] = "Fruit Box", ["weight"] = 2000, ["type"] = "item", ["image"] = "fruit-box.png", ["unique"] = false, ["useable"] = true, ["shouldClose"] = true, ["combinable"] = nil, ["description"] = "A Crate of 20 Fruit Mixes for Drinks"}, + ["fruit-mix"] = {["name"] = "fruit-mix", ["label"] = "Fruit Mix", ["weight"] = 100, ["type"] = "item", ["image"] = "fruit-mix.png", ["unique"] = false, ["useable"] = true, ["shouldClose"] = true, ["combinable"] = nil, ["description"] = "A Mix of Fruits"}, + ["tequila"] = {["name"] = "tequila", ["label"] = "Tequila", ["weight"] = 600, ["type"] = "item", ["image"] = "tequila.png", ["unique"] = false, ["useable"] = true, ["shouldClose"] = true, ["combinable"] = nil, ["description"] = "A Good Time"}, + ["tequila-crate"] = {["name"] = "tequila-crate", ["label"] = "Tequila Crate", ["weight"] = 3000, ["type"] = "item", ["image"] = "tequila-crate.png", ["unique"] = false, ["useable"] = true, ["shouldClose"] = true, ["combinable"] = nil, ["description"] = "A Crate of 8 Tequila Bottles"}, + ["v-sugar-syrup"] = {["name"] = "v-sugar-syrup", ["label"] = "Sugar Syrup", ["weight"] = 100, ["type"] = "item", ["image"] = "v-sugar-syrup.png", ["unique"] = false, ["useable"] = true, ["shouldClose"] = true, ["combinable"] = nil, ["description"] = "syrup for making cocktails"}, + ["v-margarita"] = {["name"] = "v-margarita", ["label"] = "Margarita", ["weight"] = 100, ["type"] = "item", ["image"] = "v-margarita.png", ["unique"] = false, ["useable"] = true, ["shouldClose"] = true, ["combinable"] = nil, ["description"] = "A Margarita Cocktail"}, + ["v-espressomartini"] = {["name"] = "v-espressomartini", ["label"] = "Espresso Martini", ["weight"] = 100, ["type"] = "item", ["image"] = "v-espressomartini.png", ["unique"] = false, ["useable"] = true, ["shouldClose"] = true, ["combinable"] = nil, ["description"] = "An Espresso Martini Cocktail"}, + ["v-manhattan"] = {["name"] = "v-manhattan", ["label"] = "Manhattan", ["weight"] = 100, ["type"] = "item", ["image"] = "v-manhattan.png", ["unique"] = false, ["useable"] = true, ["shouldClose"] = true, ["combinable"] = nil, ["description"] = "A Manhattan Cocktail"}, + ["v-oldfasioned"] = {["name"] = "v-oldfashioned", ["label"] = "Old Fashioned", ["weight"] = 100, ["type"] = "item", ["image"] = "v-oldfashioned.png", ["unique"] = false, ["useable"] = true, ["shouldClose"] = true, ["combinable"] = nil, ["description"] = "A Old Fashioned Cocktail"}, + ["v-bitter"] = {["name"] = "v-bitter", ["label"] = "Bitter", ["weight"] = 100, ["type"] = "item", ["image"] = "v-bitter.png", ["unique"] = false, ["useable"] = true, ["shouldClose"] = true, ["combinable"] = nil, ["description"] = "Bitter For Making Cocktails"}, + ["v-sparkles"] = {["name"] = "v-sparkles", ["label"] = "Sparkles", ["weight"] = 100, ["type"] = "item", ["image"] = "v-sparkles.png", ["unique"] = false, ["useable"] = true, ["shouldClose"] = true, ["combinable"] = nil, ["description"] = "Sparkles Cocktail"}, + ["v-unicorn"] = {["name"] = "v-unicorn", ["label"] = "Unicorn", ["weight"] = 100, ["type"] = "item", ["image"] = "v-unicorn.png", ["unique"] = false, ["useable"] = true, ["shouldClose"] = true, ["combinable"] = nil, ["description"] = "Unicorn Cocktail"}, + ["v-dancerz"] = {["name"] = "v-dancerz", ["label"] = "Dancerz", ["weight"] = 100, ["type"] = "item", ["image"] = "v-dancerz.png", ["unique"] = false, ["useable"] = true, ["shouldClose"] = true, ["combinable"] = nil, ["description"] = "Dancerz Cocktail"}, + ["v-hulk"] = {["name"] = "v-hulk", ["label"] = "Hulk", ["weight"] = 100, ["type"] = "item", ["image"] = "v-hulk.png", ["unique"] = false, ["useable"] = true, ["shouldClose"] = true, ["combinable"] = nil, ["description"] = "Hulk Cocktail"}, + ["v-class"] = {["name"] = "v-class", ["label"] = "Class", ["weight"] = 100, ["type"] = "item", ["image"] = "v-class.png", ["unique"] = false, ["useable"] = true, ["shouldClose"] = true, ["combinable"] = nil, ["description"] = "Class Non-Alcoholic Cocktail"}, + +} + +``` +## Insert into @qb-core/shared/jobs.lua +``` +QBShared.Jobs = { + ['vunicorn'] = { + label = 'Vanilla Unicorn', + defaultDuty = true, + offDutyPay = false, + grades = { + ['0'] = { + name = 'Trainee', + payment = 25 + }, + ['1'] = { + name = 'Employee', + payment = 40 + }, + ['2'] = { + name = 'Bar Staff', + payment = 50 + }, + ['3'] = { + name = 'Dancer', + payment = 80 + }, + ['4'] = { + name = 'Manager', + isboss = true, + payment = 100 + }, + ['5'] = { + name = 'Owner', + isboss = true, + payment = 150 + }, + }, + }, +} +``` + + + +## Insert into @qb-management - client - config.lua +``` +['vunicorn'] = vector3(93.44, -1292.99, 29.26), +``` +# if not making use of qb-target no need to insert this into qb-target + +## Insert into @qb-target - init.lua - config.targetmodels +``` +["vunicorn"] = { + models = { + "s_m_m_bouncer_01" + }, + options = { + { + type = "client", + event = "garage:V-UnicornGarage", + icon = "fas fa-car", + label = "Vanilla Unicorn Garage", + job = "vunicorn", + } + }, + distance = 2.5, + }, + +``` diff --git a/config.lua b/config.lua new file mode 100644 index 0000000..0140105 --- /dev/null +++ b/config.lua @@ -0,0 +1,92 @@ +Config = {} + +Config.GaragePedLocations = { + {coords = vector4(136.39, -1278.38, 29.36, 305.41)}, +} + +Config.Items = { +label = "Shop", + slots = 10, + items = { + [1] = { + name = "v-shots-pack", + price = 25, + amount = 50, + info = {}, + type = "item", + slot = 1, + }, + [2] = { + name = "vodka-crate", + price = 130, + amount = 50, + info = {}, + type = "item", + slot = 2, + }, + [3] = { + name = "whiskey-box", + price = 115, + amount = 50, + info = {}, + type = "item", + slot = 3, + }, + [4] = { + name = "beer-crate", + price = 45, + amount = 50, + info = {}, + type = "item", + slot = 4, + }, + [5] = { + name = "fruit-box", + price = 20, + amount = 20, + info = {}, + type = "item", + slot = 5, + }, + [6] = { + name = "tequila-crate", + price = 5, + amount = 50, + info = {}, + type = "item", + slot = 6, + }, + [7] = { + name = "v-sugar-syrup", + price = 5, + amount = 50, + info = {}, + type = "item", + slot = 7, + }, + [8] = { + name = "coffee", + price = 4, + amount = 50, + info = {}, + type = "item", + slot = 8, + }, + [9] = { + name = "v-sugar-syrup", + price = 4, + amount = 50, + info = {}, + type = "item", + slot = 7, + }, + [10] = { + name = "v-bitter", + price = 4, + amount = 50, + info = {}, + type = "item", + slot = 7, + }, + } +} diff --git a/fxmanifest.lua b/fxmanifest.lua new file mode 100644 index 0000000..bd78bc9 --- /dev/null +++ b/fxmanifest.lua @@ -0,0 +1,20 @@ +fx_version 'cerulean' +game 'gta5' + +author 'oosayeroo' +description 'qb-unicornjob by oosayeroo' +version '1.0.0' + +shared_scripts { + 'config.lua' +} + +client_scripts { + 'client/main.lua', + 'client/garage.lua', + 'client/menus.lua' +} + +server_scripts { + 'server/*.lua' +}