From fea06e0ecc47a3b1fe8b4aef48ef3ab0c517bb49 Mon Sep 17 00:00:00 2001 From: bitpredator <67551273+bitpredator@users.noreply.github.com> Date: Tue, 6 Aug 2024 10:09:42 +0200 Subject: [PATCH 01/13] =?UTF-8?q?chore:=20=F0=9F=8E=A8=20Run=20formatter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/[bpt_addons]/bpt_hunting/client/main.lua | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/server-data/resources/[bpt_addons]/bpt_hunting/client/main.lua b/server-data/resources/[bpt_addons]/bpt_hunting/client/main.lua index 08e3d09db..5c5d0c160 100644 --- a/server-data/resources/[bpt_addons]/bpt_hunting/client/main.lua +++ b/server-data/resources/[bpt_addons]/bpt_hunting/client/main.lua @@ -99,12 +99,7 @@ end) local oldped = {} function CanSlaughterPed(ped) if - not IsPedAPlayer(ped) - and not IsPedInAnyVehicle(ped, false) - and not IsPedHuman(ped) - and IsEntityDead(ped) - and ped ~= oldped - and GetEntityModel(ped) == GetHashKey("a_c_boar") + not IsPedAPlayer(ped) and not IsPedInAnyVehicle(ped, false) and not IsPedHuman(ped) and IsEntityDead(ped) and ped ~= oldped and GetEntityModel(ped) == GetHashKey("a_c_boar") or GetEntityModel(ped) == GetHashKey("a_c_coyote") or GetEntityModel(ped) == GetHashKey("a_c_deer") or GetEntityModel(ped) == GetHashKey("a_c_mtlion") From 9a32433fc8ce61f0a20109798b73c887eb969924 Mon Sep 17 00:00:00 2001 From: bitpredator <67551273+bitpredator@users.noreply.github.com> Date: Tue, 6 Aug 2024 10:22:30 +0200 Subject: [PATCH 02/13] refactor: Improved code style respecting ESLint rules --- .../[esx]/esx_notify/nui/js/script.js | 92 +++++++++---------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/server-data/resources/[esx]/esx_notify/nui/js/script.js b/server-data/resources/[esx]/esx_notify/nui/js/script.js index a21fde57d..6cf1b97e2 100644 --- a/server-data/resources/[esx]/esx_notify/nui/js/script.js +++ b/server-data/resources/[esx]/esx_notify/nui/js/script.js @@ -2,73 +2,73 @@ const w = window; // Gets the current icon it needs to use. const types = { - ["success"]: { - ["icon"]: "check_circle", - }, - ["error"]: { - ["icon"]: "error", - }, - ["info"]: { - ["icon"]: "info", - }, + ['success']: { + ['icon']: 'check_circle', + }, + ['error']: { + ['icon']: 'error', + }, + ['info']: { + ['icon']: 'info', + }, }; // the color codes example `i ~r~love~s~ donuts` const codes = { - "~r~": "red", - "~b~": "#378cbf", - "~g~": "green", - "~y~": "yellow", - "~p~": "purple", - "~c~": "grey", - "~m~": "#212121", - "~u~": "black", - "~o~": "orange", + '~r~': 'red', + '~b~': '#378cbf', + '~g~': 'green', + '~y~': 'yellow', + '~p~': 'purple', + '~c~': 'grey', + '~m~': '#212121', + '~u~': 'black', + '~o~': 'orange', }; -w.addEventListener("message", (event) => { - notification({ - type: event.data.type, - message: event.data.message, - length: event.data.length, - }); +w.addEventListener('message', (event) => { + notification({ + type: event.data.type, + message: event.data.message, + length: event.data.length, + }); }); const replaceColors = (str, obj) => { - let strToReplace = str; + let strToReplace = str; - for (let id in obj) { - strToReplace = strToReplace.replace(new RegExp(id, "g"), obj[id]); - } + for (const id in obj) { + strToReplace = strToReplace.replace(new RegExp(id, 'g'), obj[id]); + } - return strToReplace; + return strToReplace; }; notification = (data) => { - for (color in codes) { - if (data["message"].includes(color)) { - let objArr = {}; - objArr[color] = ``; - objArr["~s~"] = ""; + for (color in codes) { + if (data['message'].includes(color)) { + const objArr = {}; + objArr[color] = ``; + objArr['~s~'] = ''; - let newStr = replaceColors(data["message"], objArr); + const newStr = replaceColors(data['message'], objArr); - data["message"] = newStr; - } - } + data['message'] = newStr; + } + } - const notification = $(` + const notification = $(`
- ${types[data.type]["icon"]} -

${data["message"]}

+ ${types[data.type]['icon']} +

${data['message']}

- `).appendTo(`#root`); + `).appendTo('#root'); - setTimeout(() => { - notification.fadeOut(700); - }, data.length); + setTimeout(() => { + notification.fadeOut(700); + }, data.length); - return notification; + return notification; }; From ef0a01dbbb941bc871015c9175420e16941c6e15 Mon Sep 17 00:00:00 2001 From: bitpredator <67551273+bitpredator@users.noreply.github.com> Date: Tue, 6 Aug 2024 11:19:03 +0200 Subject: [PATCH 03/13] chore(server.lua): added exports to get addon accounts --- .../server/classes/addonaccount.lua | 72 +++++++++---------- .../bpt_addonaccount/server/main.lua | 14 ++-- 2 files changed, 43 insertions(+), 43 deletions(-) diff --git a/server-data/resources/[bpt_addons]/bpt_addonaccount/server/classes/addonaccount.lua b/server-data/resources/[bpt_addons]/bpt_addonaccount/server/classes/addonaccount.lua index 4ec4d2793..c13d86f23 100644 --- a/server-data/resources/[bpt_addons]/bpt_addonaccount/server/classes/addonaccount.lua +++ b/server-data/resources/[bpt_addons]/bpt_addonaccount/server/classes/addonaccount.lua @@ -1,36 +1,36 @@ -function CreateAddonAccount(name, owner, money) - local self = {} - - self.name = name - self.owner = owner - self.money = money - - function self.addMoney(amount) - self.money = self.money + amount - self.save() - TriggerEvent("bpt_addonaccount:addMoney", self.name, amount) - end - - function self.removeMoney(amount) - self.money = self.money - amount - self.save() - TriggerEvent("bpt_addonaccount:removeMoney", self.name, amount) - end - - function self.setMoney(amount) - self.money = amount - self.save() - TriggerEvent("bpt_addonaccount:setMoney", self.name, amount) - end - - function self.save() - if self.owner == nil then - MySQL.update("UPDATE addon_account_data SET money = ? WHERE account_name = ?", { self.money, self.name }) - else - MySQL.update("UPDATE addon_account_data SET money = ? WHERE account_name = ? AND owner = ?", { self.money, self.name, self.owner }) - end - TriggerClientEvent("bpt_addonaccount:setMoney", -1, self.name, self.money) - end - - return self -end +function CreateAddonAccount(name, owner, money) + local self = {} + + self.name = name + self.owner = owner + self.money = money + + function self.addMoney(amount) + self.money = self.money + amount + self.save() + TriggerEvent("bpt_addonaccount:addMoney", self.name, amount) + end + + function self.removeMoney(amount) + self.money = self.money - amount + self.save() + TriggerEvent("bpt_addonaccount:removeMoney", self.name, amount) + end + + function self.setMoney(amount) + self.money = amount + self.save() + TriggerEvent("bpt_addonaccount:setMoney", self.name, amount) + end + + function self.save() + if self.owner == nil then + MySQL.update("UPDATE addon_account_data SET money = ? WHERE account_name = ?", { self.money, self.name }) + else + MySQL.update("UPDATE addon_account_data SET money = ? WHERE account_name = ? AND owner = ?", { self.money, self.name, self.owner }) + end + TriggerClientEvent("bpt_addonaccount:setMoney", -1, self.name, self.money) + end + + return self +end diff --git a/server-data/resources/[bpt_addons]/bpt_addonaccount/server/main.lua b/server-data/resources/[bpt_addons]/bpt_addonaccount/server/main.lua index a4f3b24ba..6d35f8209 100644 --- a/server-data/resources/[bpt_addons]/bpt_addonaccount/server/main.lua +++ b/server-data/resources/[bpt_addons]/bpt_addonaccount/server/main.lua @@ -58,13 +58,13 @@ function AddSharedAccount(society, amount) if SharedAccounts[society.name] ~= nil then return SharedAccounts[society.name] end -- addon account: - local account = MySQL.insert.await('INSERT INTO `addon_account` (name, label, shared) VALUES (?, ?, ?)', { + local account = MySQL.insert.await("INSERT INTO `addon_account` (name, label, shared) VALUES (?, ?, ?)", { society.name, society.label, 1 }) if not account then return end -- if addon account inserted, insert addon account data: - local account_data = MySQL.insert.await('INSERT INTO `addon_account_data` (account_name, money) VALUES (?, ?)', { + local account_data = MySQL.insert.await("INSERT INTO `addon_account_data` (account_name, money) VALUES (?, ?)", { society.name, (amount or 0) }) if not account_data then return end @@ -91,7 +91,7 @@ AddEventHandler("esx:playerLoaded", function(_, xPlayer) local account = GetAccount(name, xPlayer.identifier) if account == nil then - MySQL.insert('INSERT INTO addon_account_data (account_name, money, owner) VALUES (?, ?, ?)', + MySQL.insert("INSERT INTO addon_account_data (account_name, money, owner) VALUES (?, ?, ?)", { name, 0, xPlayer.identifier }) account = CreateAddonAccount(name, xPlayer.identifier, 0) @@ -106,13 +106,13 @@ end) RegisterNetEvent("bpt_addonaccount:refreshAccounts") AddEventHandler("bpt_addonaccount:refreshAccounts", function() - local addonAccounts = MySQL.query.await('SELECT * FROM addon_account') + local addonAccounts = MySQL.query.await("SELECT * FROM addon_account") for i = 1, #addonAccounts, 1 do local name = addonAccounts[i].name local shared = addonAccounts[i].shared - local addonAccountData = MySQL.query.await('SELECT * FROM addon_account_data WHERE account_name = ?', { name }) + local addonAccountData = MySQL.query.await("SELECT * FROM addon_account_data WHERE account_name = ?", { name }) if shared == 0 then table.insert(AccountsIndex, name) @@ -126,7 +126,7 @@ AddEventHandler("bpt_addonaccount:refreshAccounts", function() local money = nil if #addonAccountData == 0 then - MySQL.insert('INSERT INTO addon_account_data (account_name, money, owner) VALUES (?, ?, ?)', + MySQL.insert("INSERT INTO addon_account_data (account_name, money, owner) VALUES (?, ?, ?)", { name, 0, nil }) money = 0 else @@ -141,4 +141,4 @@ end) exports("getAccount", GetAccount) -exports("getSharedAccount", GetSharedAccount) \ No newline at end of file +exports("getSharedAccount", GetSharedAccount) From dae825ab968dd08a7307ce3534810f9be247a6b0 Mon Sep 17 00:00:00 2001 From: bitpredator <67551273+bitpredator@users.noreply.github.com> Date: Tue, 6 Aug 2024 11:29:40 +0200 Subject: [PATCH 04/13] fix: shadowing upvalue argument status --- .../resources/[bpt_addons]/bpt_basicneeds/client/main.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server-data/resources/[bpt_addons]/bpt_basicneeds/client/main.lua b/server-data/resources/[bpt_addons]/bpt_basicneeds/client/main.lua index ec0e3d965..bf6859fa7 100644 --- a/server-data/resources/[bpt_addons]/bpt_basicneeds/client/main.lua +++ b/server-data/resources/[bpt_addons]/bpt_basicneeds/client/main.lua @@ -30,15 +30,15 @@ AddEventHandler("esx:onPlayerSpawn", function(spawn) end) AddEventHandler("bpt_status:loaded", function(status) - TriggerEvent("bpt_status:registerStatus", "hunger", 1000000, "#CFAD0F", function(status) + TriggerEvent("bpt_status:registerStatus", "hunger", 1000000, "#CFAD0F", function() return Config.Visible - end, function(status) + end, function() status.remove(100) end) TriggerEvent("bpt_status:registerStatus", "thirst", 1000000, "#0C98F1", function() return Config.Visible - end, function(status) + end, function() status.remove(75) end) end) From e11a0f37316985de37d0c25bed258c55fcaacbd3 Mon Sep 17 00:00:00 2001 From: bitpredator <67551273+bitpredator@users.noreply.github.com> Date: Tue, 6 Aug 2024 11:53:31 +0200 Subject: [PATCH 05/13] fix: attempt to index a nil value (upvalue 'status') --- .../resources/[bpt_addons]/bpt_basicneeds/client/main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server-data/resources/[bpt_addons]/bpt_basicneeds/client/main.lua b/server-data/resources/[bpt_addons]/bpt_basicneeds/client/main.lua index bf6859fa7..2f59bb3c2 100644 --- a/server-data/resources/[bpt_addons]/bpt_basicneeds/client/main.lua +++ b/server-data/resources/[bpt_addons]/bpt_basicneeds/client/main.lua @@ -30,7 +30,7 @@ AddEventHandler("esx:onPlayerSpawn", function(spawn) end) AddEventHandler("bpt_status:loaded", function(status) - TriggerEvent("bpt_status:registerStatus", "hunger", 1000000, "#CFAD0F", function() + TriggerEvent("bpt_status:registerStatus", "hunger", 1000000, "#CFAD0F", function(status) return Config.Visible end, function() status.remove(100) From 8ecb03a9ff04add0527c224f2cfbe2cdeb18c218 Mon Sep 17 00:00:00 2001 From: bitpredator <67551273+bitpredator@users.noreply.github.com> Date: Tue, 6 Aug 2024 11:56:19 +0200 Subject: [PATCH 06/13] convert: esx_RealisticVehicleFailure > bpt_RealisticVehicle --- .../bpt_RealisticVehicle}/client.lua | 4 +--- .../bpt_RealisticVehicle}/config.lua | 0 .../bpt_RealisticVehicle}/fxmanifest.lua | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) rename server-data/resources/{[esx_addons]/esx_RealisticVehicleFailure => [bpt_addons]/bpt_RealisticVehicle}/client.lua (99%) rename server-data/resources/{[esx_addons]/esx_RealisticVehicleFailure => [bpt_addons]/bpt_RealisticVehicle}/config.lua (100%) rename server-data/resources/{[esx_addons]/esx_RealisticVehicleFailure => [bpt_addons]/bpt_RealisticVehicle}/fxmanifest.lua (85%) diff --git a/server-data/resources/[esx_addons]/esx_RealisticVehicleFailure/client.lua b/server-data/resources/[bpt_addons]/bpt_RealisticVehicle/client.lua similarity index 99% rename from server-data/resources/[esx_addons]/esx_RealisticVehicleFailure/client.lua rename to server-data/resources/[bpt_addons]/bpt_RealisticVehicle/client.lua index 1def389af..ceda7ff52 100644 --- a/server-data/resources/[esx_addons]/esx_RealisticVehicleFailure/client.lua +++ b/server-data/resources/[bpt_addons]/bpt_RealisticVehicle/client.lua @@ -58,10 +58,8 @@ local function isPedDrivingAVehicle() end local function fscale(inputValue, originalMin, originalMax, newBegin, newEnd, curve) - local OriginalRange = 0.0 + local OriginalRange, normalizedCurVal, zeroRefCurVal local NewRange = 0.0 - local zeroRefCurVal = 0.0 - local normalizedCurVal = 0.0 local rangedValue = 0.0 local invFlag = 0 diff --git a/server-data/resources/[esx_addons]/esx_RealisticVehicleFailure/config.lua b/server-data/resources/[bpt_addons]/bpt_RealisticVehicle/config.lua similarity index 100% rename from server-data/resources/[esx_addons]/esx_RealisticVehicleFailure/config.lua rename to server-data/resources/[bpt_addons]/bpt_RealisticVehicle/config.lua diff --git a/server-data/resources/[esx_addons]/esx_RealisticVehicleFailure/fxmanifest.lua b/server-data/resources/[bpt_addons]/bpt_RealisticVehicle/fxmanifest.lua similarity index 85% rename from server-data/resources/[esx_addons]/esx_RealisticVehicleFailure/fxmanifest.lua rename to server-data/resources/[bpt_addons]/bpt_RealisticVehicle/fxmanifest.lua index b83118092..50b7f9086 100644 --- a/server-data/resources/[esx_addons]/esx_RealisticVehicleFailure/fxmanifest.lua +++ b/server-data/resources/[bpt_addons]/bpt_RealisticVehicle/fxmanifest.lua @@ -1,7 +1,7 @@ fx_version("adamant") game("gta5") -description("esx_realisticvehicle") +description("bpt_RealisticVehicle") lua54("yes") version("1.0.1") From 4d8a4cfc31f45ba75ccfee88a436525bf5ebc90c Mon Sep 17 00:00:00 2001 From: bitpredator <67551273+bitpredator@users.noreply.github.com> Date: Tue, 6 Aug 2024 12:00:58 +0200 Subject: [PATCH 07/13] fix: value assigned to variable unused --- .../resources/[bpt_addons]/bpt_RealisticVehicle/client.lua | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/server-data/resources/[bpt_addons]/bpt_RealisticVehicle/client.lua b/server-data/resources/[bpt_addons]/bpt_RealisticVehicle/client.lua index ceda7ff52..13b7ee03e 100644 --- a/server-data/resources/[bpt_addons]/bpt_RealisticVehicle/client.lua +++ b/server-data/resources/[bpt_addons]/bpt_RealisticVehicle/client.lua @@ -58,9 +58,7 @@ local function isPedDrivingAVehicle() end local function fscale(inputValue, originalMin, originalMax, newBegin, newEnd, curve) - local OriginalRange, normalizedCurVal, zeroRefCurVal - local NewRange = 0.0 - local rangedValue = 0.0 + local OriginalRange, normalizedCurVal, zeroRefCurVal, NewRange, rangedValue local invFlag = 0 if curve > 10.0 then From 9fc435d5e8fb6a63bb01e377e64f9ef864fcfe1a Mon Sep 17 00:00:00 2001 From: bitpredator <67551273+bitpredator@users.noreply.github.com> Date: Tue, 6 Aug 2024 12:07:23 +0200 Subject: [PATCH 08/13] =?UTF-8?q?chore:=20=F0=9F=8E=A8=20Run=20formatter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../[bpt_addons]/bpt_doorlock/config.lua | 12 +- .../[bpt_addons]/bpt_doorlock/fxmanifest.lua | 86 ++++----- .../bpt_doorlock/server/framework/qb-core.lua | 164 +++++++++--------- .../[bpt_addons]/bpt_doorlock/types.lua | 2 +- 4 files changed, 134 insertions(+), 130 deletions(-) diff --git a/server-data/resources/[bpt_addons]/bpt_doorlock/config.lua b/server-data/resources/[bpt_addons]/bpt_doorlock/config.lua index d01c8c140..28fa9271b 100644 --- a/server-data/resources/[bpt_addons]/bpt_doorlock/config.lua +++ b/server-data/resources/[bpt_addons]/bpt_doorlock/config.lua @@ -11,28 +11,28 @@ Config.DrawTextUI = false ---Set the properties used by [DrawSprite](https://docs.fivem.net/natives/?_0xE7FFAE5EBF23D890). Config.DrawSprite = { -- Unlocked - [0] = { 'mpsafecracking', 'lock_open', 0, 0, 0.018, 0.018, 0, 255, 255, 255, 100 }, + [0] = { "mpsafecracking", "lock_open", 0, 0, 0.018, 0.018, 0, 255, 255, 255, 100 }, -- Locked - [1] = { 'mpsafecracking', 'lock_closed', 0, 0, 0.018, 0.018, 0, 255, 255, 255, 100 }, + [1] = { "mpsafecracking", "lock_closed", 0, 0, 0.018, 0.018, 0, 255, 255, 255, 100 }, } ---Allow the specified ace principal to use 'command.doorlock'. -Config.CommandPrincipal = 'group.admin' +Config.CommandPrincipal = "group.admin" ---Allow players with the 'command.doorlock' principal to use any door. Config.PlayerAceAuthorised = false ---The default skill check difficulty when lockpicking a door. -Config.LockDifficulty = { 'easy', 'easy', 'medium' } +Config.LockDifficulty = { "easy", "easy", "medium" } ---Allow lockpicks to be used to lock an unlocked door. Config.CanPickUnlockedDoors = false ---An array of items that function as lockpicks. Config.LockpickItems = { - 'lockpick' + "lockpick", } ---Play sounds using game audio (sound natives) instead of through NUI. -Config.NativeAudio = false \ No newline at end of file +Config.NativeAudio = false diff --git a/server-data/resources/[bpt_addons]/bpt_doorlock/fxmanifest.lua b/server-data/resources/[bpt_addons]/bpt_doorlock/fxmanifest.lua index a71dc5bac..661201a5a 100644 --- a/server-data/resources/[bpt_addons]/bpt_doorlock/fxmanifest.lua +++ b/server-data/resources/[bpt_addons]/bpt_doorlock/fxmanifest.lua @@ -1,48 +1,48 @@ -- FX Information -fx_version 'cerulean' -use_experimental_fxv2_oal 'yes' -lua54 'yes' -game 'gta5' +fx_version("cerulean") +use_experimental_fxv2_oal("yes") +lua54("yes") +game("gta5") -- Resource Information -name 'bpt_doorlock' -version '1.0.2' -license 'MIT' -author 'bitpredator' -repository 'https://github.com/bitpredator/bpt_doorlock' +name("bpt_doorlock") +version("1.0.2") +license("MIT") +author("bitpredator") +repository("https://github.com/bitpredator/bpt_doorlock") -- Manifest -shared_script { - '@ox_lib/init.lua', - 'config.lua', -} - -client_script { - 'client/main.lua', - 'client/utils.lua', -} - -server_script { - '@oxmysql/lib/MySQL.lua', - 'server/convert.lua', - 'server/framework/*.lua', - 'server/main.lua', -} - -ui_page 'web/build/index.html' - -files { - 'web/build/index.html', - 'web/build/**/*', - 'locales/*.json', - 'audio/data/bptdoorlock_sounds.dat54.rel', - 'audio/dlc_bptdoorlock/bptdoorlock.awc', -} - -data_file 'AUDIO_WAVEPACK' 'audio/dlc_bptdoorlock' -data_file 'AUDIO_SOUNDDATA' 'audio/data/bptdoorlock_sounds.dat' - -dependencies { - 'oxmysql', - 'ox_lib' -} \ No newline at end of file +shared_script({ + "@ox_lib/init.lua", + "config.lua", +}) + +client_script({ + "client/main.lua", + "client/utils.lua", +}) + +server_script({ + "@oxmysql/lib/MySQL.lua", + "server/convert.lua", + "server/framework/*.lua", + "server/main.lua", +}) + +ui_page("web/build/index.html") + +files({ + "web/build/index.html", + "web/build/**/*", + "locales/*.json", + "audio/data/bptdoorlock_sounds.dat54.rel", + "audio/dlc_bptdoorlock/bptdoorlock.awc", +}) + +data_file("AUDIO_WAVEPACK")("audio/dlc_bptdoorlock") +data_file("AUDIO_SOUNDDATA")("audio/data/bptdoorlock_sounds.dat") + +dependencies({ + "oxmysql", + "ox_lib", +}) diff --git a/server-data/resources/[bpt_addons]/bpt_doorlock/server/framework/qb-core.lua b/server-data/resources/[bpt_addons]/bpt_doorlock/server/framework/qb-core.lua index dbe1fd9cf..61ec82ad3 100644 --- a/server-data/resources/[bpt_addons]/bpt_doorlock/server/framework/qb-core.lua +++ b/server-data/resources/[bpt_addons]/bpt_doorlock/server/framework/qb-core.lua @@ -1,99 +1,103 @@ -local resourceName = 'qb-core' +local resourceName = "qb-core" -if not GetResourceState(resourceName):find('start') then return end +if not GetResourceState(resourceName):find("start") then + return +end SetTimeout(0, function() local QB = exports[resourceName]:GetCoreObject() GetPlayer = QB.Functions.GetPlayer - if GetResourceState('ox_inventory') == 'missing' then - function RemoveItem(playerId, item, slot) + if GetResourceState("ox_inventory") == "missing" then + function RemoveItem(playerId, item, slot) local player = GetPlayer(playerId) - if player then player.Functions.RemoveItem(item, 1, slot) end - end - - ---@param player table - ---@param items string[] | { name: string, remove?: boolean, metadata?: string }[] - ---@param removeItem? boolean - ---@return string? - function DoesPlayerHaveItem(player, items, removeItem) - for i = 1, #items do - local item = items[i] + if player then + player.Functions.RemoveItem(item, 1, slot) + end + end + + ---@param player table + ---@param items string[] | { name: string, remove?: boolean, metadata?: string }[] + ---@param removeItem? boolean + ---@return string? + function DoesPlayerHaveItem(player, items, removeItem) + for i = 1, #items do + local item = items[i] local itemName = item.name or item - if item.metadata then - local playerItems = player.Functions.GetItemsByName(itemName) - - for j = 1, #playerItems do - local data = playerItems[j] - - if data.info.type == item.metadata then - if removeItem or item.remove then - player.Functions.RemoveItem(itemName, 1, data.slot) - end - - return itemName - end - end - else - local data = player.Functions.GetItemByName(itemName) - - if data then - if item.remove then - player.Functions.RemoveItem(itemName, 1, data.slot) - end - - return itemName - end - end - end - end + if item.metadata then + local playerItems = player.Functions.GetItemsByName(itemName) + + for j = 1, #playerItems do + local data = playerItems[j] + + if data.info.type == item.metadata then + if removeItem or item.remove then + player.Functions.RemoveItem(itemName, 1, data.slot) + end + + return itemName + end + end + else + local data = player.Functions.GetItemByName(itemName) + + if data then + if item.remove then + player.Functions.RemoveItem(itemName, 1, data.slot) + end + + return itemName + end + end + end + end end end) function GetCharacterId(player) - return player.PlayerData.citizenid + return player.PlayerData.citizenid end -local groups = { 'job', 'gang' } +local groups = { "job", "gang" } function IsPlayerInGroup(player, filter) - local type = type(filter) - - if type == 'string' then - for i = 1, #groups do - local data = player.PlayerData[groups[i]] - - if data.name == filter then - return data.name, data.grade.level - end - end - else - local tabletype = table.type(filter) - - if tabletype == 'hash' then - for i = 1, #groups do - local data = player.PlayerData[groups[i]] - local grade = filter[data.name] - - if grade and grade <= data.grade.level then - return data.name, data.grade.level - end - end - elseif tabletype == 'array' then - for i = 1, #filter do - local group = filter[i] - - for j = 1, #groups do - local data = player.PlayerData[groups[j]] - - if data.name == group then - return data.name, data.grade.level - end - end - end - end - end -end \ No newline at end of file + local type = type(filter) + + if type == "string" then + for i = 1, #groups do + local data = player.PlayerData[groups[i]] + + if data.name == filter then + return data.name, data.grade.level + end + end + else + local tabletype = table.type(filter) + + if tabletype == "hash" then + for i = 1, #groups do + local data = player.PlayerData[groups[i]] + local grade = filter[data.name] + + if grade and grade <= data.grade.level then + return data.name, data.grade.level + end + end + elseif tabletype == "array" then + for i = 1, #filter do + local group = filter[i] + + for j = 1, #groups do + local data = player.PlayerData[groups[j]] + + if data.name == group then + return data.name, data.grade.level + end + end + end + end + end +end diff --git a/server-data/resources/[bpt_addons]/bpt_doorlock/types.lua b/server-data/resources/[bpt_addons]/bpt_doorlock/types.lua index a99514fdb..6db53d238 100644 --- a/server-data/resources/[bpt_addons]/bpt_doorlock/types.lua +++ b/server-data/resources/[bpt_addons]/bpt_doorlock/types.lua @@ -20,4 +20,4 @@ ---@field CanPickUnlockedDoors boolean ---@field LockpickItems string[] ---@field NativeAudio boolean ----@field DrawSprite { [0]: DrawSpriteProps, [1]: DrawSpriteProps } \ No newline at end of file +---@field DrawSprite { [0]: DrawSpriteProps, [1]: DrawSpriteProps } From be7700bfbe5c4d7082c54c1b7c7c28a9c299d24a Mon Sep 17 00:00:00 2001 From: bitpredator <67551273+bitpredator@users.noreply.github.com> Date: Tue, 6 Aug 2024 12:17:03 +0200 Subject: [PATCH 09/13] =?UTF-8?q?chore:=20=F0=9F=8E=A8=20Run=20formatter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wasabi_fishing/bridge/esx/client.lua | 74 ++--- .../wasabi_fishing/bridge/esx/server.lua | 102 +++---- .../wasabi_fishing/bridge/qb/client.lua | 122 ++++---- .../[wasabi]/wasabi_fishing/client/client.lua | 281 +++++++----------- .../wasabi_fishing/client/functions.lua | 37 ++- .../wasabi_fishing/configuration/config.lua | 56 ++-- .../wasabi_fishing/configuration/strings.lua | 52 ++-- .../[wasabi]/wasabi_fishing/server/server.lua | 152 ++++------ .../wasabi_fishing/server/updater.lua | 116 ++++---- 9 files changed, 446 insertions(+), 546 deletions(-) diff --git a/server-data/resources/[wasabi]/wasabi_fishing/bridge/esx/client.lua b/server-data/resources/[wasabi]/wasabi_fishing/bridge/esx/client.lua index 28794fdcf..3deb3da27 100644 --- a/server-data/resources/[wasabi]/wasabi_fishing/bridge/esx/client.lua +++ b/server-data/resources/[wasabi]/wasabi_fishing/bridge/esx/client.lua @@ -1,68 +1,68 @@ if GetResourceState("es_extended") ~= "started" then - return + return end ESX = exports["es_extended"]:getSharedObject() Framework, PlayerLoaded, PlayerData = "esx", nil, {} RegisterNetEvent("esx:playerLoaded", function(xPlayer) - PlayerData = xPlayer - PlayerLoaded = true + PlayerData = xPlayer + PlayerLoaded = true end) RegisterNetEvent("esx:onPlayerSpawn", function() - TriggerEvent("wasabi_fishing:onPlayerSpawn") + TriggerEvent("wasabi_fishing:onPlayerSpawn") end) AddEventHandler("esx:onPlayerDeath", function(data) - TriggerEvent("wasabi_fishing:onPlayerDeath") + TriggerEvent("wasabi_fishing:onPlayerDeath") end) RegisterNetEvent("esx:onPlayerLogout", function() - table.wipe(PlayerData) - PlayerLoaded = false + table.wipe(PlayerData) + PlayerLoaded = false end) RegisterNetEvent("esx:setJob", function(job) - PlayerData.job = job + PlayerData.job = job end) AddEventHandler("onResourceStart", function(resourceName) - if GetCurrentResourceName() ~= resourceName or not ESX.PlayerLoaded then - return - end - PlayerData = ESX.GetPlayerData() - PlayerLoaded = true + if GetCurrentResourceName() ~= resourceName or not ESX.PlayerLoaded then + return + end + PlayerData = ESX.GetPlayerData() + PlayerLoaded = true end) AddEventHandler("esx:setPlayerData", function(key, value) - if GetInvokingResource() ~= "es_extended" then - return - end - PlayerData[key] = value + if GetInvokingResource() ~= "es_extended" then + return + end + PlayerData[key] = value end) function HasGroup(filter) - local type = type(filter) + local type = type(filter) - if type == "string" then - if PlayerData.job.name == filter then - return PlayerData.job.name, PlayerData.job.grade - end - else - local tabletype = table.type(filter) + if type == "string" then + if PlayerData.job.name == filter then + return PlayerData.job.name, PlayerData.job.grade + end + else + local tabletype = table.type(filter) - if tabletype == "hash" then - local grade = filter[PlayerData.job.name] + if tabletype == "hash" then + local grade = filter[PlayerData.job.name] - if grade and grade <= PlayerData.job.grade then - return PlayerData.job.name, PlayerData.job.grade - end - elseif tabletype == "array" then - for i = 1, #filter do - if PlayerData.job.name == filter[i] then - return PlayerData.job.name, PlayerData.job.grade - end - end - end - end + if grade and grade <= PlayerData.job.grade then + return PlayerData.job.name, PlayerData.job.grade + end + elseif tabletype == "array" then + for i = 1, #filter do + if PlayerData.job.name == filter[i] then + return PlayerData.job.name, PlayerData.job.grade + end + end + end + end end diff --git a/server-data/resources/[wasabi]/wasabi_fishing/bridge/esx/server.lua b/server-data/resources/[wasabi]/wasabi_fishing/bridge/esx/server.lua index 401593169..2d56efce1 100644 --- a/server-data/resources/[wasabi]/wasabi_fishing/bridge/esx/server.lua +++ b/server-data/resources/[wasabi]/wasabi_fishing/bridge/esx/server.lua @@ -1,91 +1,91 @@ if GetResourceState("es_extended") ~= "started" then - return + return end ESX = exports["es_extended"]:getSharedObject() Framework = "esx" function GetPlayer(source) - return ESX.GetPlayerFromId(source) + return ESX.GetPlayerFromId(source) end function KickPlayer(source, reason) - local player = GetPlayer(source) - return player.kick(reason) + local player = GetPlayer(source) + return player.kick(reason) end function HasGroup(source, filter) - local player = GetPlayer(source) - local type = type(filter) + local player = GetPlayer(source) + local type = type(filter) - if type == "string" then - if player.job.name == filter then - return player.job.name, player.job.grade - end - else - local tabletype = table.type(filter) + if type == "string" then + if player.job.name == filter then + return player.job.name, player.job.grade + end + else + local tabletype = table.type(filter) - if tabletype == "hash" then - local grade = filter[player.job.name] + if tabletype == "hash" then + local grade = filter[player.job.name] - if grade and grade <= player.job.grade then - return player.job.name, player.job.grade - end - elseif tabletype == "array" then - for i = 1, #filter do - if player.job.name == filter[i] then - return player.job.name, player.job.grade - end - end - end - end + if grade and grade <= player.job.grade then + return player.job.name, player.job.grade + end + elseif tabletype == "array" then + for i = 1, #filter do + if player.job.name == filter[i] then + return player.job.name, player.job.grade + end + end + end + end end function GetIdentifier(source) - local xPlayer = ESX.GetPlayerFromId(source) - return xPlayer.identifier + local xPlayer = ESX.GetPlayerFromId(source) + return xPlayer.identifier end function GetName(source) - local xPlayer = ESX.GetPlayerFromId(source) - return xPlayer.getName() + local xPlayer = ESX.GetPlayerFromId(source) + return xPlayer.getName() end function RegisterUsableItem(item, cb) - ESX.RegisterUsableItem(item, cb) + ESX.RegisterUsableItem(item, cb) end function HasItem(source, item) - local player = GetPlayer(source) - local item = player.getInventoryItem(item) - if item ~= nil then - return item.count - else - return 0 - end + local player = GetPlayer(source) + local item = player.getInventoryItem(item) + if item ~= nil then + return item.count + else + return 0 + end end function AddItem(source, item, count, slot, metadata) - local player = GetPlayer(source) - return player.addInventoryItem(item, count, metadata, slot) + local player = GetPlayer(source) + return player.addInventoryItem(item, count, metadata, slot) end function RemoveItem(source, item, count, slot, metadata) - local player = GetPlayer(source) - player.removeInventoryItem(item, count, metadata, slot) + local player = GetPlayer(source) + player.removeInventoryItem(item, count, metadata, slot) end function AddMoney(source, type, amount) - if type == "cash" then - type = "money" - end - local player = GetPlayer(source) - player.addAccountMoney(type, amount) + if type == "cash" then + type = "money" + end + local player = GetPlayer(source) + player.addAccountMoney(type, amount) end function RemoveMoney(source, type, amount) - if type == "cash" then - type = "money" - end - local player = GetPlayer(source) - player.removeAccountMoney(type, amount) + if type == "cash" then + type = "money" + end + local player = GetPlayer(source) + player.removeAccountMoney(type, amount) end diff --git a/server-data/resources/[wasabi]/wasabi_fishing/bridge/qb/client.lua b/server-data/resources/[wasabi]/wasabi_fishing/bridge/qb/client.lua index 271812fdd..0626f160c 100644 --- a/server-data/resources/[wasabi]/wasabi_fishing/bridge/qb/client.lua +++ b/server-data/resources/[wasabi]/wasabi_fishing/bridge/qb/client.lua @@ -1,91 +1,87 @@ if GetResourceState("qb-core") ~= "started" then - return + return end QBCore = exports["qb-core"]:GetCoreObject() Framework, PlayerLoaded, PlayerData = "qb", nil, {} AddStateBagChangeHandler("isLoggedIn", "", function(_bagName, _key, value, _reserved, _replicated) - if value then - PlayerData = QBCore.Functions.GetPlayerData() - else - table.wipe(PlayerData) - end - PlayerLoaded = value + if value then + PlayerData = QBCore.Functions.GetPlayerData() + else + table.wipe(PlayerData) + end + PlayerLoaded = value end) AddEventHandler("onResourceStart", function(resourceName) - if GetCurrentResourceName() ~= resourceName or not LocalPlayer.state.isLoggedIn then - return - end - PlayerData = QBCore.Functions.GetPlayerData() - PlayerLoaded = true + if GetCurrentResourceName() ~= resourceName or not LocalPlayer.state.isLoggedIn then + return + end + PlayerData = QBCore.Functions.GetPlayerData() + PlayerLoaded = true end) AddEventHandler("gameEventTriggered", function(event, data) - if event ~= "CEventNetworkEntityDamage" then - return - end - local victim, victimDied = data[1], data[4] - if not IsPedAPlayer(victim) then - return - end - local player = PlayerId() - if - victimDied - and NetworkGetPlayerIndexFromPed(victim) == player - and (IsPedDeadOrDying(victim, true) or IsPedFatallyInjured(victim)) - then - TriggerEvent("wasabi_fishing:onPlayerDeath") - end + if event ~= "CEventNetworkEntityDamage" then + return + end + local victim, victimDied = data[1], data[4] + if not IsPedAPlayer(victim) then + return + end + local player = PlayerId() + if victimDied and NetworkGetPlayerIndexFromPed(victim) == player and (IsPedDeadOrDying(victim, true) or IsPedFatallyInjured(victim)) then + TriggerEvent("wasabi_fishing:onPlayerDeath") + end end) RegisterNetEvent("QBCore:Client:OnPlayerLoaded", function() - TriggerEvent("wasabi_fishing:onPlayerSpawn") + TriggerEvent("wasabi_fishing:onPlayerSpawn") end) RegisterNetEvent("QBCore:Player:SetPlayerData", function(newPlayerData) - if source ~= "" and GetInvokingResource() ~= "qb-core" then - return - end - PlayerData = newPlayerData + if source ~= "" and GetInvokingResource() ~= "qb-core" then + return + end + PlayerData = newPlayerData end) function HasGroup(filter) - local groups = { "job", "gang" } - local type = type(filter) + local groups = { "job", "gang" } + local type = type(filter) - if type == "string" then - for i = 1, #groups do - local data = PlayerData[groups[i]] + if type == "string" then + for i = 1, #groups do + local data = PlayerData[groups[i]] - if data.name == filter then - return data.name, data.grade.level - end - end - else - local tabletype = table.type(filter) + if data.name == filter then + return data.name, data.grade.level + end + end + else + local tabletype = table.type(filter) - if tabletype == "hash" then - for i = 1, #groups do - local data = PlayerData[groups[i]] - local grade = filter[data.name] + if tabletype == "hash" then + for i = 1, #groups do + local data = PlayerData[groups[i]] + local grade = filter[data.name] - if grade and grade <= data.grade.level then - return data.name, data.grade.level - end - end - elseif tabletype == "array" then - for i = 1, #filter do - local group = filter[i] + if grade and grade <= data.grade.level then + return data.name, data.grade.level + end + end + elseif tabletype == "array" then + for i = 1, #filter do + local group = filter[i] - for j = 1, #groups do - local data = PlayerData[groups[j]] + for j = 1, #groups do + local data = PlayerData[groups[j]] - if data.name == group then - return data.name, data.grade.level - end - end - end - end - end + if data.name == group then + return data.name, data.grade.level + end + end + end + end + end end diff --git a/server-data/resources/[wasabi]/wasabi_fishing/client/client.lua b/server-data/resources/[wasabi]/wasabi_fishing/client/client.lua index c1adb39cf..898a248b8 100644 --- a/server-data/resources/[wasabi]/wasabi_fishing/client/client.lua +++ b/server-data/resources/[wasabi]/wasabi_fishing/client/client.lua @@ -1,182 +1,123 @@ local fishing = false if Config.sellShop.enabled then - CreateThread(function() - local ped, textUI - CreateBlip(Config.sellShop.coords, 356, 1, Strings.sell_shop_blip, 0.80) - local point = lib.points.new({ - coords = Config.sellShop.coords, - distance = 30, - }) + CreateThread(function() + local ped, textUI + CreateBlip(Config.sellShop.coords, 356, 1, Strings.sell_shop_blip, 0.80) + local point = lib.points.new({ + coords = Config.sellShop.coords, + distance = 30, + }) - function point:nearby() - if self.currentDistance < self.distance then - if not ped then - lib.requestAnimDict("mini@strip_club@idles@bouncer@base", 100) - lib.requestModel(Config.sellShop.ped, 100) - ped = CreatePed( - 28, - Config.sellShop.ped, - Config.sellShop.coords.x, - Config.sellShop.coords.y, - Config.sellShop.coords.z, - Config.sellShop.heading, - false, - false - ) - FreezeEntityPosition(ped, true) - SetEntityInvincible(ped, true) - SetBlockingOfNonTemporaryEvents(ped, true) - TaskPlayAnim(ped, "mini@strip_club@idles@bouncer@base", "base", 8.0, 0.0, -1, 1, 0, 0, 0, 0) - end - if self.currentDistance <= 1.8 then - if not textUI then - lib.showTextUI(Strings.sell_fish) - textUI = true - end - if IsControlJustReleased(0, 38) then - FishingSellItems() - end - elseif self.currentDistance >= 1.9 and textUI then - lib.hideTextUI() - textUI = nil - end - end - end + function point:nearby() + if self.currentDistance < self.distance then + if not ped then + lib.requestAnimDict("mini@strip_club@idles@bouncer@base", 100) + lib.requestModel(Config.sellShop.ped, 100) + ped = CreatePed(28, Config.sellShop.ped, Config.sellShop.coords.x, Config.sellShop.coords.y, Config.sellShop.coords.z, Config.sellShop.heading, false, false) + FreezeEntityPosition(ped, true) + SetEntityInvincible(ped, true) + SetBlockingOfNonTemporaryEvents(ped, true) + TaskPlayAnim(ped, "mini@strip_club@idles@bouncer@base", "base", 8.0, 0.0, -1, 1, 0, 0, 0, 0) + end + if self.currentDistance <= 1.8 then + if not textUI then + lib.showTextUI(Strings.sell_fish) + textUI = true + end + if IsControlJustReleased(0, 38) then + FishingSellItems() + end + elseif self.currentDistance >= 1.9 and textUI then + lib.hideTextUI() + textUI = nil + end + end + end - function point:onExit() - if ped then - local model = GetEntityModel(ped) - SetModelAsNoLongerNeeded(model) - DeletePed(ped) - SetPedAsNoLongerNeeded(ped) - RemoveAnimDict("mini@strip_club@idles@bouncer@base") - ped = nil - end - end - end) + function point:onExit() + if ped then + local model = GetEntityModel(ped) + SetModelAsNoLongerNeeded(model) + DeletePed(ped) + SetPedAsNoLongerNeeded(ped) + RemoveAnimDict("mini@strip_club@idles@bouncer@base") + ped = nil + end + end + end) end RegisterNetEvent("wasabi_fishing:startFishing", function() - if IsPedInAnyVehicle(cache.ped) or IsPedSwimming(cache.ped) then - TriggerEvent("wasabi_fishing:notify", Strings.cannot_perform, Strings.cannot_perform_desc, "error") - return - end - local hasItem = lib.callback.await("wasabi_fishing:checkItem", 100, Config.bait.itemName) - if hasItem then - local water, waterLoc = WaterCheck() - if water then - if not fishing then - fishing = true - local model = `prop_fishing_rod_01` - lib.requestModel(model, 100) - local pole = CreateObject(model, GetEntityCoords(cache.ped), true, false, false) - AttachEntityToEntity( - pole, - cache.ped, - GetPedBoneIndex(cache.ped, 18905), - 0.1, - 0.05, - 0, - 80.0, - 120.0, - 160.0, - true, - true, - false, - true, - 1, - true - ) - SetModelAsNoLongerNeeded(model) - lib.requestAnimDict("mini@tennis", 100) - lib.requestAnimDict("amb@world_human_stand_fishing@idle_a", 100) - TaskPlayAnim(cache.ped, "mini@tennis", "forehand_ts_md_far", 1.0, -1.0, 1.0, 48, 0, 0, 0, 0) - Wait(3000) - TaskPlayAnim( - cache.ped, - "amb@world_human_stand_fishing@idle_a", - "idle_c", - 1.0, - -1.0, - 1.0, - 11, - 0, - 0, - 0, - 0 - ) - while fishing do - Wait() - local unarmed = `WEAPON_UNARMED` - SetCurrentPedWeapon(ped, unarmed) - ShowHelp(Strings.intro_instruction) - DisableControlAction(0, 24, true) - if IsDisabledControlJustReleased(0, 24) then - TaskPlayAnim(cache.ped, "mini@tennis", "forehand_ts_md_far", 1.0, -1.0, 1.0, 48, 0, 0, 0, 0) - TriggerEvent("wasabi_fishing:notify", Strings.waiting_bite, Strings.waiting_bite_desc, "inform") - Wait(math.random(Config.timeForBite.min, Config.timeForBite.max)) - TriggerEvent("wasabi_fishing:notify", Strings.got_bite, Strings.got_bite_desc, "inform") - Wait(1000) - local fishData = lib.callback.await("wasabi_fishing:getFishData", 100) - if lib.skillCheck(fishData.difficulty) then - ClearPedTasks(cache.ped) - TryFish(fishData) - TaskPlayAnim( - cache.ped, - "amb@world_human_stand_fishing@idle_a", - "idle_c", - 1.0, - -1.0, - 1.0, - 11, - 0, - 0, - 0, - 0 - ) - else - local breakChance = math.random(1, 100) - if breakChance < Config.fishingRod.breakChance then - TriggerServerEvent("wasabi_fishing:rodBroke") - TriggerEvent( - "wasabi_fishing:notify", - Strings.rod_broke, - Strings.rod_broke_desc, - "error" - ) - ClearPedTasks(cache.ped) - fishing = false - break - end - TriggerEvent( - "wasabi_fishing:notify", - Strings.failed_fish, - Strings.failed_fish_desc, - "error" - ) - end - elseif IsControlJustReleased(0, 194) then - ClearPedTasks(cache.ped) - break - elseif #(GetEntityCoords(cache.ped) - waterLoc) > 30 then - break - end - end - fishing = false - DeleteObject(pole) - RemoveAnimDict("mini@tennis") - RemoveAnimDict("amb@world_human_stand_fishing@idle_a") - end - else - TriggerEvent("wasabi_fishing:notify", Strings.no_water, Strings.no_water_desc, "error") - end - else - TriggerEvent("wasabi_fishing:notify", Strings.no_bait, Strings.no_bait_desc, "error") - end + if IsPedInAnyVehicle(cache.ped) or IsPedSwimming(cache.ped) then + TriggerEvent("wasabi_fishing:notify", Strings.cannot_perform, Strings.cannot_perform_desc, "error") + return + end + local hasItem = lib.callback.await("wasabi_fishing:checkItem", 100, Config.bait.itemName) + if hasItem then + local water, waterLoc = WaterCheck() + if water then + if not fishing then + fishing = true + local model = `prop_fishing_rod_01` + lib.requestModel(model, 100) + local pole = CreateObject(model, GetEntityCoords(cache.ped), true, false, false) + AttachEntityToEntity(pole, cache.ped, GetPedBoneIndex(cache.ped, 18905), 0.1, 0.05, 0, 80.0, 120.0, 160.0, true, true, false, true, 1, true) + SetModelAsNoLongerNeeded(model) + lib.requestAnimDict("mini@tennis", 100) + lib.requestAnimDict("amb@world_human_stand_fishing@idle_a", 100) + TaskPlayAnim(cache.ped, "mini@tennis", "forehand_ts_md_far", 1.0, -1.0, 1.0, 48, 0, 0, 0, 0) + Wait(3000) + TaskPlayAnim(cache.ped, "amb@world_human_stand_fishing@idle_a", "idle_c", 1.0, -1.0, 1.0, 11, 0, 0, 0, 0) + while fishing do + Wait() + local unarmed = `WEAPON_UNARMED` + SetCurrentPedWeapon(ped, unarmed) + ShowHelp(Strings.intro_instruction) + DisableControlAction(0, 24, true) + if IsDisabledControlJustReleased(0, 24) then + TaskPlayAnim(cache.ped, "mini@tennis", "forehand_ts_md_far", 1.0, -1.0, 1.0, 48, 0, 0, 0, 0) + TriggerEvent("wasabi_fishing:notify", Strings.waiting_bite, Strings.waiting_bite_desc, "inform") + Wait(math.random(Config.timeForBite.min, Config.timeForBite.max)) + TriggerEvent("wasabi_fishing:notify", Strings.got_bite, Strings.got_bite_desc, "inform") + Wait(1000) + local fishData = lib.callback.await("wasabi_fishing:getFishData", 100) + if lib.skillCheck(fishData.difficulty) then + ClearPedTasks(cache.ped) + TryFish(fishData) + TaskPlayAnim(cache.ped, "amb@world_human_stand_fishing@idle_a", "idle_c", 1.0, -1.0, 1.0, 11, 0, 0, 0, 0) + else + local breakChance = math.random(1, 100) + if breakChance < Config.fishingRod.breakChance then + TriggerServerEvent("wasabi_fishing:rodBroke") + TriggerEvent("wasabi_fishing:notify", Strings.rod_broke, Strings.rod_broke_desc, "error") + ClearPedTasks(cache.ped) + fishing = false + break + end + TriggerEvent("wasabi_fishing:notify", Strings.failed_fish, Strings.failed_fish_desc, "error") + end + elseif IsControlJustReleased(0, 194) then + ClearPedTasks(cache.ped) + break + elseif #(GetEntityCoords(cache.ped) - waterLoc) > 30 then + break + end + end + fishing = false + DeleteObject(pole) + RemoveAnimDict("mini@tennis") + RemoveAnimDict("amb@world_human_stand_fishing@idle_a") + end + else + TriggerEvent("wasabi_fishing:notify", Strings.no_water, Strings.no_water_desc, "error") + end + else + TriggerEvent("wasabi_fishing:notify", Strings.no_bait, Strings.no_bait_desc, "error") + end end) RegisterNetEvent("wasabi_fishing:interupt", function() - fishing = false - ClearPedTasks(cache.ped) + fishing = false + ClearPedTasks(cache.ped) end) diff --git a/server-data/resources/[wasabi]/wasabi_fishing/client/functions.lua b/server-data/resources/[wasabi]/wasabi_fishing/client/functions.lua index 25acbe5d2..ffce76cff 100644 --- a/server-data/resources/[wasabi]/wasabi_fishing/client/functions.lua +++ b/server-data/resources/[wasabi]/wasabi_fishing/client/functions.lua @@ -1,33 +1,32 @@ ShowHelp = function(msg) - BeginTextCommandDisplayHelp("STRING") - AddTextComponentSubstringPlayerName(msg) - EndTextCommandDisplayHelp(0, false, true, -1) + BeginTextCommandDisplayHelp("STRING") + AddTextComponentSubstringPlayerName(msg) + EndTextCommandDisplayHelp(0, false, true, -1) end WaterCheck = function() - local headPos = GetPedBoneCoords(cache.ped, 31086, 0.0, 0.0, 0.0) - local offsetPos = GetOffsetFromEntityInWorldCoords(cache.ped, 0.0, 50.0, -25.0) - local water, waterPos = - TestProbeAgainstWater(headPos.x, headPos.y, headPos.z, offsetPos.x, offsetPos.y, offsetPos.z) - return water, waterPos + local headPos = GetPedBoneCoords(cache.ped, 31086, 0.0, 0.0, 0.0) + local offsetPos = GetOffsetFromEntityInWorldCoords(cache.ped, 0.0, 50.0, -25.0) + local water, waterPos = TestProbeAgainstWater(headPos.x, headPos.y, headPos.z, offsetPos.x, offsetPos.y, offsetPos.z) + return water, waterPos end CreateBlip = function(coords, sprite, colour, text, scale) - local blip = AddBlipForCoord(coords) - SetBlipSprite(blip, sprite) - SetBlipColour(blip, colour) - SetBlipAsShortRange(blip, true) - SetBlipScale(blip, scale) - AddTextEntry(text, text) - BeginTextCommandSetBlipName(text) - EndTextCommandSetBlipName(blip) - return blip + local blip = AddBlipForCoord(coords) + SetBlipSprite(blip, sprite) + SetBlipColour(blip, colour) + SetBlipAsShortRange(blip, true) + SetBlipScale(blip, scale) + AddTextEntry(text, text) + BeginTextCommandSetBlipName(text) + EndTextCommandSetBlipName(blip) + return blip end TryFish = function(data) - TriggerServerEvent("wasabi_fishing:tryFish", data) + TriggerServerEvent("wasabi_fishing:tryFish", data) end FishingSellItems = function() - TriggerServerEvent("wasabi_fishing:sellFish") + TriggerServerEvent("wasabi_fishing:sellFish") end diff --git a/server-data/resources/[wasabi]/wasabi_fishing/configuration/config.lua b/server-data/resources/[wasabi]/wasabi_fishing/configuration/config.lua index 9a6dd7c71..af35a17b4 100644 --- a/server-data/resources/[wasabi]/wasabi_fishing/configuration/config.lua +++ b/server-data/resources/[wasabi]/wasabi_fishing/configuration/config.lua @@ -5,48 +5,48 @@ Config.checkForUpdates = true -- Check for updates? Config.oldESX = false -- Nothing to do with qb / Essentially when set to true it disables the check of if player can carry item Config.sellShop = { - enabled = true, - coords = vec3(-1612.19, -989.18, 13.01 - 0.9), -- X, Y, Z Coords of where fish buyer will spawn - heading = 45.3, -- Heading of fish buyer ped - ped = "cs_old_man2", -- Ped name here + enabled = true, + coords = vec3(-1612.19, -989.18, 13.01 - 0.9), -- X, Y, Z Coords of where fish buyer will spawn + heading = 45.3, -- Heading of fish buyer ped + ped = "cs_old_man2", -- Ped name here } Config.bait = { - itemName = "fishbait", -- Item name of bait - loseChance = 65, -- Chance of loosing bait(Setting to 100 will use bait every cast) + itemName = "fishbait", -- Item name of bait + loseChance = 65, -- Chance of loosing bait(Setting to 100 will use bait every cast) } Config.fishingRod = { - itemName = "fishingrod", -- Item name of fishing rod - breakChance = 25, --Chance of breaking pole when failing skillbar (Setting to 0 means never break) + itemName = "fishingrod", -- Item name of fishing rod + breakChance = 25, --Chance of breaking pole when failing skillbar (Setting to 0 means never break) } Config.timeForBite = { -- Set min and max random range of time it takes for fish to be on the line. - min = 2 * seconds, - max = 20 * seconds, + min = 2 * seconds, + max = 20 * seconds, } Config.fish = { - { item = "tuna", label = "Tuna", price = { 300, 550 }, difficulty = { "medium", "easy", "easy" } }, -- name is the item name of the fish(must be in DB of items) / Price is the range of price it will sell to fish buyer / difficulty is how many & how hard skillcheck is - { item = "salmon", label = "Salmon", price = { 235, 300 }, difficulty = { "medium", "easy" } }, - { item = "trout", label = "Trout", price = { 190, 235 }, difficulty = { "easy", "easy" } }, - { item = "anchovy", label = "Anchovy", price = { 100, 190 }, difficulty = { "easy" } }, + { item = "tuna", label = "Tuna", price = { 300, 550 }, difficulty = { "medium", "easy", "easy" } }, -- name is the item name of the fish(must be in DB of items) / Price is the range of price it will sell to fish buyer / difficulty is how many & how hard skillcheck is + { item = "salmon", label = "Salmon", price = { 235, 300 }, difficulty = { "medium", "easy" } }, + { item = "trout", label = "Trout", price = { 190, 235 }, difficulty = { "easy", "easy" } }, + { item = "anchovy", label = "Anchovy", price = { 100, 190 }, difficulty = { "easy" } }, } RegisterNetEvent("wasabi_fishing:notify") AddEventHandler("wasabi_fishing:notify", function(title, message, msgType) - -- Place notification system info here, ex: exports['mythic_notify']:SendAlert('inform', message) - if not msgType then - lib.notify({ - title = title, - description = message, - type = "inform", - }) - else - lib.notify({ - title = title, - description = message, - type = msgType, - }) - end + -- Place notification system info here, ex: exports['mythic_notify']:SendAlert('inform', message) + if not msgType then + lib.notify({ + title = title, + description = message, + type = "inform", + }) + else + lib.notify({ + title = title, + description = message, + type = msgType, + }) + end end) diff --git a/server-data/resources/[wasabi]/wasabi_fishing/configuration/strings.lua b/server-data/resources/[wasabi]/wasabi_fishing/configuration/strings.lua index d3c7eb2f7..90e71e2ca 100644 --- a/server-data/resources/[wasabi]/wasabi_fishing/configuration/strings.lua +++ b/server-data/resources/[wasabi]/wasabi_fishing/configuration/strings.lua @@ -1,28 +1,28 @@ Strings = { - intro_instruction = "Press ~INPUT_ATTACK~ to cast line, ~INPUT_FRONTEND_RRIGHT~ to cancel.", - rod_broke = "Rod Snapped", - rod_broke_desc = "You pulled to hard and your fishing rod snapped!", - cannot_perform = "Action Incomplete", - cannot_perform_desc = "You cannot do this right now.", - failed = "Failed", - failed_fish = "You failed to catch fish!", - no_water = "No Water", - no_water_desc = "You are not facing any water.", - no_bait = "Missing Bait", - no_bait_desc = "You don't have fishing bait.", - bait_lost = "Bait Lost", - bait_lost_desc = "Fishing bait was lost.", - fish_success = "Caught Fish", - fish_success_desc = "You caught a %s!", - sell_shop_blip = "Fish Market", - sell_fish = "[E] - Sell Fish", - kicked = "Nice try, please do not attempt to exploit!", - sold_for = "Sold Fish", - sold_for_desc = "You sold %sx %s for $%s", - got_bite = "Bite Detected", - got_bite_desc = "Your pole has a fish on the line, get ready!", - waiting_bite = "Awaiting Bite", - waiting_bite_desc = "Please wait for a fish to bite your hook.", - cannot_carry = "Cannot Carry", - cannot_carry_desc = "You cannot carry reward!", + intro_instruction = "Press ~INPUT_ATTACK~ to cast line, ~INPUT_FRONTEND_RRIGHT~ to cancel.", + rod_broke = "Rod Snapped", + rod_broke_desc = "You pulled to hard and your fishing rod snapped!", + cannot_perform = "Action Incomplete", + cannot_perform_desc = "You cannot do this right now.", + failed = "Failed", + failed_fish = "You failed to catch fish!", + no_water = "No Water", + no_water_desc = "You are not facing any water.", + no_bait = "Missing Bait", + no_bait_desc = "You don't have fishing bait.", + bait_lost = "Bait Lost", + bait_lost_desc = "Fishing bait was lost.", + fish_success = "Caught Fish", + fish_success_desc = "You caught a %s!", + sell_shop_blip = "Fish Market", + sell_fish = "[E] - Sell Fish", + kicked = "Nice try, please do not attempt to exploit!", + sold_for = "Sold Fish", + sold_for_desc = "You sold %sx %s for $%s", + got_bite = "Bite Detected", + got_bite_desc = "Your pole has a fish on the line, get ready!", + waiting_bite = "Awaiting Bite", + waiting_bite_desc = "Please wait for a fish to bite your hook.", + cannot_carry = "Cannot Carry", + cannot_carry_desc = "You cannot carry reward!", } diff --git a/server-data/resources/[wasabi]/wasabi_fishing/server/server.lua b/server-data/resources/[wasabi]/wasabi_fishing/server/server.lua index ddc327bdc..01401b920 100644 --- a/server-data/resources/[wasabi]/wasabi_fishing/server/server.lua +++ b/server-data/resources/[wasabi]/wasabi_fishing/server/server.lua @@ -1,110 +1,82 @@ local addCommas = function(n) - return tostring(math.floor(n)):reverse():gsub("(%d%d%d)", "%1,"):gsub(",(%-?)$", "%1"):reverse() + return tostring(math.floor(n)):reverse():gsub("(%d%d%d)", "%1,"):gsub(",(%-?)$", "%1"):reverse() end lib.callback.register("wasabi_fishing:checkItem", function(source, itemname) - local item = HasItem(source, itemname) - if item >= 1 then - return true - else - return false - end + local item = HasItem(source, itemname) + if item >= 1 then + return true + else + return false + end end) lib.callback.register("wasabi_fishing:getFishData", function(source) - local data = Config.fish[math.random(#Config.fish)] - return data + local data = Config.fish[math.random(#Config.fish)] + return data end) RegisterNetEvent("wasabi_fishing:rodBroke", function() - RemoveItem(source, Config.fishingRod.itemName, 1) - TriggerClientEvent("wasabi_fishing:interupt", source) + RemoveItem(source, Config.fishingRod.itemName, 1) + TriggerClientEvent("wasabi_fishing:interupt", source) end) RegisterNetEvent("wasabi_fishing:tryFish", function(data) - local xPole = HasItem(source, Config.fishingRod.itemName) - local xBait = HasItem(source, Config.bait.itemName) - if xPole > 0 and xBait > 0 then - local chance = math.random(1, 100) - if chance <= Config.bait.loseChance then - RemoveItem(source, Config.bait.itemName, 1) - TriggerClientEvent("wasabi_fishing:notify", source, Strings.bait_lost, Strings.bait_lost_desc, "error") - end - if Framework == "esx" and not Config.oldESX then - local player = GetPlayer(source) - if player.canCarryItem(data.item, 1) then - AddItem(source, data.item, 1) - TriggerClientEvent( - "wasabi_fishing:notify", - source, - Strings.fish_success, - string.format(Strings.fish_success_desc, data.label), - "success" - ) - else - TriggerClientEvent( - "wasabi_fishing:notify", - source, - Strings.cannot_carry, - Strings.cannot_carry_desc, - "error" - ) - end - else - AddItem(source, data.item, 1) - TriggerClientEvent( - "wasabi_fishing:notify", - source, - Strings.fish_success, - string.format(Strings.fish_success_desc, data.label), - "success" - ) - end - elseif xPole > 0 and xBait < 1 then - TriggerClientEvent("wasabi_fishing:interupt", source) - TriggerClientEvent("wasabi_fishing:notify", source, Strings.no_bait, Strings.no_bait_desc, "error") - elseif xPole < 1 then - KickPlayer(source, Strings.kicked) - end + local xPole = HasItem(source, Config.fishingRod.itemName) + local xBait = HasItem(source, Config.bait.itemName) + if xPole > 0 and xBait > 0 then + local chance = math.random(1, 100) + if chance <= Config.bait.loseChance then + RemoveItem(source, Config.bait.itemName, 1) + TriggerClientEvent("wasabi_fishing:notify", source, Strings.bait_lost, Strings.bait_lost_desc, "error") + end + if Framework == "esx" and not Config.oldESX then + local player = GetPlayer(source) + if player.canCarryItem(data.item, 1) then + AddItem(source, data.item, 1) + TriggerClientEvent("wasabi_fishing:notify", source, Strings.fish_success, string.format(Strings.fish_success_desc, data.label), "success") + else + TriggerClientEvent("wasabi_fishing:notify", source, Strings.cannot_carry, Strings.cannot_carry_desc, "error") + end + else + AddItem(source, data.item, 1) + TriggerClientEvent("wasabi_fishing:notify", source, Strings.fish_success, string.format(Strings.fish_success_desc, data.label), "success") + end + elseif xPole > 0 and xBait < 1 then + TriggerClientEvent("wasabi_fishing:interupt", source) + TriggerClientEvent("wasabi_fishing:notify", source, Strings.no_bait, Strings.no_bait_desc, "error") + elseif xPole < 1 then + KickPlayer(source, Strings.kicked) + end end) RegisterNetEvent("wasabi_fishing:sellFish", function() - local playerPed = GetPlayerPed(source) - local playerCoord = GetEntityCoords(playerPed) - local distance = #(playerCoord - Config.sellShop.coords) - if distance == nil then - KickPlayer(source, Strings.kicked) - return - end - if distance > 3 then - KickPlayer(source, Strings.kicked) - return - end - for i = 1, #Config.fish do - if HasItem(source, Config.fish[i].item) > 0 then - local rewardAmount = 0 - for j = 1, HasItem(source, Config.fish[i].item) do - rewardAmount = rewardAmount + math.random(Config.fish[i].price[1], Config.fish[i].price[2]) - end - if rewardAmount > 0 then - AddMoney(source, "money", rewardAmount) - TriggerClientEvent( - "wasabi_fishing:notify", - source, - Strings.sold_for, - (Strings.sold_for_desc):format( - HasItem(source, Config.fish[i].item), - Config.fish[i].label, - addCommas(rewardAmount) - ), - "success" - ) - RemoveItem(source, Config.fish[i].item, HasItem(source, Config.fish[i].item)) - end - end - end + local playerPed = GetPlayerPed(source) + local playerCoord = GetEntityCoords(playerPed) + local distance = #(playerCoord - Config.sellShop.coords) + if distance == nil then + KickPlayer(source, Strings.kicked) + return + end + if distance > 3 then + KickPlayer(source, Strings.kicked) + return + end + for i = 1, #Config.fish do + if HasItem(source, Config.fish[i].item) > 0 then + local rewardAmount = 0 + for j = 1, HasItem(source, Config.fish[i].item) do + rewardAmount = rewardAmount + math.random(Config.fish[i].price[1], Config.fish[i].price[2]) + end + if rewardAmount > 0 then + AddMoney(source, "money", rewardAmount) + TriggerClientEvent("wasabi_fishing:notify", source, Strings.sold_for, (Strings.sold_for_desc):format(HasItem(source, Config.fish[i].item), Config.fish[i].label, addCommas(rewardAmount)), "success") + RemoveItem(source, Config.fish[i].item, HasItem(source, Config.fish[i].item)) + end + end + end end) RegisterUsableItem(Config.fishingRod.itemName, function(source) - TriggerClientEvent("wasabi_fishing:startFishing", source) + TriggerClientEvent("wasabi_fishing:startFishing", source) end) diff --git a/server-data/resources/[wasabi]/wasabi_fishing/server/updater.lua b/server-data/resources/[wasabi]/wasabi_fishing/server/updater.lua index bab52a051..41ac9e7bb 100644 --- a/server-data/resources/[wasabi]/wasabi_fishing/server/updater.lua +++ b/server-data/resources/[wasabi]/wasabi_fishing/server/updater.lua @@ -2,66 +2,58 @@ local curVersion = GetResourceMetadata(GetCurrentResourceName(), "version") local resourceName = "wasabi_fishing" if Config.checkForUpdates then - CreateThread(function() - if GetCurrentResourceName() ~= "wasabi_fishing" then - resourceName = "wasabi_fishing (" .. GetCurrentResourceName() .. ")" - end - end) - - CreateThread(function() - while true do - PerformHttpRequest( - "https://api.github.com/repos/wasabirobby/wasabi_fishing/releases/latest", - CheckVersion, - "GET" - ) - Wait(3600000) - end - end) - - CheckVersion = function(err, responseText, headers) - local repoVersion, repoURL, repoBody = GetRepoInformations() - - CreateThread(function() - if curVersion ~= repoVersion then - Wait(4000) - print("^0[^3WARNING^0] " .. resourceName .. " is ^1NOT ^0up to date!") - print("^0[^3WARNING^0] Your Version: ^2" .. curVersion .. "^0") - print("^0[^3WARNING^0] Latest Version: ^2" .. repoVersion .. "^0") - print("^0[^3WARNING^0] Get the latest Version from: ^2" .. repoURL .. "^0") - print("^0[^3WARNING^0] Changelog:^0") - print("^1" .. repoBody .. "^0") - else - Wait(4000) - print("^0[^2INFO^0] " .. resourceName .. " is up to date! (^2" .. curVersion .. "^0)") - end - end) - end - - GetRepoInformations = function() - local repoVersion, repoURL, repoBody = nil, nil, nil - - PerformHttpRequest( - "https://api.github.com/repos/wasabirobby/wasabi_fishing/releases/latest", - function(err, response, headers) - if err == 200 then - local data = json.decode(response) - - repoVersion = data.tag_name - repoURL = data.html_url - repoBody = data.body - else - repoVersion = curVersion - repoURL = "https://github.com/wasabirobby/wasabi_fishing" - end - end, - "GET" - ) - - repeat - Wait(50) - until repoVersion and repoURL and repoBody - - return repoVersion, repoURL, repoBody - end + CreateThread(function() + if GetCurrentResourceName() ~= "wasabi_fishing" then + resourceName = "wasabi_fishing (" .. GetCurrentResourceName() .. ")" + end + end) + + CreateThread(function() + while true do + PerformHttpRequest("https://api.github.com/repos/wasabirobby/wasabi_fishing/releases/latest", CheckVersion, "GET") + Wait(3600000) + end + end) + + CheckVersion = function(err, responseText, headers) + local repoVersion, repoURL, repoBody = GetRepoInformations() + + CreateThread(function() + if curVersion ~= repoVersion then + Wait(4000) + print("^0[^3WARNING^0] " .. resourceName .. " is ^1NOT ^0up to date!") + print("^0[^3WARNING^0] Your Version: ^2" .. curVersion .. "^0") + print("^0[^3WARNING^0] Latest Version: ^2" .. repoVersion .. "^0") + print("^0[^3WARNING^0] Get the latest Version from: ^2" .. repoURL .. "^0") + print("^0[^3WARNING^0] Changelog:^0") + print("^1" .. repoBody .. "^0") + else + Wait(4000) + print("^0[^2INFO^0] " .. resourceName .. " is up to date! (^2" .. curVersion .. "^0)") + end + end) + end + + GetRepoInformations = function() + local repoVersion, repoURL, repoBody = nil, nil, nil + + PerformHttpRequest("https://api.github.com/repos/wasabirobby/wasabi_fishing/releases/latest", function(err, response, headers) + if err == 200 then + local data = json.decode(response) + + repoVersion = data.tag_name + repoURL = data.html_url + repoBody = data.body + else + repoVersion = curVersion + repoURL = "https://github.com/wasabirobby/wasabi_fishing" + end + end, "GET") + + repeat + Wait(50) + until repoVersion and repoURL and repoBody + + return repoVersion, repoURL, repoBody + end end From 6bea959a91439bac1dbe969eb86bf564889dcc0c Mon Sep 17 00:00:00 2001 From: bitpredator <67551273+bitpredator@users.noreply.github.com> Date: Tue, 6 Aug 2024 18:36:13 +0200 Subject: [PATCH 10/13] chore: Implements the 9mm pistol to the crafting system --- .../bpt_crafting/bpt_crafting.sql | 3 ++- .../[bpt_addons]/bpt_crafting/config.lua | 18 ++++++++++++++++++ .../bpt_crafting/html/img/WEAPON_PISTOL.png | Bin 0 -> 15884 bytes .../bpt_crafting/html/img/steel.png | Bin 0 -> 13588 bytes .../localization/bpt_crafting_it.sql | 5 +++-- 5 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 server-data/resources/[bpt_addons]/bpt_crafting/html/img/WEAPON_PISTOL.png create mode 100644 server-data/resources/[bpt_addons]/bpt_crafting/html/img/steel.png diff --git a/server-data/resources/[bpt_addons]/bpt_crafting/bpt_crafting.sql b/server-data/resources/[bpt_addons]/bpt_crafting/bpt_crafting.sql index 4516ed73e..ef27f7a34 100644 --- a/server-data/resources/[bpt_addons]/bpt_crafting/bpt_crafting.sql +++ b/server-data/resources/[bpt_addons]/bpt_crafting/bpt_crafting.sql @@ -49,5 +49,6 @@ INSERT INTO `bpt_items` (`name`, `label`) VALUES ('steel', 'steel'), ('plastic_bag', 'Plastic bag'), ('recycled_plastic', 'Recycled plastic'), - ('WEAPON_NIGHTSTICK', 'NIGHTSTICK') + ('WEAPON_NIGHTSTICK', 'NIGHTSTICK'), + ('WEAPON_PISTOL', 'Pistol') ; \ No newline at end of file diff --git a/server-data/resources/[bpt_addons]/bpt_crafting/config.lua b/server-data/resources/[bpt_addons]/bpt_crafting/config.lua index 6c53bcb72..e14303a1b 100644 --- a/server-data/resources/[bpt_addons]/bpt_crafting/config.lua +++ b/server-data/resources/[bpt_addons]/bpt_crafting/config.lua @@ -248,6 +248,23 @@ Config = { }, }, + ["WEAPON_PISTOL"] = { + Level = 10, + Category = "ammu", + isGun = false, + Jobs = { "ammu" }, + JobGrades = {}, + Amount = 1, + SuccessRate = 100, + requireBlueprint = false, + Time = 180, + Ingredients = { + ["copper"] = 1, + ["iron"] = 3, + ["wood"] = 1, + ["steel"] = 5, + }, + }, ["ammo-sniper"] = { Level = 10, Category = "ammu", @@ -441,6 +458,7 @@ Config = { "WEAPON_KNIFE", "WEAPON_KNUCKLE", "WEAPON_NIGHTSTICK", + "WEAPON_PISTOL", }, radius = 1.0, }, diff --git a/server-data/resources/[bpt_addons]/bpt_crafting/html/img/WEAPON_PISTOL.png b/server-data/resources/[bpt_addons]/bpt_crafting/html/img/WEAPON_PISTOL.png new file mode 100644 index 0000000000000000000000000000000000000000..cd6a82d21c9f83f759c27e4c285396c0b5dae770 GIT binary patch literal 15884 zcmcJ$2RNMF+BS?xf`}l|OY{(i8K$byTXcyQVww_V$mpHuJ$lq=(Ia{%dh~>ZL@z-Q zod|+&^6ck%-u?gI-tW7Q@Bcr?G56f}%(c#SUFW*id9Ae&rmd-bor0Nyh=}OAs)~Xx z;T`k)MRtX7by!T)C%ln6s2Jgih_2oI{URnxO=lz+7hCHaIvHx*7f0jlgpn8=3M=ep z=RmL~B9fGGb3mePuudE(tfjTR6xViB8yAN)MvBV-q5;%!kjGkCt9U%c>Un7DqdjcU z2n?5uG>4>{I03*8>xATRv$M6wi@Qm2{ede^xc~jJ2p7j6CQdd|T(ZAAAqoT`M1XJ+kQe|65(h%XAux_Vf4B&}J;hjv>nbSy z*%#qSip$E$$w6F1#MRYR*i}pz_ta7Zgg_85L`6hJ0R#&G-re2_=?1XJbN_{)fW@Pq zT01ydPRD`jyAo;+|^YFa*xUeouuzQc_&S8c!HH_dh3>9@g>CJ6mgxKeA99iT*uN zq`1((2N{du`txJ!f5Fp#=FvZ3U9GSL(En!e|6zv5Sva{OpJHV#37r0q$tCjdoW~S1SIWxc(=tXe*?> zC6=JNB3%FH!GK^GFa!+*0#JnX1i%nr1OSe~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8~G%ge%AFAQe_1%{)?j z(lQ*q)5?%e@9!AQC89$f!P2M0H1)MVl_vNa;ZM!wtWe3_+mhhnlbt1ngL8%TklN2O zjYQ4&P8b(v{&+Zug_tc_%S-3C-$QYG|ril-hHCy0xFJ zd9;wnQ~flgvC;P9L--1@e4ehbNHOqTLoG*#cX6rfsd#})l*v>fIA7seAnsS7cM(}_ zPy6-gqww_D*#fG&zOj~1d`jbJ(UhK^m!9m0o~%pVs_~o0_G!NrryRv!RdGf>VR`n} zaH@22aojzd^J+(Wd@RJCuY5~{a5fNe5a~!I5Ln^t9iJOts&#*xN$rFq{N@nG*uit( zY|LXvTiL@&+$kV}b$o$ERy@GlruLwzv*=x#nKSy)rPtI$fXHe8xc%sU1Z#jII+^;r zNZk?pQg+#=G9#lI9s#~eu~ci+tspZIXKkL}lMW(SDb9pgJ+*B)`C%d<`c zY;i?nCsScNGE#tzf<)bKDwXeo>iKM6=qLH)SVMHYZx#f2tU@G zZaux&s5a~h@@%~KS!72)WP|C($@!u?r%TeacH%qC`Ht!5{9>e3ucs9UI(I8Knu`li;P3y}R#ntgcr9lh@V@{v4yGjl literal 0 HcmV?d00001 diff --git a/server-data/resources/[bpt_addons]/bpt_crafting/html/img/steel.png b/server-data/resources/[bpt_addons]/bpt_crafting/html/img/steel.png new file mode 100644 index 0000000000000000000000000000000000000000..251f032f10d4c86b0ae034160b7c2f332d670a75 GIT binary patch literal 13588 zcmV+vHS5ZWP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h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8_U&O2}So+19FUzWc0fJBAM zI`e@K{r(^PSRx#)R)aK6P)YElN+3%WOG``q?jL-b*_jTv9y>sLYMMtLe+Ims=nYw# zu(nq41ApTu+3fe}4+liIalGV9Pb!KHKb#-D>kYRoEiL}yt*>~+4;{Sv$Q$#l^Pbg} z!SaO%q7rTDCm(*~kt>$wrf9ZW zsMx^AH@9`VEryln$A9MEF+0^JkqL*cOnApzZs$Gk`y`hw%`(3*kMnT+#CiVTfB#;Z zokqNcCkdB>xh|jKtBKQW2Q9jfw`u-Jj+s4T?WGuMP=9+Rvfu%H@kPva?gX0^L?+q73Ty`+IL?Kmzw-y~w zL}{ZLj7Au1QAu*9uIsyb8Lmqf-8^g3ZneLfH0J-oU|1nUIH5E%JjS%?B=ASU1KPX6L)ydgEb|G!4JCCptZ(R2QB85B=oY`ubqk&Yd4WeB{_&v(r2O zx;Nr;-+SA2dTDVUV=TAdcYdx&=yp|T*II(y2~ z{I|<%YwuF2?C#yYz$vMUUGZ+mybM`## zc5}3Q_tN{MQXi;_ov(l0_bmTZe=vObwp(uaKkBjyY;AOdC@C@DCE4(z1Ck^ubrmjr zY;{^3IeO%mH#Rnx&z(E-qsEl4fAi~ZPoI4HInJG135Z!rB=GjT-td}sD}O+#Bph<_ zj#}5uH|A*M86dQ4w?FzrfAz0?{DFrbw%&S@G{IH&B}(pGMvj2+xK^*eonhIwv2*?}R+Rnz#|EjhAog1&y zfA_gl7yj{y=T1NIgKvBDQ6Uv&Rnl%YDa!(tCI~6GuzZ1Hbj9^?TsgV ze6;2ZDdI8aF!^M8qkr_s(SN>Y&)&QL=$?C4k|d=lOOohmb>7l!wip&8@~p|JGiSJL z@7}*uY4kf~iS3v49WeH8ukCF Date: Tue, 6 Aug 2024 18:36:41 +0200 Subject: [PATCH 11/13] fix: attempt to index a nil value (upvalue 'status') --- .../resources/[bpt_addons]/bpt_basicneeds/client/main.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server-data/resources/[bpt_addons]/bpt_basicneeds/client/main.lua b/server-data/resources/[bpt_addons]/bpt_basicneeds/client/main.lua index 2f59bb3c2..ec0e3d965 100644 --- a/server-data/resources/[bpt_addons]/bpt_basicneeds/client/main.lua +++ b/server-data/resources/[bpt_addons]/bpt_basicneeds/client/main.lua @@ -32,13 +32,13 @@ end) AddEventHandler("bpt_status:loaded", function(status) TriggerEvent("bpt_status:registerStatus", "hunger", 1000000, "#CFAD0F", function(status) return Config.Visible - end, function() + end, function(status) status.remove(100) end) TriggerEvent("bpt_status:registerStatus", "thirst", 1000000, "#0C98F1", function() return Config.Visible - end, function() + end, function(status) status.remove(75) end) end) From 98433a536310af323ce008b932707b2ec4bac0fc Mon Sep 17 00:00:00 2001 From: bitpredator <67551273+bitpredator@users.noreply.github.com> Date: Tue, 6 Aug 2024 19:01:42 +0200 Subject: [PATCH 12/13] =?UTF-8?q?chore:=20=F0=9F=8E=A8=20Run=20formatter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/[bpt_addons]/bpt_farmer/LICENSE | 2 +- .../bpt_farmer/client/animated.lua | 20 +- .../[bpt_addons]/bpt_farmer/client/main.lua | 374 +++++++++--------- .../[bpt_addons]/bpt_farmer/fxmanifest.lua | 18 +- .../[bpt_addons]/bpt_farmer/locales/en.lua | 4 +- .../[bpt_addons]/bpt_farmer/locales/it.lua | 4 +- .../[bpt_addons]/bpt_farmer/server/main.lua | 80 ++-- 7 files changed, 251 insertions(+), 251 deletions(-) diff --git a/server-data/resources/[bpt_addons]/bpt_farmer/LICENSE b/server-data/resources/[bpt_addons]/bpt_farmer/LICENSE index 6d9577f6a..2f3c94cc9 100644 --- a/server-data/resources/[bpt_addons]/bpt_farmer/LICENSE +++ b/server-data/resources/[bpt_addons]/bpt_farmer/LICENSE @@ -652,7 +652,7 @@ Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: - Copyright (C) 2022-2024 bitpredator + bpt_farmer Copyright (C) 2022-2024 bitpredator This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. diff --git a/server-data/resources/[bpt_addons]/bpt_farmer/client/animated.lua b/server-data/resources/[bpt_addons]/bpt_farmer/client/animated.lua index d365f2aa8..49c7f3d29 100644 --- a/server-data/resources/[bpt_addons]/bpt_farmer/client/animated.lua +++ b/server-data/resources/[bpt_addons]/bpt_farmer/client/animated.lua @@ -2,22 +2,22 @@ local playerPed RegisterNetEvent("farmer:freeze") AddEventHandler("farmer:freeze", function() - playerPed = PlayerPedId() - ClearPedTasks(PlayerPedId()) - FreezeEntityPosition(playerPed, true) + playerPed = PlayerPedId() + ClearPedTasks(PlayerPedId()) + FreezeEntityPosition(playerPed, true) end) RegisterNetEvent("farmer:unfreeze") AddEventHandler("farmer:freeze", function() - playerPed = PlayerPedId() - FreezeEntityPosition(playerPed, false) - ClearPedTasks(PlayerPedId()) + playerPed = PlayerPedId() + FreezeEntityPosition(playerPed, false) + ClearPedTasks(PlayerPedId()) end) RegisterNetEvent("farmer:anim") AddEventHandler("farmer:anim", function() - local lib, anim = "amb@prop_human_bum_bin@idle_b", "idle_d" - ESX.Streaming.RequestAnimDict(lib, function() - TaskPlayAnim(PlayerPedId(), lib, anim, 1.0, -3.0, 5000, 0, 0, false, false, false) - end) + local lib, anim = "amb@prop_human_bum_bin@idle_b", "idle_d" + ESX.Streaming.RequestAnimDict(lib, function() + TaskPlayAnim(PlayerPedId(), lib, anim, 1.0, -3.0, 5000, 0, 0, false, false, false) + end) end) diff --git a/server-data/resources/[bpt_addons]/bpt_farmer/client/main.lua b/server-data/resources/[bpt_addons]/bpt_farmer/client/main.lua index 6c9bdfe4d..8cb0b9fa0 100644 --- a/server-data/resources/[bpt_addons]/bpt_farmer/client/main.lua +++ b/server-data/resources/[bpt_addons]/bpt_farmer/client/main.lua @@ -1,79 +1,79 @@ local Keys = { - ["ESC"] = 322, - ["F1"] = 288, - ["F2"] = 289, - ["F3"] = 170, - ["F5"] = 166, - ["F6"] = 167, - ["F7"] = 168, - ["F8"] = 169, - ["F9"] = 56, - ["F10"] = 57, - ["~"] = 243, - ["1"] = 157, - ["2"] = 158, - ["3"] = 160, - ["4"] = 164, - ["5"] = 165, - ["6"] = 159, - ["7"] = 161, - ["8"] = 162, - ["9"] = 163, - ["-"] = 84, - ["="] = 83, - ["BACKSPACE"] = 177, - ["TAB"] = 37, - ["Q"] = 44, - ["W"] = 32, - ["E"] = 38, - ["R"] = 45, - ["T"] = 245, - ["Y"] = 246, - ["U"] = 303, - ["P"] = 199, - ["["] = 39, - ["]"] = 40, - ["ENTER"] = 18, - ["CAPS"] = 137, - ["A"] = 34, - ["S"] = 8, - ["D"] = 9, - ["F"] = 23, - ["G"] = 47, - ["H"] = 74, - ["K"] = 311, - ["L"] = 182, - ["LEFTSHIFT"] = 21, - ["Z"] = 20, - ["X"] = 73, - ["C"] = 26, - ["V"] = 0, - ["B"] = 29, - ["N"] = 249, - ["M"] = 244, - [","] = 82, - ["."] = 81, - ["LEFTCTRL"] = 36, - ["LEFTALT"] = 19, - ["SPACE"] = 22, - ["RIGHTCTRL"] = 70, - ["HOME"] = 213, - ["PAGEUP"] = 10, - ["PAGEDOWN"] = 11, - ["DELETE"] = 178, - ["LEFT"] = 174, - ["RIGHT"] = 175, - ["TOP"] = 27, - ["DOWN"] = 173, - ["NENTER"] = 201, - ["N4"] = 108, - ["N5"] = 60, - ["N6"] = 107, - ["N+"] = 96, - ["N-"] = 97, - ["N7"] = 117, - ["N8"] = 61, - ["N9"] = 118, + ["ESC"] = 322, + ["F1"] = 288, + ["F2"] = 289, + ["F3"] = 170, + ["F5"] = 166, + ["F6"] = 167, + ["F7"] = 168, + ["F8"] = 169, + ["F9"] = 56, + ["F10"] = 57, + ["~"] = 243, + ["1"] = 157, + ["2"] = 158, + ["3"] = 160, + ["4"] = 164, + ["5"] = 165, + ["6"] = 159, + ["7"] = 161, + ["8"] = 162, + ["9"] = 163, + ["-"] = 84, + ["="] = 83, + ["BACKSPACE"] = 177, + ["TAB"] = 37, + ["Q"] = 44, + ["W"] = 32, + ["E"] = 38, + ["R"] = 45, + ["T"] = 245, + ["Y"] = 246, + ["U"] = 303, + ["P"] = 199, + ["["] = 39, + ["]"] = 40, + ["ENTER"] = 18, + ["CAPS"] = 137, + ["A"] = 34, + ["S"] = 8, + ["D"] = 9, + ["F"] = 23, + ["G"] = 47, + ["H"] = 74, + ["K"] = 311, + ["L"] = 182, + ["LEFTSHIFT"] = 21, + ["Z"] = 20, + ["X"] = 73, + ["C"] = 26, + ["V"] = 0, + ["B"] = 29, + ["N"] = 249, + ["M"] = 244, + [","] = 82, + ["."] = 81, + ["LEFTCTRL"] = 36, + ["LEFTALT"] = 19, + ["SPACE"] = 22, + ["RIGHTCTRL"] = 70, + ["HOME"] = 213, + ["PAGEUP"] = 10, + ["PAGEDOWN"] = 11, + ["DELETE"] = 178, + ["LEFT"] = 174, + ["RIGHT"] = 175, + ["TOP"] = 27, + ["DOWN"] = 173, + ["NENTER"] = 201, + ["N4"] = 108, + ["N5"] = 60, + ["N6"] = 107, + ["N+"] = 96, + ["N-"] = 97, + ["N7"] = 117, + ["N8"] = 61, + ["N9"] = 118, } local incollect = false @@ -81,160 +81,160 @@ local incollect = false ESX = exports["es_extended"]:getSharedObject() RegisterNetEvent("esx:playerLoaded") AddEventHandler("esx:playerLoaded", function(xPlayer) - PlayerData = xPlayer + PlayerData = xPlayer end) function DrawText3D(x, y, z, text, scale) - local _, _x, _y = World3dToScreen2d(x, y, z) + local _, _x, _y = World3dToScreen2d(x, y, z) - SetTextScale(scale, scale) - SetTextFont(4) - SetTextProportional(1) - SetTextEntry("STRING") - SetTextCentre(1) - SetTextColour(255, 255, 255, 255) - SetTextOutline() + SetTextScale(scale, scale) + SetTextFont(4) + SetTextProportional(1) + SetTextEntry("STRING") + SetTextCentre(1) + SetTextColour(255, 255, 255, 255) + SetTextOutline() - AddTextComponentString(text) - DrawText(_x, _y) + AddTextComponentString(text) + DrawText(_x, _y) - local factor = (string.len(text)) / 370 - DrawRect(_x, _y + 0.0125, 0.015 + factor, 0.03, 41, 11, 41, 90) + local factor = (string.len(text)) / 370 + DrawRect(_x, _y + 0.0125, 0.015 + factor, 0.03, 41, 11, 41, 90) end -- collection potato CreateThread(function() - while true do - Wait(0) - local coords = GetEntityCoords(PlayerPedId()) - if GetDistanceBetweenCoords(coords, 2233.21, 5081.3, 48.08, true) < 10.0 then - DrawText3D(2233.21, 5081.3, 48.08, TranslateCap("press_collect"), 0.4) - if ESX.GetPlayerData().job.name then - if GetDistanceBetweenCoords(coords, 2233.21, 5081.3, 48.08, true) < 5.0 then - if IsControlJustReleased(0, Keys["E"]) then - if incollect == false then - collectionpotato() - end - end - end - end - end - end + while true do + Wait(0) + local coords = GetEntityCoords(PlayerPedId()) + if GetDistanceBetweenCoords(coords, 2233.21, 5081.3, 48.08, true) < 10.0 then + DrawText3D(2233.21, 5081.3, 48.08, TranslateCap("press_collect"), 0.4) + if ESX.GetPlayerData().job.name then + if GetDistanceBetweenCoords(coords, 2233.21, 5081.3, 48.08, true) < 5.0 then + if IsControlJustReleased(0, Keys["E"]) then + if incollect == false then + collectionpotato() + end + end + end + end + end + end end) -- collection cotton CreateThread(function() - while true do - Wait(0) - local coords = GetEntityCoords(PlayerPedId()) - if GetDistanceBetweenCoords(coords, 1582.035156, 2167.279053, 79.307007, true) < 10.0 then - DrawText3D(1582.035156, 2167.279053, 79.307007, TranslateCap("press_collect"), 0.4) - if ESX.GetPlayerData().job.name then - if GetDistanceBetweenCoords(coords, 1582.035156, 2167.279053, 79.307007, true) < 5.0 then - if IsControlJustReleased(0, Keys["E"]) then - if incollect == false then - collectioncotton() - end - end - end - end - end - end + while true do + Wait(0) + local coords = GetEntityCoords(PlayerPedId()) + if GetDistanceBetweenCoords(coords, 1582.035156, 2167.279053, 79.307007, true) < 10.0 then + DrawText3D(1582.035156, 2167.279053, 79.307007, TranslateCap("press_collect"), 0.4) + if ESX.GetPlayerData().job.name then + if GetDistanceBetweenCoords(coords, 1582.035156, 2167.279053, 79.307007, true) < 5.0 then + if IsControlJustReleased(0, Keys["E"]) then + if incollect == false then + collectioncotton() + end + end + end + end + end + end end) -- collection apple CreateThread(function() - while true do - Wait(0) - local coords = GetEntityCoords(PlayerPedId()) - if GetDistanceBetweenCoords(coords, 2343.850586, 4756.087891, 34.806641, true) < 10.0 then - DrawText3D(2343.850586, 4756.087891, 34.806641, TranslateCap("press_collect"), 0.4) - if ESX.GetPlayerData().job.name then - if GetDistanceBetweenCoords(coords, 2343.850586, 4756.087891, 34.806641, true) < 5.0 then - if IsControlJustReleased(0, Keys["E"]) then - if incollect == false then - collectionapple() - end - end - end - end - end - end + while true do + Wait(0) + local coords = GetEntityCoords(PlayerPedId()) + if GetDistanceBetweenCoords(coords, 2343.850586, 4756.087891, 34.806641, true) < 10.0 then + DrawText3D(2343.850586, 4756.087891, 34.806641, TranslateCap("press_collect"), 0.4) + if ESX.GetPlayerData().job.name then + if GetDistanceBetweenCoords(coords, 2343.850586, 4756.087891, 34.806641, true) < 5.0 then + if IsControlJustReleased(0, Keys["E"]) then + if incollect == false then + collectionapple() + end + end + end + end + end + end end) -- collection grain CreateThread(function() - while true do - Wait(0) - local coords = GetEntityCoords(PlayerPedId()) - if GetDistanceBetweenCoords(coords, 2607.942871, 4399.490234, 40.973633, true) < 10.0 then - DrawText3D(2607.942871, 4399.490234, 40.973633, TranslateCap("press_collect"), 0.4) - if ESX.GetPlayerData().job.name then - if GetDistanceBetweenCoords(coords, 2607.942871, 4399.490234, 40.973633, true) < 5.0 then - if IsControlJustReleased(0, Keys["E"]) then - if incollect == false then - collectiongrain() - end - end - end - end - end - end + while true do + Wait(0) + local coords = GetEntityCoords(PlayerPedId()) + if GetDistanceBetweenCoords(coords, 2607.942871, 4399.490234, 40.973633, true) < 10.0 then + DrawText3D(2607.942871, 4399.490234, 40.973633, TranslateCap("press_collect"), 0.4) + if ESX.GetPlayerData().job.name then + if GetDistanceBetweenCoords(coords, 2607.942871, 4399.490234, 40.973633, true) < 5.0 then + if IsControlJustReleased(0, Keys["E"]) then + if incollect == false then + collectiongrain() + end + end + end + end + end + end end) local blips = { - { title = "Potato harvest", colour = 0, id = 398, x = 2233.21, y = 5081.3, z = 48.08 }, - { title = "Cotton harvesting", colour = 0, id = 398, x = 1582.035156, y = 2167.279053, z = 79.307007 }, - { title = "Apple picking", colour = 0, id = 398, x = 2343.850586, y = 4756.087891, z = 34.806641 }, - { title = "Wheat harvest", colour = 0, id = 398, x = 2607.942871, y = 4399.490234, z = 40.973633 }, + { title = "Potato harvest", colour = 0, id = 398, x = 2233.21, y = 5081.3, z = 48.08 }, + { title = "Cotton harvesting", colour = 0, id = 398, x = 1582.035156, y = 2167.279053, z = 79.307007 }, + { title = "Apple picking", colour = 0, id = 398, x = 2343.850586, y = 4756.087891, z = 34.806641 }, + { title = "Wheat harvest", colour = 0, id = 398, x = 2607.942871, y = 4399.490234, z = 40.973633 }, } CreateThread(function() - for _, info in pairs(blips) do - info.blip = AddBlipForCoord(info.x, info.y, info.z) - SetBlipSprite(info.blip, info.id) - SetBlipDisplay(info.blip, 4) - SetBlipScale(info.blip, 0.85) - SetBlipColour(info.blip, info.colour) - SetBlipAsShortRange(info.blip, true) - BeginTextCommandSetBlipName("STRING") - AddTextComponentString(info.title) - EndTextCommandSetBlipName(info.blip) - end + for _, info in pairs(blips) do + info.blip = AddBlipForCoord(info.x, info.y, info.z) + SetBlipSprite(info.blip, info.id) + SetBlipDisplay(info.blip, 4) + SetBlipScale(info.blip, 0.85) + SetBlipColour(info.blip, info.colour) + SetBlipAsShortRange(info.blip, true) + BeginTextCommandSetBlipName("STRING") + AddTextComponentString(info.title) + EndTextCommandSetBlipName(info.blip) + end end) --potato function collectionpotato() - TriggerServerEvent("farmer:collectionpotato") - exports["esx_notify"]:Notify("info", 3000, TranslateCap("collection_progress")) - incollect = true - Wait(6000) - incollect = false + TriggerServerEvent("farmer:collectionpotato") + exports["esx_notify"]:Notify("info", 3000, TranslateCap("collection_progress")) + incollect = true + Wait(6000) + incollect = false end -- cotton function collectioncotton() - TriggerServerEvent("farmer:collectioncotton") - exports["esx_notify"]:Notify("info", 3000, TranslateCap("collection_progress")) - incollect = true - Wait(6000) - incollect = false + TriggerServerEvent("farmer:collectioncotton") + exports["esx_notify"]:Notify("info", 3000, TranslateCap("collection_progress")) + incollect = true + Wait(6000) + incollect = false end -- apple function collectionapple() - TriggerServerEvent("farmer:collectionapple") - exports["esx_notify"]:Notify("info", 3000, TranslateCap("collection_progress")) - incollect = true - Wait(6000) - incollect = false + TriggerServerEvent("farmer:collectionapple") + exports["esx_notify"]:Notify("info", 3000, TranslateCap("collection_progress")) + incollect = true + Wait(6000) + incollect = false end -- grain function collectiongrain() - TriggerServerEvent("farmer:collectiongrain") - exports["esx_notify"]:Notify("info", 3000, TranslateCap("collection_progress")) - incollect = true - Wait(6000) - incollect = false + TriggerServerEvent("farmer:collectiongrain") + exports["esx_notify"]:Notify("info", 3000, TranslateCap("collection_progress")) + incollect = true + Wait(6000) + incollect = false end diff --git a/server-data/resources/[bpt_addons]/bpt_farmer/fxmanifest.lua b/server-data/resources/[bpt_addons]/bpt_farmer/fxmanifest.lua index 08a257ac6..f2f5469d0 100644 --- a/server-data/resources/[bpt_addons]/bpt_farmer/fxmanifest.lua +++ b/server-data/resources/[bpt_addons]/bpt_farmer/fxmanifest.lua @@ -7,16 +7,16 @@ version("1.0.1") shared_script("@es_extended/imports.lua") client_script({ - "@es_extended/locale.lua", - "client/*.lua", - "locales/*.lua", - "config.lua", + "@es_extended/locale.lua", + "client/*.lua", + "locales/*.lua", + "config.lua", }) server_scripts({ - "@es_extended/locale.lua", - "server/*.lua", - "@oxmysql/lib/MySQL.lua", - "locales/*.lua", - "config.lua", + "@es_extended/locale.lua", + "server/*.lua", + "@oxmysql/lib/MySQL.lua", + "locales/*.lua", + "config.lua", }) diff --git a/server-data/resources/[bpt_addons]/bpt_farmer/locales/en.lua b/server-data/resources/[bpt_addons]/bpt_farmer/locales/en.lua index 8a5f1e8e4..062b01536 100644 --- a/server-data/resources/[bpt_addons]/bpt_farmer/locales/en.lua +++ b/server-data/resources/[bpt_addons]/bpt_farmer/locales/en.lua @@ -1,4 +1,4 @@ Locales["en"] = { - ["press_collect"] = "Press ~b~[E] to collect", - ["collection_progress"] = "Collection in progress", + ["press_collect"] = "Press ~b~[E] to collect", + ["collection_progress"] = "Collection in progress", } diff --git a/server-data/resources/[bpt_addons]/bpt_farmer/locales/it.lua b/server-data/resources/[bpt_addons]/bpt_farmer/locales/it.lua index fe7872122..0cfef6bc2 100644 --- a/server-data/resources/[bpt_addons]/bpt_farmer/locales/it.lua +++ b/server-data/resources/[bpt_addons]/bpt_farmer/locales/it.lua @@ -1,4 +1,4 @@ Locales["en"] = { - ["press_collect"] = "Premi ~b~[E] per raccogliere", - ["collection_progress"] = "Raccolta in corso", + ["press_collect"] = "Premi ~b~[E] per raccogliere", + ["collection_progress"] = "Raccolta in corso", } diff --git a/server-data/resources/[bpt_addons]/bpt_farmer/server/main.lua b/server-data/resources/[bpt_addons]/bpt_farmer/server/main.lua index a69bb1850..8dcb941f6 100644 --- a/server-data/resources/[bpt_addons]/bpt_farmer/server/main.lua +++ b/server-data/resources/[bpt_addons]/bpt_farmer/server/main.lua @@ -3,59 +3,59 @@ ESX = exports["es_extended"]:getSharedObject() -- collection potato RegisterServerEvent("farmer:collectionpotato") AddEventHandler("farmer:collectionpotato", function() - local _source = source - local xPlayer = ESX.GetPlayerFromId(_source) - local potato = xPlayer.getInventoryItem("potato").count - if potato < 50 then - TriggerClientEvent("farmer:anim", _source) - Wait(5000) - local countpotato = math.random(1, 5) - xPlayer.addInventoryItem("potato", countpotato) - TriggerClientEvent("farmer:unfreeze", _source) - end + local _source = source + local xPlayer = ESX.GetPlayerFromId(_source) + local potato = xPlayer.getInventoryItem("potato").count + if potato < 50 then + TriggerClientEvent("farmer:anim", _source) + Wait(5000) + local countpotato = math.random(1, 5) + xPlayer.addInventoryItem("potato", countpotato) + TriggerClientEvent("farmer:unfreeze", _source) + end end) -- collection cotton RegisterServerEvent("farmer:collectioncotton") AddEventHandler("farmer:collectioncotton", function() - local _source = source - local xPlayer = ESX.GetPlayerFromId(_source) - local cotton = xPlayer.getInventoryItem("cotton").count - if cotton < 50 then - TriggerClientEvent("farmer:anim", _source) - Wait(5000) - local countcotton = math.random(1, 5) - xPlayer.addInventoryItem("cotton", countcotton) - TriggerClientEvent("farmer:unfreeze", _source) - end + local _source = source + local xPlayer = ESX.GetPlayerFromId(_source) + local cotton = xPlayer.getInventoryItem("cotton").count + if cotton < 50 then + TriggerClientEvent("farmer:anim", _source) + Wait(5000) + local countcotton = math.random(1, 5) + xPlayer.addInventoryItem("cotton", countcotton) + TriggerClientEvent("farmer:unfreeze", _source) + end end) -- collection apple RegisterServerEvent("farmer:collectionapple") AddEventHandler("farmer:collectionapple", function() - local _source = source - local xPlayer = ESX.GetPlayerFromId(_source) - local apple = xPlayer.getInventoryItem("apple").count - if apple < 50 then - TriggerClientEvent("farmer:anim", _source) - Wait(5000) - local countapple = math.random(1, 5) - xPlayer.addInventoryItem("apple", countapple) - TriggerClientEvent("farmer:unfreeze", _source) - end + local _source = source + local xPlayer = ESX.GetPlayerFromId(_source) + local apple = xPlayer.getInventoryItem("apple").count + if apple < 50 then + TriggerClientEvent("farmer:anim", _source) + Wait(5000) + local countapple = math.random(1, 5) + xPlayer.addInventoryItem("apple", countapple) + TriggerClientEvent("farmer:unfreeze", _source) + end end) -- collection grain RegisterServerEvent("farmer:collectiongrain") AddEventHandler("farmer:collectiongrain", function() - local _source = source - local xPlayer = ESX.GetPlayerFromId(_source) - local grain = xPlayer.getInventoryItem("grain").count - if grain < 50 then - TriggerClientEvent("farmer:anim", _source) - Wait(5000) - local countgrain = math.random(1, 5) - xPlayer.addInventoryItem("grain", countgrain) - TriggerClientEvent("farmer:unfreeze", _source) - end + local _source = source + local xPlayer = ESX.GetPlayerFromId(_source) + local grain = xPlayer.getInventoryItem("grain").count + if grain < 50 then + TriggerClientEvent("farmer:anim", _source) + Wait(5000) + local countgrain = math.random(1, 5) + xPlayer.addInventoryItem("grain", countgrain) + TriggerClientEvent("farmer:unfreeze", _source) + end end) From 59032d82a8e932821cc74070031d7de0eafb2845 Mon Sep 17 00:00:00 2001 From: bitpredator <67551273+bitpredator@users.noreply.github.com> Date: Tue, 6 Aug 2024 19:06:43 +0200 Subject: [PATCH 13/13] =?UTF-8?q?chore:=20=F0=9F=8E=A8=20Run=20formatter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../[bpt_addons]/bpt_deliveries/LICENSE | 4 +- .../bpt_deliveries/client/main.lua | 1378 +++++++---------- .../[bpt_addons]/bpt_deliveries/config.lua | 316 ++-- .../bpt_deliveries/fxmanifest.lua | 16 +- .../bpt_deliveries/locales/en.lua | 46 +- .../bpt_deliveries/locales/fr.lua | 46 +- .../bpt_deliveries/locales/it.lua | 46 +- .../bpt_deliveries/locales/zh.lua | 46 +- .../bpt_deliveries/server/main.lua | 86 +- 9 files changed, 851 insertions(+), 1133 deletions(-) diff --git a/server-data/resources/[bpt_addons]/bpt_deliveries/LICENSE b/server-data/resources/[bpt_addons]/bpt_deliveries/LICENSE index f288702d2..69faedd06 100644 --- a/server-data/resources/[bpt_addons]/bpt_deliveries/LICENSE +++ b/server-data/resources/[bpt_addons]/bpt_deliveries/LICENSE @@ -632,7 +632,7 @@ state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. - Copyright (C) + Copyright (C) 2024 bitpredator This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -652,7 +652,7 @@ Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: - Copyright (C) + bpt_deliveries Copyright (C) 2024 bitpredator This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. diff --git a/server-data/resources/[bpt_addons]/bpt_deliveries/client/main.lua b/server-data/resources/[bpt_addons]/bpt_deliveries/client/main.lua index 4763a1744..e6b59e42e 100644 --- a/server-data/resources/[bpt_addons]/bpt_deliveries/client/main.lua +++ b/server-data/resources/[bpt_addons]/bpt_deliveries/client/main.lua @@ -1,10 +1,10 @@ local Status = { - DELIVERY_INACTIVE = 0, - PLAYER_STARTED_DELIVERY = 1, - PLAYER_REACHED_VEHICLE_POINT = 2, - PLAYER_REMOVED_GOODS_FROM_VEHICLE = 3, - PLAYER_REACHED_DELIVERY_POINT = 4, - PLAYER_RETURNING_TO_BASE = 5, + DELIVERY_INACTIVE = 0, + PLAYER_STARTED_DELIVERY = 1, + PLAYER_REACHED_VEHICLE_POINT = 2, + PLAYER_REMOVED_GOODS_FROM_VEHICLE = 3, + PLAYER_REACHED_DELIVERY_POINT = 4, + PLAYER_RETURNING_TO_BASE = 5, } -- Don't touch this, pls :) @@ -23,925 +23,643 @@ local FinishedJobs = 0 -- Make player look like a worker function LoadWorkPlayerSkin(deliveryType) - local playerPed = PlayerPedId() - - if deliveryType == "scooter" then - if IsPedMale(playerPed) then - for k, v in pairs(Config.OutfitScooter) do - SetPedComponentVariation(playerPed, k, v.drawables, v.texture, 1) - end - else - for k, v in pairs(Config.OutfitScooterF) do - SetPedComponentVariation(playerPed, k, v.drawables, v.texture, 1) - end - end - else - if IsPedMale(playerPed) then - for k, v in pairs(Config.OutfitVan) do - SetPedComponentVariation(playerPed, k, v.drawables, v.texture, 1) - end - else - for k, v in pairs(Config.OutfitVanF) do - SetPedComponentVariation(playerPed, k, v.drawables, v.texture, 1) - end - end - end + local playerPed = PlayerPedId() + + if deliveryType == "scooter" then + if IsPedMale(playerPed) then + for k, v in pairs(Config.OutfitScooter) do + SetPedComponentVariation(playerPed, k, v.drawables, v.texture, 1) + end + else + for k, v in pairs(Config.OutfitScooterF) do + SetPedComponentVariation(playerPed, k, v.drawables, v.texture, 1) + end + end + else + if IsPedMale(playerPed) then + for k, v in pairs(Config.OutfitVan) do + SetPedComponentVariation(playerPed, k, v.drawables, v.texture, 1) + end + else + for k, v in pairs(Config.OutfitVanF) do + SetPedComponentVariation(playerPed, k, v.drawables, v.texture, 1) + end + end + end end -- Load the default player skin (for esx_skin) function LoadDefaultPlayerSkin() - ESX.TriggerServerCallback("esx_skin:getPlayerSkin", function(skin) - TriggerEvent("skinchanger:loadSkin", skin) - end) + ESX.TriggerServerCallback("esx_skin:getPlayerSkin", function(skin) + TriggerEvent("skinchanger:loadSkin", skin) + end) end -- Control the input function HandleInput() - if PlayerJob ~= "delivery" then - return - end - - if CurrentStatus == Status.PLAYER_REMOVED_GOODS_FROM_VEHICLE then - DisableControlAction(0, 21, true) - else - Wait(500) - end + if PlayerJob ~= "delivery" then + return + end + + if CurrentStatus == Status.PLAYER_REMOVED_GOODS_FROM_VEHICLE then + DisableControlAction(0, 21, true) + else + Wait(500) + end end -- Main logic handler function HandleLogic() - if PlayerJob ~= "delivery" then - return - end - - local playerPed = PlayerPedId() - local pCoords = GetEntityCoords(playerPed) - - if CurrentStatus ~= Status.DELIVERY_INACTIVE then - if IsPedDeadOrDying(playerPed, true) then - FinishDelivery(CurrentType, false) - return - elseif GetVehicleEngineHealth(CurrentVehicle) < 20 and CurrentVehicle ~= nil then - FinishDelivery(CurrentType, false) - return - end - - if CurrentStatus == Status.PLAYER_STARTED_DELIVERY then - if not IsPlayerInsideDeliveryVehicle() then - CurrentSubtitle = TranslateCap("get_back_in_vehicle") - else - CurrentSubtitle = nil - end - - if - GetDistanceBetweenCoords( - pCoords.x, - pCoords.y, - pCoords.z, - DeliveryLocation.Item1.x, - DeliveryLocation.Item1.y, - DeliveryLocation.Item1.z, - true - ) < 1.5 - then - CurrentStatus = Status.PLAYER_REACHED_VEHICLE_POINT - CurrentSubtitle = TranslateCap("remove_goods_subtext") - PlaySound(-1, "Menu_Accept", "Phone_SoundSet_Default", false, 0, true) - end - end - - if CurrentStatus == Status.PLAYER_REMOVED_GOODS_FROM_VEHICLE then - if CurrentType == "van" or CurrentType == "truck" then - CurrentSubtitle = TranslateCap("deliver_inside_shop") - if CurrentType == "van" and not IsEntityPlayingAnim(playerPed, "anim@heists@box_carry@", "walk", 3) then - ForceCarryAnimation() - end - end - - if - GetDistanceBetweenCoords( - pCoords.x, - pCoords.y, - pCoords.z, - DeliveryLocation.Item2.x, - DeliveryLocation.Item2.y, - DeliveryLocation.Item2.z, - true - ) < 1.5 - then - TriggerServerEvent("bpt_deliveries:finishDelivery:server", CurrentType) - PlaySound(-1, "Menu_Accept", "Phone_SoundSet_Default", false, 0, true) - FinishedJobs = FinishedJobs + 1 - - ESX.ShowNotification(TranslateCap("finish_job") .. FinishedJobs .. "/" .. #DeliveryRoutes) - - if FinishedJobs >= #DeliveryRoutes then - RemovePlayerProps() - RemoveBlip(CurrentBlip) - DeliveryLocation.Item1 = Config.Base.retveh - DeliveryLocation.Item2 = { x = 0, y = 0, z = 0 } - CurrentBlip = - CreateBlipAt(DeliveryLocation.Item1.x, DeliveryLocation.Item1.y, DeliveryLocation.Item1.z) - CurrentSubtitle = TranslateCap("get_back_to_deliveryhub") - CurrentStatus = Status.PLAYER_RETURNING_TO_BASE - return - else - RemovePlayerProps() - GetNextDeliveryPoint(false) - CurrentStatus = Status.PLAYER_STARTED_DELIVERY - CurrentSubtitle = TranslateCap("drive_next_point") - PlaySound(-1, "Menu_Accept", "Phone_SoundSet_Default", false, 0, true) - end - end - end - Wait(500) - else - Wait(1000) - end + if PlayerJob ~= "delivery" then + return + end + + local playerPed = PlayerPedId() + local pCoords = GetEntityCoords(playerPed) + + if CurrentStatus ~= Status.DELIVERY_INACTIVE then + if IsPedDeadOrDying(playerPed, true) then + FinishDelivery(CurrentType, false) + return + elseif GetVehicleEngineHealth(CurrentVehicle) < 20 and CurrentVehicle ~= nil then + FinishDelivery(CurrentType, false) + return + end + + if CurrentStatus == Status.PLAYER_STARTED_DELIVERY then + if not IsPlayerInsideDeliveryVehicle() then + CurrentSubtitle = TranslateCap("get_back_in_vehicle") + else + CurrentSubtitle = nil + end + + if GetDistanceBetweenCoords(pCoords.x, pCoords.y, pCoords.z, DeliveryLocation.Item1.x, DeliveryLocation.Item1.y, DeliveryLocation.Item1.z, true) < 1.5 then + CurrentStatus = Status.PLAYER_REACHED_VEHICLE_POINT + CurrentSubtitle = TranslateCap("remove_goods_subtext") + PlaySound(-1, "Menu_Accept", "Phone_SoundSet_Default", false, 0, true) + end + end + + if CurrentStatus == Status.PLAYER_REMOVED_GOODS_FROM_VEHICLE then + if CurrentType == "van" or CurrentType == "truck" then + CurrentSubtitle = TranslateCap("deliver_inside_shop") + if CurrentType == "van" and not IsEntityPlayingAnim(playerPed, "anim@heists@box_carry@", "walk", 3) then + ForceCarryAnimation() + end + end + + if GetDistanceBetweenCoords(pCoords.x, pCoords.y, pCoords.z, DeliveryLocation.Item2.x, DeliveryLocation.Item2.y, DeliveryLocation.Item2.z, true) < 1.5 then + TriggerServerEvent("bpt_deliveries:finishDelivery:server", CurrentType) + PlaySound(-1, "Menu_Accept", "Phone_SoundSet_Default", false, 0, true) + FinishedJobs = FinishedJobs + 1 + + ESX.ShowNotification(TranslateCap("finish_job") .. FinishedJobs .. "/" .. #DeliveryRoutes) + + if FinishedJobs >= #DeliveryRoutes then + RemovePlayerProps() + RemoveBlip(CurrentBlip) + DeliveryLocation.Item1 = Config.Base.retveh + DeliveryLocation.Item2 = { x = 0, y = 0, z = 0 } + CurrentBlip = CreateBlipAt(DeliveryLocation.Item1.x, DeliveryLocation.Item1.y, DeliveryLocation.Item1.z) + CurrentSubtitle = TranslateCap("get_back_to_deliveryhub") + CurrentStatus = Status.PLAYER_RETURNING_TO_BASE + return + else + RemovePlayerProps() + GetNextDeliveryPoint(false) + CurrentStatus = Status.PLAYER_STARTED_DELIVERY + CurrentSubtitle = TranslateCap("drive_next_point") + PlaySound(-1, "Menu_Accept", "Phone_SoundSet_Default", false, 0, true) + end + end + end + Wait(500) + else + Wait(1000) + end end -- Handling markers and object status function HandleMarkers() - if PlayerJob ~= "delivery" then - return - end - - local pCoords = GetEntityCoords(PlayerPedId()) - local deleter = Config.Base.deleter - - if CurrentStatus ~= Status.DELIVERY_INACTIVE then - DrawMarker( - 20, - deleter.x, - deleter.y, - deleter.z, - 0, - 0, - 0, - 0, - 180.0, - 0, - 1.5, - 1.5, - 1.5, - 249, - 38, - 114, - 150, - true, - true - ) - if GetDistanceBetweenCoords(pCoords.x, pCoords.y, pCoords.z, deleter.x, deleter.y, deleter.z) < 1.5 then - DisplayHelpText(TranslateCap("end_delivery")) - if IsControlJustReleased(0, 51) then - EndDelivery() - return - end - end - - if CurrentStatus == Status.PLAYER_STARTED_DELIVERY then - if not IsPlayerInsideDeliveryVehicle() and CurrentVehicle ~= nil then - local VehiclePos = GetEntityCoords(CurrentVehicle) - local ArrowHeight = VehiclePos.z - - if CurrentType == "van" then - ArrowHeight = ArrowHeight + 1.0 - elseif CurrentType == "truck" then - ArrowHeight = ArrowHeight + 2.0 - end - - DrawMarker( - 20, - VehiclePos.x, - VehiclePos.y, - ArrowHeight, - 0, - 0, - 0, - 0, - 180.0, - 0, - 0.8, - 0.8, - 0.8, - 102, - 217, - 239, - 150, - true, - true - ) - else - local dl = DeliveryLocation.Item1 - if GetDistanceBetweenCoords(pCoords.x, pCoords.y, pCoords.z, dl.x, dl.y, dl.z, true) < 150 then - DrawMarker( - 20, - dl.x, - dl.y, - dl.z, - 0, - 0, - 0, - 0, - 180.0, - 0, - 1.5, - 1.5, - 1.5, - 102, - 217, - 239, - 150, - true, - true - ) - end - end - end - - if CurrentStatus == Status.PLAYER_REACHED_VEHICLE_POINT then - if not IsPlayerInsideDeliveryVehicle() then - local TrunkPos = GetEntityCoords(CurrentVehicle) - local TrunkForward = GetEntityForwardVector(CurrentVehicle) - local ScaleFactor = 1.0 - local TrunkHeight - - for k, v in pairs(Config.Scales) do - if k == CurrentType then - ScaleFactor = v - end - end - - TrunkPos = TrunkPos - (TrunkForward * ScaleFactor) - TrunkHeight = TrunkPos.z + 0.7 - - local ArrowSize = { x = 0.8, y = 0.8, z = 0.8 } - - if CurrentType == "scooter" then - ArrowSize = { x = 0.15, y = 0.15, z = 0.15 } - end - - DrawMarker( - 20, - TrunkPos.x, - TrunkPos.y, - TrunkHeight, - 0, - 0, - 0, - 180.0, - 0, - 0, - ArrowSize.x, - ArrowSize.y, - ArrowSize.z, - 102, - 217, - 239, - 150, - true, - true - ) - - if - GetDistanceBetweenCoords(pCoords.x, pCoords.y, pCoords.z, TrunkPos.x, TrunkPos.y, TrunkHeight, true) - < 1.0 - then - DisplayHelpText(TranslateCap("remove_goods")) - if IsControlJustReleased(0, 51) then - PlayTrunkAnimation() - GetPlayerPropsForDelivery(CurrentType) - CurrentStatus = Status.PLAYER_REMOVED_GOODS_FROM_VEHICLE - end - end - end - end - - if CurrentStatus == Status.PLAYER_REMOVED_GOODS_FROM_VEHICLE then - local dp = DeliveryLocation.Item2 - DrawMarker(20, dp.x, dp.y, dp.z, 0, 0, 0, 0, 180.0, 0, 1.5, 1.5, 1.5, 102, 217, 239, 150, true, true) - end - - if CurrentStatus == Status.PLAYER_RETURNING_TO_BASE then - local dp = Config.Base.deleter - DrawMarker(20, dp.x, dp.y, dp.z, 0, 0, 0, 0, 180.0, 0, 1.5, 1.5, 1.5, 102, 217, 239, 150, true, true) - end - else - local bCoords = Config.Base.coords - if GetDistanceBetweenCoords(pCoords.x, pCoords.y, pCoords.z, bCoords.x, bCoords.y, bCoords.z, true) < 150.0 then - local ScooterPos = Config.Base.scooter - local VanPos = Config.Base.van - local TruckPos = Config.Base.truck - - DrawMarker( - 37, - ScooterPos.x, - ScooterPos.y, - ScooterPos.z, - 0, - 0, - 0, - 0, - 0, - 0, - 2.5, - 2.5, - 2.5, - 243, - 56, - 56, - 150, - true, - true - ) - DrawMarker(36, VanPos.x, VanPos.y, VanPos.z, 0, 0, 0, 0, 0, 0, 2.5, 2.5, 2.5, 250, 170, 60, 150, true, true) - DrawMarker( - 39, - TruckPos.x, - TruckPos.y, - TruckPos.z, - 0, - 0, - 0, - 0, - 0, - 0, - 2.5, - 2.5, - 2.5, - 230, - 219, - 91, - 150, - true, - true - ) - - local SelectType - - if - GetDistanceBetweenCoords( - pCoords.x, - pCoords.y, - pCoords.z, - ScooterPos.x, - ScooterPos.y, - ScooterPos.z, - true - ) < 1.5 - then - DisplayHelpText(TranslateCap("start_delivery") .. tostring(Config.Safe.scooter)) - SelectType = "scooter" - elseif - GetDistanceBetweenCoords(pCoords.x, pCoords.y, pCoords.z, VanPos.x, VanPos.y, VanPos.z, true) < 1.5 - then - DisplayHelpText(TranslateCap("start_delivery") .. tostring(Config.Safe.van)) - SelectType = "van" - elseif - GetDistanceBetweenCoords(pCoords.x, pCoords.y, pCoords.z, TruckPos.x, TruckPos.y, TruckPos.z, true) - < 1.5 - then - DisplayHelpText(TranslateCap("start_delivery") .. tostring(Config.Safe.truck)) - SelectType = "truck" - else - SelectType = false - end - - if SelectType ~= false then - if IsControlJustReleased(0, 51) then - StartDelivery(SelectType) - PlaySound(-1, "Menu_Accept", "Phone_SoundSet_Default", false, 0, true) - end - end - end - end + if PlayerJob ~= "delivery" then + return + end + + local pCoords = GetEntityCoords(PlayerPedId()) + local deleter = Config.Base.deleter + + if CurrentStatus ~= Status.DELIVERY_INACTIVE then + DrawMarker(20, deleter.x, deleter.y, deleter.z, 0, 0, 0, 0, 180.0, 0, 1.5, 1.5, 1.5, 249, 38, 114, 150, true, true) + if GetDistanceBetweenCoords(pCoords.x, pCoords.y, pCoords.z, deleter.x, deleter.y, deleter.z) < 1.5 then + DisplayHelpText(TranslateCap("end_delivery")) + if IsControlJustReleased(0, 51) then + EndDelivery() + return + end + end + + if CurrentStatus == Status.PLAYER_STARTED_DELIVERY then + if not IsPlayerInsideDeliveryVehicle() and CurrentVehicle ~= nil then + local VehiclePos = GetEntityCoords(CurrentVehicle) + local ArrowHeight = VehiclePos.z + + if CurrentType == "van" then + ArrowHeight = ArrowHeight + 1.0 + elseif CurrentType == "truck" then + ArrowHeight = ArrowHeight + 2.0 + end + + DrawMarker(20, VehiclePos.x, VehiclePos.y, ArrowHeight, 0, 0, 0, 0, 180.0, 0, 0.8, 0.8, 0.8, 102, 217, 239, 150, true, true) + else + local dl = DeliveryLocation.Item1 + if GetDistanceBetweenCoords(pCoords.x, pCoords.y, pCoords.z, dl.x, dl.y, dl.z, true) < 150 then + DrawMarker(20, dl.x, dl.y, dl.z, 0, 0, 0, 0, 180.0, 0, 1.5, 1.5, 1.5, 102, 217, 239, 150, true, true) + end + end + end + + if CurrentStatus == Status.PLAYER_REACHED_VEHICLE_POINT then + if not IsPlayerInsideDeliveryVehicle() then + local TrunkPos = GetEntityCoords(CurrentVehicle) + local TrunkForward = GetEntityForwardVector(CurrentVehicle) + local ScaleFactor = 1.0 + local TrunkHeight + + for k, v in pairs(Config.Scales) do + if k == CurrentType then + ScaleFactor = v + end + end + + TrunkPos = TrunkPos - (TrunkForward * ScaleFactor) + TrunkHeight = TrunkPos.z + 0.7 + + local ArrowSize = { x = 0.8, y = 0.8, z = 0.8 } + + if CurrentType == "scooter" then + ArrowSize = { x = 0.15, y = 0.15, z = 0.15 } + end + + DrawMarker(20, TrunkPos.x, TrunkPos.y, TrunkHeight, 0, 0, 0, 180.0, 0, 0, ArrowSize.x, ArrowSize.y, ArrowSize.z, 102, 217, 239, 150, true, true) + + if GetDistanceBetweenCoords(pCoords.x, pCoords.y, pCoords.z, TrunkPos.x, TrunkPos.y, TrunkHeight, true) < 1.0 then + DisplayHelpText(TranslateCap("remove_goods")) + if IsControlJustReleased(0, 51) then + PlayTrunkAnimation() + GetPlayerPropsForDelivery(CurrentType) + CurrentStatus = Status.PLAYER_REMOVED_GOODS_FROM_VEHICLE + end + end + end + end + + if CurrentStatus == Status.PLAYER_REMOVED_GOODS_FROM_VEHICLE then + local dp = DeliveryLocation.Item2 + DrawMarker(20, dp.x, dp.y, dp.z, 0, 0, 0, 0, 180.0, 0, 1.5, 1.5, 1.5, 102, 217, 239, 150, true, true) + end + + if CurrentStatus == Status.PLAYER_RETURNING_TO_BASE then + local dp = Config.Base.deleter + DrawMarker(20, dp.x, dp.y, dp.z, 0, 0, 0, 0, 180.0, 0, 1.5, 1.5, 1.5, 102, 217, 239, 150, true, true) + end + else + local bCoords = Config.Base.coords + if GetDistanceBetweenCoords(pCoords.x, pCoords.y, pCoords.z, bCoords.x, bCoords.y, bCoords.z, true) < 150.0 then + local ScooterPos = Config.Base.scooter + local VanPos = Config.Base.van + local TruckPos = Config.Base.truck + + DrawMarker(37, ScooterPos.x, ScooterPos.y, ScooterPos.z, 0, 0, 0, 0, 0, 0, 2.5, 2.5, 2.5, 243, 56, 56, 150, true, true) + DrawMarker(36, VanPos.x, VanPos.y, VanPos.z, 0, 0, 0, 0, 0, 0, 2.5, 2.5, 2.5, 250, 170, 60, 150, true, true) + DrawMarker(39, TruckPos.x, TruckPos.y, TruckPos.z, 0, 0, 0, 0, 0, 0, 2.5, 2.5, 2.5, 230, 219, 91, 150, true, true) + + local SelectType + + if GetDistanceBetweenCoords(pCoords.x, pCoords.y, pCoords.z, ScooterPos.x, ScooterPos.y, ScooterPos.z, true) < 1.5 then + DisplayHelpText(TranslateCap("start_delivery") .. tostring(Config.Safe.scooter)) + SelectType = "scooter" + elseif GetDistanceBetweenCoords(pCoords.x, pCoords.y, pCoords.z, VanPos.x, VanPos.y, VanPos.z, true) < 1.5 then + DisplayHelpText(TranslateCap("start_delivery") .. tostring(Config.Safe.van)) + SelectType = "van" + elseif GetDistanceBetweenCoords(pCoords.x, pCoords.y, pCoords.z, TruckPos.x, TruckPos.y, TruckPos.z, true) < 1.5 then + DisplayHelpText(TranslateCap("start_delivery") .. tostring(Config.Safe.truck)) + SelectType = "truck" + else + SelectType = false + end + + if SelectType ~= false then + if IsControlJustReleased(0, 51) then + StartDelivery(SelectType) + PlaySound(-1, "Menu_Accept", "Phone_SoundSet_Default", false, 0, true) + end + end + end + end end -- The trunk animation when the player remove the goods from the vehicle function PlayTrunkAnimation() - CreateThread(function() - if CurrentType == "truck" then - if Config.Models.vehDoor.usingTrunkForTruck then - SetVehicleDoorOpen(CurrentVehicle, 5, false, false) - else - SetVehicleDoorOpen(CurrentVehicle, 2, false, false) - SetVehicleDoorOpen(CurrentVehicle, 3, false, false) - end - elseif CurrentType == "van" then - if Config.Models.vehDoor.usingTrunkForVan then - SetVehicleDoorOpen(CurrentVehicle, 5, false, false) - end - end - Wait(1000) - if CurrentType == "truck" then - if Config.Models.vehDoor.usingTrunkForTruck then - SetVehicleDoorShut(CurrentVehicle, 5, false) - else - SetVehicleDoorShut(CurrentVehicle, 2, false) - SetVehicleDoorShut(CurrentVehicle, 3, false) - end - elseif CurrentType == "van" then - if Config.Models.vehDoor.usingTrunkForVan then - SetVehicleDoorShut(CurrentVehicle, 5, false) - else - SetVehicleDoorShut(CurrentVehicle, 2, false) - SetVehicleDoorShut(CurrentVehicle, 3, false) - end - end - end) + CreateThread(function() + if CurrentType == "truck" then + if Config.Models.vehDoor.usingTrunkForTruck then + SetVehicleDoorOpen(CurrentVehicle, 5, false, false) + else + SetVehicleDoorOpen(CurrentVehicle, 2, false, false) + SetVehicleDoorOpen(CurrentVehicle, 3, false, false) + end + elseif CurrentType == "van" then + if Config.Models.vehDoor.usingTrunkForVan then + SetVehicleDoorOpen(CurrentVehicle, 5, false, false) + end + end + Wait(1000) + if CurrentType == "truck" then + if Config.Models.vehDoor.usingTrunkForTruck then + SetVehicleDoorShut(CurrentVehicle, 5, false) + else + SetVehicleDoorShut(CurrentVehicle, 2, false) + SetVehicleDoorShut(CurrentVehicle, 3, false) + end + elseif CurrentType == "van" then + if Config.Models.vehDoor.usingTrunkForVan then + SetVehicleDoorShut(CurrentVehicle, 5, false) + else + SetVehicleDoorShut(CurrentVehicle, 2, false) + SetVehicleDoorShut(CurrentVehicle, 3, false) + end + end + end) end -- Create a blip for the location function CreateBlipAt(x, y, z) - local tmpBlip = AddBlipForCoord(x, y, z) - SetBlipSprite(tmpBlip, 1) - SetBlipColour(tmpBlip, 66) - SetBlipAsShortRange(tmpBlip, true) - BeginTextCommandSetBlipName("STRING") - AddTextComponentString(TranslateCap("dst_blip")) - SetBlipAsMissionCreatorBlip(tmpBlip, true) - SetBlipRoute(tmpBlip, true) - - return tmpBlip + local tmpBlip = AddBlipForCoord(x, y, z) + SetBlipSprite(tmpBlip, 1) + SetBlipColour(tmpBlip, 66) + SetBlipAsShortRange(tmpBlip, true) + BeginTextCommandSetBlipName("STRING") + AddTextComponentString(TranslateCap("dst_blip")) + SetBlipAsMissionCreatorBlip(tmpBlip, true) + SetBlipRoute(tmpBlip, true) + + return tmpBlip end local blip function blip() - EndTextCommandSetBlipName(blip) + EndTextCommandSetBlipName(blip) end -- Let the player carry something function ForceCarryAnimation() - TaskPlayAnim(PlayerPedId(), "anim@heists@box_carry@", "walk", 8.0, 8.0, -1, 51) + TaskPlayAnim(PlayerPedId(), "anim@heists@box_carry@", "walk", 8.0, 8.0, -1, 51) end -- Tell the server start delivery job function StartDelivery(deliveryType) - TriggerServerEvent("bpt_deliveries:removeSafeMoney:server", deliveryType) + TriggerServerEvent("bpt_deliveries:removeSafeMoney:server", deliveryType) end -- Check is the player in the delivery vehicle function IsPlayerInsideDeliveryVehicle() - if IsPedSittingInAnyVehicle(PlayerPedId()) then - local playerVehicle = GetVehiclePedIsIn(PlayerPedId(), false) - if playerVehicle == CurrentVehicle then - return true - end - end - return false + if IsPedSittingInAnyVehicle(PlayerPedId()) then + local playerVehicle = GetVehiclePedIsIn(PlayerPedId(), false) + if playerVehicle == CurrentVehicle then + return true + end + end + return false end -- Remove all object from the player ped function RemovePlayerProps() - for i = 0, #CurrentAttachments do - DetachEntity(CurrentAttachments[i]) - DeleteEntity(CurrentAttachments[i]) - end - ClearPedTasks(PlayerPedId()) - CurrentAttachments = {} + for i = 0, #CurrentAttachments do + DetachEntity(CurrentAttachments[i]) + DeleteEntity(CurrentAttachments[i]) + end + ClearPedTasks(PlayerPedId()) + CurrentAttachments = {} end -- Spawn an object and attach it to the player function GetPlayerPropsForDelivery(deliveryType) - RequestAnimDict("anim@heists@box_carry@") - while not HasAnimDictLoaded("anim@heists@box_carry@") do - Wait(0) - end - - if deliveryType == "scooter" then - local ModelHash = GetHashKey("prop_paper_bag_01") - local PlayerPed = PlayerPedId() - local PlayerPos = GetEntityCoords(PlayerPed) - - WaitModelLoad(ModelHash) - - local Object = CreateObject(ModelHash, PlayerPos.x, PlayerPos.y, PlayerPos.z, true, true, false) - - AttachEntityToEntity( - Object, - PlayerPed, - GetPedBoneIndex(PlayerPed, 28422), - 0.25, - 0.0, - 0.06, - 65.0, - -130.0, - -65.0, - true, - true, - false, - true, - 0, - true - ) - table.insert(CurrentAttachments, Object) - end - - if deliveryType == "van" then - TaskPlayAnim(PlayerPedId(), "anim@heists@box_carry@", "walk", 8.0, 8.0, -1, 51) - - local Rand = GetRandomFromRange(1, #Config.VanGoodsPropNames) - local ModelHash = GetHashKey(Config.VanGoodsPropNames[Rand]) - - WaitModelLoad(ModelHash) - - local PlayerPed = PlayerPedId() - local PlayerPos = GetOffsetFromEntityInWorldCoords(PlayerPed, 0.0, 0.0, -5.0) - local Object = CreateObject(ModelHash, PlayerPos.x, PlayerPos.y, PlayerPos.z, true, false, false) - - AttachEntityToEntity( - Object, - PlayerPed, - GetPedBoneIndex(PlayerPed, 28422), - 0.0, - 0.0, - -0.55, - 0.0, - 0.0, - 90.0, - true, - false, - false, - true, - 1, - true - ) - table.insert(CurrentAttachments, Object) - end - - if deliveryType == "truck" then - TaskPlayAnim(PlayerPedId(), "anim@heists@box_carry@", "walk", 8.0, 8.0, -1, 51) - - local ModelHash = GetHashKey("prop_sacktruck_02b") - - WaitModelLoad(ModelHash) - - local PlayerPed = PlayerPedId() - local PlayerPos = GetOffsetFromEntityInWorldCoords(PlayerPed, 0.0, 0.0, -5.0) - local Object = CreateObject(ModelHash, PlayerPos.x, PlayerPos.y, PlayerPos.z, true, false, false) - - AttachEntityToEntity( - Object, - PlayerPed, - GetEntityBoneIndexByName(PlayerPed, "SKEL_Pelvis"), - -0.075, - 0.90, - -0.86, - -20.0, - -0.5, - 181.0, - true, - false, - false, - true, - 1, - true - ) - table.insert(CurrentAttachments, Object) - end - - local JobData = (FinishedJobs + 1) / #DeliveryRoutes - - if JobData >= 0.5 and #CurrentVehicleAttachments > 2 then - DetachEntity(CurrentVehicleAttachments[1]) - DeleteEntity(CurrentVehicleAttachments[1]) - table.remove(CurrentVehicleAttachments, 1) - end - if JobData >= 1.0 and #CurrentVehicleAttachments > 1 then - DetachEntity(CurrentVehicleAttachments[1]) - DeleteEntity(CurrentVehicleAttachments[1]) - table.remove(CurrentVehicleAttachments, 1) - end + RequestAnimDict("anim@heists@box_carry@") + while not HasAnimDictLoaded("anim@heists@box_carry@") do + Wait(0) + end + + if deliveryType == "scooter" then + local ModelHash = GetHashKey("prop_paper_bag_01") + local PlayerPed = PlayerPedId() + local PlayerPos = GetEntityCoords(PlayerPed) + + WaitModelLoad(ModelHash) + + local Object = CreateObject(ModelHash, PlayerPos.x, PlayerPos.y, PlayerPos.z, true, true, false) + + AttachEntityToEntity(Object, PlayerPed, GetPedBoneIndex(PlayerPed, 28422), 0.25, 0.0, 0.06, 65.0, -130.0, -65.0, true, true, false, true, 0, true) + table.insert(CurrentAttachments, Object) + end + + if deliveryType == "van" then + TaskPlayAnim(PlayerPedId(), "anim@heists@box_carry@", "walk", 8.0, 8.0, -1, 51) + + local Rand = GetRandomFromRange(1, #Config.VanGoodsPropNames) + local ModelHash = GetHashKey(Config.VanGoodsPropNames[Rand]) + + WaitModelLoad(ModelHash) + + local PlayerPed = PlayerPedId() + local PlayerPos = GetOffsetFromEntityInWorldCoords(PlayerPed, 0.0, 0.0, -5.0) + local Object = CreateObject(ModelHash, PlayerPos.x, PlayerPos.y, PlayerPos.z, true, false, false) + + AttachEntityToEntity(Object, PlayerPed, GetPedBoneIndex(PlayerPed, 28422), 0.0, 0.0, -0.55, 0.0, 0.0, 90.0, true, false, false, true, 1, true) + table.insert(CurrentAttachments, Object) + end + + if deliveryType == "truck" then + TaskPlayAnim(PlayerPedId(), "anim@heists@box_carry@", "walk", 8.0, 8.0, -1, 51) + + local ModelHash = GetHashKey("prop_sacktruck_02b") + + WaitModelLoad(ModelHash) + + local PlayerPed = PlayerPedId() + local PlayerPos = GetOffsetFromEntityInWorldCoords(PlayerPed, 0.0, 0.0, -5.0) + local Object = CreateObject(ModelHash, PlayerPos.x, PlayerPos.y, PlayerPos.z, true, false, false) + + AttachEntityToEntity(Object, PlayerPed, GetEntityBoneIndexByName(PlayerPed, "SKEL_Pelvis"), -0.075, 0.90, -0.86, -20.0, -0.5, 181.0, true, false, false, true, 1, true) + table.insert(CurrentAttachments, Object) + end + + local JobData = (FinishedJobs + 1) / #DeliveryRoutes + + if JobData >= 0.5 and #CurrentVehicleAttachments > 2 then + DetachEntity(CurrentVehicleAttachments[1]) + DeleteEntity(CurrentVehicleAttachments[1]) + table.remove(CurrentVehicleAttachments, 1) + end + if JobData >= 1.0 and #CurrentVehicleAttachments > 1 then + DetachEntity(CurrentVehicleAttachments[1]) + DeleteEntity(CurrentVehicleAttachments[1]) + table.remove(CurrentVehicleAttachments, 1) + end end -- Spawn the scooter, truck or van function SpawnDeliveryVehicle(deliveryType) - local Rnd = GetRandomFromRange(1, #Config.ParkingSpawns) - local SpawnLocation = Config.ParkingSpawns[Rnd] - - if deliveryType == "scooter" then - local ModelHash = GetHashKey(Config.Models.scooter) - WaitModelLoad(ModelHash) - CurrentVehicle = - CreateVehicle(ModelHash, SpawnLocation.x, SpawnLocation.y, SpawnLocation.z, SpawnLocation.h, true, true) - end - - if deliveryType == "truck" then - local ModelHash = GetHashKey(Config.Models.truck) - WaitModelLoad(ModelHash) - CurrentVehicle = - CreateVehicle(ModelHash, SpawnLocation.x, SpawnLocation.y, SpawnLocation.z, SpawnLocation.h, true, true) - SetVehicleLivery(CurrentVehicle, 2) - end - - if deliveryType == "van" then - local ModelHash = GetHashKey(Config.Models.van) - WaitModelLoad(ModelHash) - CurrentVehicle = - CreateVehicle(ModelHash, SpawnLocation.x, SpawnLocation.y, SpawnLocation.z, SpawnLocation.h, true, true) - SetVehicleExtra(CurrentVehicle, 2, false) - SetVehicleLivery(CurrentVehicle, 0) - SetVehicleColours(CurrentVehicle, 0, 0) - end - - DecorSetInt(CurrentVehicle, "Delivery.Rental", Config.DecorCode) - SetVehicleOnGroundProperly(CurrentVehicle) - - if deliveryType == "scooter" then - local ModelHash = GetHashKey("prop_med_bag_01") - WaitModelLoad(ModelHash) - local Object = CreateObject(ModelHash, SpawnLocation.x, SpawnLocation.y, SpawnLocation.z, true, false, false) - AttachEntityToEntity( - Object, - CurrentVehicle, - GetEntityBoneIndexByName(CurrentVehicle, "misc_a"), - 0.0, - -0.55, - 0.45, - 0.0, - 0.0, - 0.0, - true, - true, - false, - true, - 0, - true - ) - table.insert(CurrentVehicleAttachments, Object) - end - - if deliveryType == "van" then - local ModelHash1 = GetHashKey("prop_crate_11e") - local ModelHash2 = GetHashKey("prop_cardbordbox_02a") - WaitModelLoad(ModelHash1) - WaitModelLoad(ModelHash2) - local Object1 = CreateObject(ModelHash1, SpawnLocation.x, SpawnLocation.y, SpawnLocation.z, true, false, false) - local Object2 = CreateObject(ModelHash1, SpawnLocation.x, SpawnLocation.y, SpawnLocation.z, true, false, false) - local Object3 = CreateObject(ModelHash2, SpawnLocation.x, SpawnLocation.y, SpawnLocation.z, true, false, false) - AttachEntityToEntity( - Object1, - CurrentVehicle, - GetEntityBoneIndexByName(CurrentVehicle, "chassic"), - 0.25, - -1.55, - -0.12, - 0.0, - 0.0, - 0.0, - true, - true, - false, - true, - 0, - true - ) - AttachEntityToEntity( - Object2, - CurrentVehicle, - GetEntityBoneIndexByName(CurrentVehicle, "chassic"), - -0.26, - -1.55, - 0.2, - 0.0, - 0.0, - 0.0, - true, - true, - false, - true, - 0, - true - ) - AttachEntityToEntity( - Object3, - CurrentVehicle, - GetEntityBoneIndexByName(CurrentVehicle, "chassic"), - -0.26, - -1.55, - -0.12, - 0.0, - 0.0, - 0.0, - true, - true, - false, - true, - 0, - true - ) - table.insert(CurrentVehicleAttachments, Object1) - table.insert(CurrentVehicleAttachments, Object2) - table.insert(CurrentVehicleAttachments, Object3) - end + local Rnd = GetRandomFromRange(1, #Config.ParkingSpawns) + local SpawnLocation = Config.ParkingSpawns[Rnd] + + if deliveryType == "scooter" then + local ModelHash = GetHashKey(Config.Models.scooter) + WaitModelLoad(ModelHash) + CurrentVehicle = CreateVehicle(ModelHash, SpawnLocation.x, SpawnLocation.y, SpawnLocation.z, SpawnLocation.h, true, true) + end + + if deliveryType == "truck" then + local ModelHash = GetHashKey(Config.Models.truck) + WaitModelLoad(ModelHash) + CurrentVehicle = CreateVehicle(ModelHash, SpawnLocation.x, SpawnLocation.y, SpawnLocation.z, SpawnLocation.h, true, true) + SetVehicleLivery(CurrentVehicle, 2) + end + + if deliveryType == "van" then + local ModelHash = GetHashKey(Config.Models.van) + WaitModelLoad(ModelHash) + CurrentVehicle = CreateVehicle(ModelHash, SpawnLocation.x, SpawnLocation.y, SpawnLocation.z, SpawnLocation.h, true, true) + SetVehicleExtra(CurrentVehicle, 2, false) + SetVehicleLivery(CurrentVehicle, 0) + SetVehicleColours(CurrentVehicle, 0, 0) + end + + DecorSetInt(CurrentVehicle, "Delivery.Rental", Config.DecorCode) + SetVehicleOnGroundProperly(CurrentVehicle) + + if deliveryType == "scooter" then + local ModelHash = GetHashKey("prop_med_bag_01") + WaitModelLoad(ModelHash) + local Object = CreateObject(ModelHash, SpawnLocation.x, SpawnLocation.y, SpawnLocation.z, true, false, false) + AttachEntityToEntity(Object, CurrentVehicle, GetEntityBoneIndexByName(CurrentVehicle, "misc_a"), 0.0, -0.55, 0.45, 0.0, 0.0, 0.0, true, true, false, true, 0, true) + table.insert(CurrentVehicleAttachments, Object) + end + + if deliveryType == "van" then + local ModelHash1 = GetHashKey("prop_crate_11e") + local ModelHash2 = GetHashKey("prop_cardbordbox_02a") + WaitModelLoad(ModelHash1) + WaitModelLoad(ModelHash2) + local Object1 = CreateObject(ModelHash1, SpawnLocation.x, SpawnLocation.y, SpawnLocation.z, true, false, false) + local Object2 = CreateObject(ModelHash1, SpawnLocation.x, SpawnLocation.y, SpawnLocation.z, true, false, false) + local Object3 = CreateObject(ModelHash2, SpawnLocation.x, SpawnLocation.y, SpawnLocation.z, true, false, false) + AttachEntityToEntity(Object1, CurrentVehicle, GetEntityBoneIndexByName(CurrentVehicle, "chassic"), 0.25, -1.55, -0.12, 0.0, 0.0, 0.0, true, true, false, true, 0, true) + AttachEntityToEntity(Object2, CurrentVehicle, GetEntityBoneIndexByName(CurrentVehicle, "chassic"), -0.26, -1.55, 0.2, 0.0, 0.0, 0.0, true, true, false, true, 0, true) + AttachEntityToEntity(Object3, CurrentVehicle, GetEntityBoneIndexByName(CurrentVehicle, "chassic"), -0.26, -1.55, -0.12, 0.0, 0.0, 0.0, true, true, false, true, 0, true) + table.insert(CurrentVehicleAttachments, Object1) + table.insert(CurrentVehicleAttachments, Object2) + table.insert(CurrentVehicleAttachments, Object3) + end end -- Get the next destination function GetNextDeliveryPoint(firstTime) - if CurrentBlip ~= nil then - RemoveBlip(CurrentBlip) - end - - for i = 1, #DeliveryComplete do - if not DeliveryComplete[i] then - if not firstTime then - DeliveryComplete[i] = true - break - end - end - end - - for i = 1, #DeliveryComplete do - if not DeliveryComplete[i] then - CurrentBlip = CreateBlipAt(DeliveryRoutes[i].Item1.x, DeliveryRoutes[i].Item1.y, DeliveryRoutes[i].Item1.z) - DeliveryLocation = DeliveryRoutes[i] - break - end - end + if CurrentBlip ~= nil then + RemoveBlip(CurrentBlip) + end + + for i = 1, #DeliveryComplete do + if not DeliveryComplete[i] then + if not firstTime then + DeliveryComplete[i] = true + break + end + end + end + + for i = 1, #DeliveryComplete do + if not DeliveryComplete[i] then + CurrentBlip = CreateBlipAt(DeliveryRoutes[i].Item1.x, DeliveryRoutes[i].Item1.y, DeliveryRoutes[i].Item1.z) + DeliveryLocation = DeliveryRoutes[i] + break + end + end end -- Create some random destinations function CreateRoute(deliveryType) - local TotalDeliveries = GetRandomFromRange(Config.Deliveries.min, Config.Deliveries.max) - local DeliveryPoints - - if deliveryType == "scooter" then - DeliveryPoints = Config.DeliveryLocationsScooter - elseif deliveryType == "van" then - DeliveryPoints = Config.DeliveryLocationsVan - else - DeliveryPoints = Config.DeliveryLocationsTruck - end - - while #DeliveryRoutes < TotalDeliveries do - Wait(1) - if #DeliveryRoutes < 1 then - PreviousPoint = GetEntityCoords(PlayerPedId()) - else - PreviousPoint = DeliveryRoutes[#DeliveryRoutes].Item1 - end - - local Rnd = GetRandomFromRange(1, #DeliveryPoints) - local NextPoint = DeliveryPoints[Rnd] - local HasPlayerAround = false - - for i = 1, #DeliveryRoutes do - local Distance = GetDistanceBetweenCoords( - NextPoint.Item1.x, - NextPoint.Item1.y, - NextPoint.Item1.z, - DeliveryRoutes[i].x, - DeliveryRoutes[i].y, - DeliveryRoutes[i].z, - true - ) - if Distance < 50 then - HasPlayerAround = true - end - end - - if not HasPlayerAround then - table.insert(DeliveryRoutes, NextPoint) - table.insert(DeliveryComplete, false) - end - end + local TotalDeliveries = GetRandomFromRange(Config.Deliveries.min, Config.Deliveries.max) + local DeliveryPoints + + if deliveryType == "scooter" then + DeliveryPoints = Config.DeliveryLocationsScooter + elseif deliveryType == "van" then + DeliveryPoints = Config.DeliveryLocationsVan + else + DeliveryPoints = Config.DeliveryLocationsTruck + end + + while #DeliveryRoutes < TotalDeliveries do + Wait(1) + if #DeliveryRoutes < 1 then + PreviousPoint = GetEntityCoords(PlayerPedId()) + else + PreviousPoint = DeliveryRoutes[#DeliveryRoutes].Item1 + end + + local Rnd = GetRandomFromRange(1, #DeliveryPoints) + local NextPoint = DeliveryPoints[Rnd] + local HasPlayerAround = false + + for i = 1, #DeliveryRoutes do + local Distance = GetDistanceBetweenCoords(NextPoint.Item1.x, NextPoint.Item1.y, NextPoint.Item1.z, DeliveryRoutes[i].x, DeliveryRoutes[i].y, DeliveryRoutes[i].z, true) + if Distance < 50 then + HasPlayerAround = true + end + end + + if not HasPlayerAround then + table.insert(DeliveryRoutes, NextPoint) + table.insert(DeliveryComplete, false) + end + end end -- End Delivery, is the player finish or failed? function EndDelivery() - local PlayerPed = PlayerPedId() - if not IsPedSittingInAnyVehicle(PlayerPed) or GetVehiclePedIsIn(PlayerPed) ~= CurrentVehicle then - TriggerEvent("MpGameMessage:send", TranslateCap("delivery_end"), TranslateCap("delivery_failed"), 3500, "error") - FinishDelivery(CurrentType, false) - else - TriggerEvent("MpGameMessage:send", TranslateCap("delivery_end"), TranslateCap("delivery_finish"), 3500, "success") - ReturnVehicle(CurrentType) - end + local PlayerPed = PlayerPedId() + if not IsPedSittingInAnyVehicle(PlayerPed) or GetVehiclePedIsIn(PlayerPed) ~= CurrentVehicle then + TriggerEvent("MpGameMessage:send", TranslateCap("delivery_end"), TranslateCap("delivery_failed"), 3500, "error") + FinishDelivery(CurrentType, false) + else + TriggerEvent("MpGameMessage:send", TranslateCap("delivery_end"), TranslateCap("delivery_finish"), 3500, "success") + ReturnVehicle(CurrentType) + end end -- Return the vehicle to system function ReturnVehicle(deliveryType) - SetVehicleAsNoLongerNeeded(CurrentVehicle) - DeleteEntity(CurrentVehicle) - ESX.ShowNotification(TranslateCap("delivery_vehicle_returned")) - FinishDelivery(deliveryType, true) + SetVehicleAsNoLongerNeeded(CurrentVehicle) + DeleteEntity(CurrentVehicle) + ESX.ShowNotification(TranslateCap("delivery_vehicle_returned")) + FinishDelivery(deliveryType, true) end -- When the delivery mission finish function FinishDelivery(deliveryType, safeReturn) - if CurrentVehicle ~= nil then - for i = 0, #CurrentVehicleAttachments do - DetachEntity(CurrentVehicleAttachments[i]) - DeleteEntity(CurrentVehicleAttachments[i]) - end - CurrentVehicleAttachments = {} - DeleteEntity(CurrentVehicle) - end - - CurrentStatus = Status.DELIVERY_INACTIVE - CurrentVehicle = nil - CurrentSubtitle = nil - FinishedJobs = 0 - DeliveryRoutes = {} - DeliveryComplete = {} - DeliveryLocation = {} - - if CurrentBlip ~= nil then - RemoveBlip(CurrentBlip) - end - - CurrentBlip = nil - CurrentType = "" - - TriggerServerEvent("bpt_deliveries:returnSafe:server", deliveryType, safeReturn) - - LoadDefaultPlayerSkin() + if CurrentVehicle ~= nil then + for i = 0, #CurrentVehicleAttachments do + DetachEntity(CurrentVehicleAttachments[i]) + DeleteEntity(CurrentVehicleAttachments[i]) + end + CurrentVehicleAttachments = {} + DeleteEntity(CurrentVehicle) + end + + CurrentStatus = Status.DELIVERY_INACTIVE + CurrentVehicle = nil + CurrentSubtitle = nil + FinishedJobs = 0 + DeliveryRoutes = {} + DeliveryComplete = {} + DeliveryLocation = {} + + if CurrentBlip ~= nil then + RemoveBlip(CurrentBlip) + end + + CurrentBlip = nil + CurrentType = "" + + TriggerServerEvent("bpt_deliveries:returnSafe:server", deliveryType, safeReturn) + + LoadDefaultPlayerSkin() end -- Some helpful functions function DisplayHelpText(text) - SetTextComponentFormat("STRING") - AddTextComponentString(text) - DisplayHelpTextFromStringLabel(0, 0, 1, -1) + SetTextComponentFormat("STRING") + AddTextComponentString(text) + DisplayHelpTextFromStringLabel(0, 0, 1, -1) end function GetRandomFromRange(a, b) - return GetRandomIntInRange(a, b) + return GetRandomIntInRange(a, b) end function WaitModelLoad(name) - RequestModel(name) - while not HasModelLoaded(name) do - Wait(0) - end + RequestModel(name) + while not HasModelLoaded(name) do + Wait(0) + end end function Draw2DTextCenter(x, y, text, scale) - SetTextFont(0) - SetTextProportional(7) - SetTextScale(scale, scale) - SetTextColour(255, 255, 255, 255) - SetTextDropShadow(0, 0, 0, 0, 255) - SetTextDropShadow() - SetTextEdge(4, 0, 0, 0, 255) - SetTextOutline() - SetTextCentre(true) - SetTextEntry("STRING") - AddTextComponentString(text) - DrawText(x, y) + SetTextFont(0) + SetTextProportional(7) + SetTextScale(scale, scale) + SetTextColour(255, 255, 255, 255) + SetTextDropShadow(0, 0, 0, 0, 255) + SetTextDropShadow() + SetTextEdge(4, 0, 0, 0, 255) + SetTextOutline() + SetTextCentre(true) + SetTextEntry("STRING") + AddTextComponentString(text) + DrawText(x, y) end -- Initialize ESX CreateThread(function() - ESX = exports["es_extended"]:getSharedObject() - while ESX.GetPlayerData().job == nil do - Wait(10) - end - ESX.PlayerData = ESX.GetPlayerData() - TriggerServerEvent("bpt_deliveries:getPlayerJob:server") + ESX = exports["es_extended"]:getSharedObject() + while ESX.GetPlayerData().job == nil do + Wait(10) + end + ESX.PlayerData = ESX.GetPlayerData() + TriggerServerEvent("bpt_deliveries:getPlayerJob:server") end) -- Main thread CreateThread(function() - blip = AddBlipForCoord(Config.Base.coords.x, Config.Base.coords.y, Config.Base.coords.z) - SetBlipSprite(blip, 85) - SetBlipColour(blip, 5) - SetBlipAsShortRange(blip, true) - BeginTextCommandSetBlipName("STRING") - AddTextComponentString(TranslateCap("blip_name")) - EndTextCommandSetBlipName(blip) + blip = AddBlipForCoord(Config.Base.coords.x, Config.Base.coords.y, Config.Base.coords.z) + SetBlipSprite(blip, 85) + SetBlipColour(blip, 5) + SetBlipAsShortRange(blip, true) + BeginTextCommandSetBlipName("STRING") + AddTextComponentString(TranslateCap("blip_name")) + EndTextCommandSetBlipName(blip) end) -- The other 4 threads CreateThread(function() - while true do - Wait(0) - HandleInput() - end + while true do + Wait(0) + HandleInput() + end end) CreateThread(function() - while true do - Wait(0) - HandleLogic() - end + while true do + Wait(0) + HandleLogic() + end end) CreateThread(function() - while true do - Wait(0) - HandleMarkers() - end + while true do + Wait(0) + HandleMarkers() + end end) CreateThread(function() - while true do - if CurrentSubtitle ~= nil then - Draw2DTextCenter(0.5, 0.88, CurrentSubtitle, 0.7) - end - Wait(1) - end + while true do + if CurrentSubtitle ~= nil then + Draw2DTextCenter(0.5, 0.88, CurrentSubtitle, 0.7) + end + Wait(1) + end end) -- Register events and handlers @@ -950,22 +668,22 @@ RegisterNetEvent("bpt_deliveries:setPlayerJob:client") RegisterNetEvent("bpt_deliveries:startJob:client") AddEventHandler("esx:setJob", function(job) - PlayerJob = job.name + PlayerJob = job.name end) AddEventHandler("bpt_deliveries:setPlayerJob:client", function(job) - print("Player job: " .. job) - PlayerJob = job + print("Player job: " .. job) + PlayerJob = job end) AddEventHandler("bpt_deliveries:startJob:client", function(deliveryType) - TriggerEvent("MpGameMessage:send", TranslateCap("delivery_start"), TranslateCap("delivery_tips"), 3500, "success") - LoadWorkPlayerSkin(deliveryType) - local ModelHash = GetHashKey("prop_paper_bag_01") - WaitModelLoad(ModelHash) - SpawnDeliveryVehicle(deliveryType) - CreateRoute(deliveryType) - GetNextDeliveryPoint(true) - CurrentType = deliveryType - CurrentStatus = Status.PLAYER_STARTED_DELIVERY + TriggerEvent("MpGameMessage:send", TranslateCap("delivery_start"), TranslateCap("delivery_tips"), 3500, "success") + LoadWorkPlayerSkin(deliveryType) + local ModelHash = GetHashKey("prop_paper_bag_01") + WaitModelLoad(ModelHash) + SpawnDeliveryVehicle(deliveryType) + CreateRoute(deliveryType) + GetNextDeliveryPoint(true) + CurrentType = deliveryType + CurrentStatus = Status.PLAYER_STARTED_DELIVERY end) diff --git a/server-data/resources/[bpt_addons]/bpt_deliveries/config.lua b/server-data/resources/[bpt_addons]/bpt_deliveries/config.lua index a22317d75..e35ee4e3d 100644 --- a/server-data/resources/[bpt_addons]/bpt_deliveries/config.lua +++ b/server-data/resources/[bpt_addons]/bpt_deliveries/config.lua @@ -5,221 +5,221 @@ Config.Locale = "it" -- Delivery Base Location Config.Base = { - -- Blip coords - coords = { x = -314.0, y = -1035.21, z = 30.53 }, - -- Scooter mark - scooter = { x = -319.17, y = -1032.14, z = 30.53 }, - -- Van mark - van = { x = -323.17, y = -1030.63, z = 30.53 }, - -- Truck mark - truck = { x = -326.75, y = -1029.23, z = 30.53 }, - -- Return vehicle mark - retveh = { x = -271.3, y = -1009.66, z = 29.87 }, - -- Delete vehicle mark - deleter = { x = -338.26, y = -1023.18, z = 30.38 }, - -- Heading - heading = 245.0, + -- Blip coords + coords = { x = -314.0, y = -1035.21, z = 30.53 }, + -- Scooter mark + scooter = { x = -319.17, y = -1032.14, z = 30.53 }, + -- Van mark + van = { x = -323.17, y = -1030.63, z = 30.53 }, + -- Truck mark + truck = { x = -326.75, y = -1029.23, z = 30.53 }, + -- Return vehicle mark + retveh = { x = -271.3, y = -1009.66, z = 29.87 }, + -- Delete vehicle mark + deleter = { x = -338.26, y = -1023.18, z = 30.38 }, + -- Heading + heading = 245.0, } Config.DecorCode = 0 -- Min and max deliveries jobs Config.Deliveries = { - min = 5, - max = 7, + min = 5, + max = 7, } -- The salary of jobs Config.Rewards = { - scooter = 800, - van = 1000, - truck = 1500, + scooter = 800, + van = 1000, + truck = 1500, } -- Vehicle model Config.Models = { - scooter = "faggio3", - van = "blista", -- Chinese car Wuling hong guang S1 - truck = "mule", - vehDoor = { - -- If this value is true, it will open the vehicle trunk when player remove the goods from the vehicle. - usingTrunkForVan = true, -- If you using original game vehicle, set this to false - usingTrunkForTruck = false, - }, + scooter = "faggio3", + van = "blista", -- Chinese car Wuling hong guang S1 + truck = "mule", + vehDoor = { + -- If this value is true, it will open the vehicle trunk when player remove the goods from the vehicle. + usingTrunkForVan = true, -- If you using original game vehicle, set this to false + usingTrunkForTruck = false, + }, } -- Scale of the arrow, usually not modified it Config.Scales = { - scooter = 0.6, - van = 3.0, - truck = 4.5, + scooter = 0.6, + van = 3.0, + truck = 4.5, } -- Rental money of the vehicles Config.Safe = { - scooter = 4000, - van = 6000, - truck = 8000, + scooter = 4000, + van = 6000, + truck = 8000, } -- Random parking locations Config.ParkingSpawns = { - { x = -310.50, y = -1011.08, z = 30.39, h = 252.00 }, - { x = -309.35, y = -1008.24, z = 30.39, h = 251.15 }, - { x = -311.53, y = -1013.72, z = 30.39, h = 252.00 }, - { x = -305.17, y = -1013.04, z = 30.39, h = 70.78 }, - { x = -307.33, y = -1002.65, z = 30.39, h = 248.33 }, - { x = -322.99, y = -1000.16, z = 30.39, h = 73.11 }, - { x = -329.65, y = -1004.10, z = 30.39, h = 253.11 }, - { x = -324.65, y = -1006.08, z = 30.39, h = 69.82 }, - { x = -326.87, y = -1011.45, z = 30.39, h = 73.49 }, + { x = -310.50, y = -1011.08, z = 30.39, h = 252.00 }, + { x = -309.35, y = -1008.24, z = 30.39, h = 251.15 }, + { x = -311.53, y = -1013.72, z = 30.39, h = 252.00 }, + { x = -305.17, y = -1013.04, z = 30.39, h = 70.78 }, + { x = -307.33, y = -1002.65, z = 30.39, h = 248.33 }, + { x = -322.99, y = -1000.16, z = 30.39, h = 73.11 }, + { x = -329.65, y = -1004.10, z = 30.39, h = 253.11 }, + { x = -324.65, y = -1006.08, z = 30.39, h = 69.82 }, + { x = -326.87, y = -1011.45, z = 30.39, h = 73.49 }, } -- Random delivery locations of scooter -- Item1 = parking location, Item2 = Place goods location Config.DeliveryLocationsScooter = { - { Item1 = { x = -153.19, y = -838.31, z = 30.12 }, Item2 = { x = -143.85, y = -846.3, z = 30.6 } }, - { Item1 = { x = 37.72, y = -795.71, z = 30.93 }, Item2 = { x = 44.94, y = -803.24, z = 31.52 } }, - { Item1 = { x = 111.7, y = -809.56, z = 30.71 }, Item2 = { x = 102.19, y = -818.22, z = 31.35 } }, - { Item1 = { x = 132.61, y = -889.41, z = 29.71 }, Item2 = { x = 121.25, y = -879.82, z = 31.12 } }, - { Item1 = { x = 54.41, y = -994.86, z = 28.7 }, Item2 = { x = 43.89, y = -997.98, z = 29.34 } }, - { Item1 = { x = 54.41, y = -994.86, z = 28.7 }, Item2 = { x = 57.65, y = -1003.72, z = 29.36 } }, - { Item1 = { x = 142.87, y = -1026.78, z = 28.67 }, Item2 = { x = 135.44, y = -1031.19, z = 29.35 } }, - { Item1 = { x = 248.03, y = -1005.49, z = 28.61 }, Item2 = { x = 254.83, y = -1013.25, z = 29.27 } }, - { Item1 = { x = 275.68, y = -929.64, z = 28.47 }, Item2 = { x = 285.55, y = -937.26, z = 29.39 } }, - { Item1 = { x = 294.29, y = -877.33, z = 28.61 }, Item2 = { x = 301.12, y = -883.47, z = 29.28 } }, - { Item1 = { x = 247.68, y = -832.03, z = 29.16 }, Item2 = { x = 258.66, y = -830.44, z = 29.58 } }, - { Item1 = { x = 227.21, y = -705.26, z = 35.07 }, Item2 = { x = 232.2, y = -714.55, z = 35.78 } }, - { Item1 = { x = 241.06, y = -667.74, z = 37.44 }, Item2 = { x = 245.5, y = -677.7, z = 37.75 } }, - { Item1 = { x = 257.05, y = -628.21, z = 40.59 }, Item2 = { x = 268.54, y = -640.44, z = 42.02 } }, - { Item1 = { x = 211.33, y = -605.63, z = 41.42 }, Item2 = { x = 222.32, y = -596.71, z = 43.87 } }, - { Item1 = { x = 126.27, y = -555.46, z = 42.66 }, Item2 = { x = 168.11, y = -567.17, z = 43.87 } }, - { Item1 = { x = 254.2, y = -377.17, z = 43.96 }, Item2 = { x = 239.06, y = -409.27, z = 47.92 } }, - { Item1 = { x = 244.49, y = 349.05, z = 105.46 }, Item2 = { x = 252.86, y = 357.13, z = 105.53 } }, - { Item1 = { x = 130.77, y = -307.27, z = 44.58 }, Item2 = { x = 138.67, y = -285.45, z = 50.45 } }, - { Item1 = { x = 54.44, y = -280.4, z = 46.9 }, Item2 = { x = 61.86, y = -260.86, z = 52.35 } }, - { Item1 = { x = 55.15, y = -225.54, z = 50.44 }, Item2 = { x = 76.29, y = -233.15, z = 51.4 } }, - { Item1 = { x = 44.6, y = -138.99, z = 54.66 }, Item2 = { x = 50.78, y = -136.23, z = 55.2 } }, - { Item1 = { x = 32.51, y = -162.61, z = 54.86 }, Item2 = { x = 26.84, y = -168.84, z = 55.54 } }, - { Item1 = { x = -29.6, y = -110.84, z = 56.51 }, Item2 = { x = -23.5, y = -106.74, z = 57.04 } }, - { Item1 = { x = -96.86, y = -86.84, z = 57.44 }, Item2 = { x = -87.82, y = -83.55, z = 57.82 } }, - { Item1 = { x = -146.26, y = -71.46, z = 53.9 }, Item2 = { x = -132.92, y = -69.02, z = 55.42 } }, - { Item1 = { x = -238.41, y = 91.97, z = 68.11 }, Item2 = { x = -263.61, y = 98.88, z = 69.3 } }, - { Item1 = { x = -251.45, y = 20.43, z = 53.9 }, Item2 = { x = -273.35, y = 28.21, z = 54.75 } }, - { Item1 = { x = -322.4, y = -10.06, z = 47.42 }, Item2 = { x = -315.48, y = -3.76, z = 48.2 } }, - { Item1 = { x = -431.22, y = 14.6, z = 45.5 }, Item2 = { x = -424.83, y = 21.74, z = 46.27 } }, - { Item1 = { x = -497.33, y = -8.38, z = 44.33 }, Item2 = { x = -500.95, y = -18.65, z = 45.13 } }, - { Item1 = { x = -406.69, y = -44.87, z = 45.13 }, Item2 = { x = -429.07, y = -24.12, z = 46.23 } }, - { Item1 = { x = -433.94, y = -76.33, z = 40.93 }, Item2 = { x = -437.89, y = -66.91, z = 43 } }, - { Item1 = { x = -583.22, y = -154.84, z = 37.51 }, Item2 = { x = -582.8, y = -146.8, z = 38.23 } }, - { Item1 = { x = -613.68, y = -213.46, z = 36.51 }, Item2 = { x = -622.23, y = -210.97, z = 37.33 } }, - { Item1 = { x = -582.44, y = -322.69, z = 34.33 }, Item2 = { x = -583.02, y = -330.38, z = 34.97 } }, - { Item1 = { x = -658.25, y = -329, z = 34.2 }, Item2 = { x = -666.69, y = -329.06, z = 35.2 } }, - { Item1 = { x = -645.84, y = -419.67, z = 34.1 }, Item2 = { x = -654.84, y = -414.21, z = 35.45 } }, - { Item1 = { x = -712.7, y = -668.08, z = 29.81 }, Item2 = { x = -714.58, y = -675.37, z = 30.63 } }, - { Item1 = { x = -648.24, y = -681.53, z = 30.61 }, Item2 = { x = -656.77, y = -678.12, z = 31.46 } }, - { Item1 = { x = -648.87, y = -904.3, z = 23.8 }, Item2 = { x = -660.88, y = -900.72, z = 24.61 } }, - { Item1 = { x = -529.01, y = -848.03, z = 29.26 }, Item2 = { x = -531.0, y = -854.04, z = 29.79 } }, + { Item1 = { x = -153.19, y = -838.31, z = 30.12 }, Item2 = { x = -143.85, y = -846.3, z = 30.6 } }, + { Item1 = { x = 37.72, y = -795.71, z = 30.93 }, Item2 = { x = 44.94, y = -803.24, z = 31.52 } }, + { Item1 = { x = 111.7, y = -809.56, z = 30.71 }, Item2 = { x = 102.19, y = -818.22, z = 31.35 } }, + { Item1 = { x = 132.61, y = -889.41, z = 29.71 }, Item2 = { x = 121.25, y = -879.82, z = 31.12 } }, + { Item1 = { x = 54.41, y = -994.86, z = 28.7 }, Item2 = { x = 43.89, y = -997.98, z = 29.34 } }, + { Item1 = { x = 54.41, y = -994.86, z = 28.7 }, Item2 = { x = 57.65, y = -1003.72, z = 29.36 } }, + { Item1 = { x = 142.87, y = -1026.78, z = 28.67 }, Item2 = { x = 135.44, y = -1031.19, z = 29.35 } }, + { Item1 = { x = 248.03, y = -1005.49, z = 28.61 }, Item2 = { x = 254.83, y = -1013.25, z = 29.27 } }, + { Item1 = { x = 275.68, y = -929.64, z = 28.47 }, Item2 = { x = 285.55, y = -937.26, z = 29.39 } }, + { Item1 = { x = 294.29, y = -877.33, z = 28.61 }, Item2 = { x = 301.12, y = -883.47, z = 29.28 } }, + { Item1 = { x = 247.68, y = -832.03, z = 29.16 }, Item2 = { x = 258.66, y = -830.44, z = 29.58 } }, + { Item1 = { x = 227.21, y = -705.26, z = 35.07 }, Item2 = { x = 232.2, y = -714.55, z = 35.78 } }, + { Item1 = { x = 241.06, y = -667.74, z = 37.44 }, Item2 = { x = 245.5, y = -677.7, z = 37.75 } }, + { Item1 = { x = 257.05, y = -628.21, z = 40.59 }, Item2 = { x = 268.54, y = -640.44, z = 42.02 } }, + { Item1 = { x = 211.33, y = -605.63, z = 41.42 }, Item2 = { x = 222.32, y = -596.71, z = 43.87 } }, + { Item1 = { x = 126.27, y = -555.46, z = 42.66 }, Item2 = { x = 168.11, y = -567.17, z = 43.87 } }, + { Item1 = { x = 254.2, y = -377.17, z = 43.96 }, Item2 = { x = 239.06, y = -409.27, z = 47.92 } }, + { Item1 = { x = 244.49, y = 349.05, z = 105.46 }, Item2 = { x = 252.86, y = 357.13, z = 105.53 } }, + { Item1 = { x = 130.77, y = -307.27, z = 44.58 }, Item2 = { x = 138.67, y = -285.45, z = 50.45 } }, + { Item1 = { x = 54.44, y = -280.4, z = 46.9 }, Item2 = { x = 61.86, y = -260.86, z = 52.35 } }, + { Item1 = { x = 55.15, y = -225.54, z = 50.44 }, Item2 = { x = 76.29, y = -233.15, z = 51.4 } }, + { Item1 = { x = 44.6, y = -138.99, z = 54.66 }, Item2 = { x = 50.78, y = -136.23, z = 55.2 } }, + { Item1 = { x = 32.51, y = -162.61, z = 54.86 }, Item2 = { x = 26.84, y = -168.84, z = 55.54 } }, + { Item1 = { x = -29.6, y = -110.84, z = 56.51 }, Item2 = { x = -23.5, y = -106.74, z = 57.04 } }, + { Item1 = { x = -96.86, y = -86.84, z = 57.44 }, Item2 = { x = -87.82, y = -83.55, z = 57.82 } }, + { Item1 = { x = -146.26, y = -71.46, z = 53.9 }, Item2 = { x = -132.92, y = -69.02, z = 55.42 } }, + { Item1 = { x = -238.41, y = 91.97, z = 68.11 }, Item2 = { x = -263.61, y = 98.88, z = 69.3 } }, + { Item1 = { x = -251.45, y = 20.43, z = 53.9 }, Item2 = { x = -273.35, y = 28.21, z = 54.75 } }, + { Item1 = { x = -322.4, y = -10.06, z = 47.42 }, Item2 = { x = -315.48, y = -3.76, z = 48.2 } }, + { Item1 = { x = -431.22, y = 14.6, z = 45.5 }, Item2 = { x = -424.83, y = 21.74, z = 46.27 } }, + { Item1 = { x = -497.33, y = -8.38, z = 44.33 }, Item2 = { x = -500.95, y = -18.65, z = 45.13 } }, + { Item1 = { x = -406.69, y = -44.87, z = 45.13 }, Item2 = { x = -429.07, y = -24.12, z = 46.23 } }, + { Item1 = { x = -433.94, y = -76.33, z = 40.93 }, Item2 = { x = -437.89, y = -66.91, z = 43 } }, + { Item1 = { x = -583.22, y = -154.84, z = 37.51 }, Item2 = { x = -582.8, y = -146.8, z = 38.23 } }, + { Item1 = { x = -613.68, y = -213.46, z = 36.51 }, Item2 = { x = -622.23, y = -210.97, z = 37.33 } }, + { Item1 = { x = -582.44, y = -322.69, z = 34.33 }, Item2 = { x = -583.02, y = -330.38, z = 34.97 } }, + { Item1 = { x = -658.25, y = -329, z = 34.2 }, Item2 = { x = -666.69, y = -329.06, z = 35.2 } }, + { Item1 = { x = -645.84, y = -419.67, z = 34.1 }, Item2 = { x = -654.84, y = -414.21, z = 35.45 } }, + { Item1 = { x = -712.7, y = -668.08, z = 29.81 }, Item2 = { x = -714.58, y = -675.37, z = 30.63 } }, + { Item1 = { x = -648.24, y = -681.53, z = 30.61 }, Item2 = { x = -656.77, y = -678.12, z = 31.46 } }, + { Item1 = { x = -648.87, y = -904.3, z = 23.8 }, Item2 = { x = -660.88, y = -900.72, z = 24.61 } }, + { Item1 = { x = -529.01, y = -848.03, z = 29.26 }, Item2 = { x = -531.0, y = -854.04, z = 29.79 } }, } -- Random delivery locations of van Config.DeliveryLocationsVan = { - { Item1 = { x = -51.95, y = -1761.67, z = 28.89 }, Item2 = { x = -41.15, y = -1751.66, z = 29.42 } }, - { Item1 = { x = 369.38, y = 317.44, z = 103.21 }, Item2 = { x = 375.08, y = 333.65, z = 103.57 } }, - { Item1 = { x = -702.38, y = -920.38, z = 18.8 }, Item2 = { x = -705.7, y = -905.46, z = 19.22 } }, - { Item1 = { x = -1225.49, y = -893.3, z = 12.13 }, Item2 = { x = -1223.77, y = -912.26, z = 12.33 } }, - { Item1 = { x = -1506.82, y = -383.06, z = 40.64 }, Item2 = { x = -1482.29, y = -378.95, z = 40.16 } }, - { Item1 = { x = 1149.13, y = -985.08, z = 45.64 }, Item2 = { x = 1131.86, y = -979.32, z = 46.42 } }, - { Item1 = { x = 1157.19, y = -331.77, z = 68.64 }, Item2 = { x = 1163.79, y = -314.6, z = 69.21 } }, - { Item1 = { x = -1145.42, y = -1590.97, z = 4.06 }, Item2 = { x = -1150.31, y = -1601.7, z = 4.39 } }, - { Item1 = { x = 48.18, y = -992.62, z = 29.03 }, Item2 = { x = 38.41, y = -1005.3, z = 29.48 } }, - { Item1 = { x = 370.05, y = -1036.4, z = 28.99 }, Item2 = { x = 376.7, y = -1028.82, z = 29.34 } }, - { Item1 = { x = 785.95, y = -761.67, z = 26.33 }, Item2 = { x = 797.0, y = -757.31, z = 26.89 } }, - { Item1 = { x = 41.53, y = -138.21, z = 55.08 }, Item2 = { x = 50.96, y = -135.49, z = 55.2 } }, - { Item1 = { x = 106.8, y = 304.21, z = 109.81 }, Item2 = { x = 90.86, y = 298.51, z = 110.21 } }, - { Item1 = { x = -565.73, y = 268.54, z = 82.55 }, Item2 = { x = -562.25, y = 283.98, z = 82.18 } }, + { Item1 = { x = -51.95, y = -1761.67, z = 28.89 }, Item2 = { x = -41.15, y = -1751.66, z = 29.42 } }, + { Item1 = { x = 369.38, y = 317.44, z = 103.21 }, Item2 = { x = 375.08, y = 333.65, z = 103.57 } }, + { Item1 = { x = -702.38, y = -920.38, z = 18.8 }, Item2 = { x = -705.7, y = -905.46, z = 19.22 } }, + { Item1 = { x = -1225.49, y = -893.3, z = 12.13 }, Item2 = { x = -1223.77, y = -912.26, z = 12.33 } }, + { Item1 = { x = -1506.82, y = -383.06, z = 40.64 }, Item2 = { x = -1482.29, y = -378.95, z = 40.16 } }, + { Item1 = { x = 1149.13, y = -985.08, z = 45.64 }, Item2 = { x = 1131.86, y = -979.32, z = 46.42 } }, + { Item1 = { x = 1157.19, y = -331.77, z = 68.64 }, Item2 = { x = 1163.79, y = -314.6, z = 69.21 } }, + { Item1 = { x = -1145.42, y = -1590.97, z = 4.06 }, Item2 = { x = -1150.31, y = -1601.7, z = 4.39 } }, + { Item1 = { x = 48.18, y = -992.62, z = 29.03 }, Item2 = { x = 38.41, y = -1005.3, z = 29.48 } }, + { Item1 = { x = 370.05, y = -1036.4, z = 28.99 }, Item2 = { x = 376.7, y = -1028.82, z = 29.34 } }, + { Item1 = { x = 785.95, y = -761.67, z = 26.33 }, Item2 = { x = 797.0, y = -757.31, z = 26.89 } }, + { Item1 = { x = 41.53, y = -138.21, z = 55.08 }, Item2 = { x = 50.96, y = -135.49, z = 55.2 } }, + { Item1 = { x = 106.8, y = 304.21, z = 109.81 }, Item2 = { x = 90.86, y = 298.51, z = 110.21 } }, + { Item1 = { x = -565.73, y = 268.54, z = 82.55 }, Item2 = { x = -562.25, y = 283.98, z = 82.18 } }, } -- Random delivery locations of truck Config.DeliveryLocationsTruck = { - { Item1 = { x = -1395.82, y = -653.76, z = 28.91 }, Item2 = { x = -1413.43, y = -635.47, z = 28.67 } }, - { Item1 = { x = 164.18, y = -1280.21, z = 29.38 }, Item2 = { x = 136.5, y = -1278.69, z = 29.36 } }, - { Item1 = { x = 75.71, y = 164.41, z = 104.93 }, Item2 = { x = 78.55, y = 180.44, z = 104.63 } }, - { Item1 = { x = -226.62, y = 308.87, z = 92.4 }, Item2 = { x = -229.54, y = 293.59, z = 92.19 } }, - { Item1 = { x = -365.87, y = 297.27, z = 85.04 }, Item2 = { x = -370.5, y = 277.98, z = 86.42 } }, - { Item1 = { x = -403.95, y = 196.11, z = 82.67 }, Item2 = { x = -395.17, y = 208.6, z = 83.59 } }, - { Item1 = { x = -412.26, y = 297.95, z = 83.46 }, Item2 = { x = -427.08, y = 294.19, z = 83.23 } }, - { Item1 = { x = -606.23, y = -901.52, z = 25.39 }, Item2 = { x = -592.48, y = -892.76, z = 25.93 } }, - { Item1 = { x = -837.03, y = -1142.46, z = 7.44 }, Item2 = { x = -841.89, y = -1127.91, z = 6.97 } }, - { Item1 = { x = -1061.56, y = -1382.19, z = 5.44 }, Item2 = { x = -1039.38, y = -1396.88, z = 5.55 } }, - { Item1 = { x = 156.41, y = -1651.21, z = 29.53 }, Item2 = { x = 169.11, y = -1633.38, z = 29.29 } }, - { Item1 = { x = 168.13, y = -1470.07, z = 29.37 }, Item2 = { x = 175.78, y = -1461.16, z = 29.24 } }, - { Item1 = { x = 118.99, y = -1486.21, z = 29.38 }, Item2 = { x = 143.54, y = -1481.18, z = 29.36 } }, - { Item1 = { x = -548.34, y = 308.19, z = 83.34 }, Item2 = { x = -546.6, y = 291.46, z = 83.02 } }, + { Item1 = { x = -1395.82, y = -653.76, z = 28.91 }, Item2 = { x = -1413.43, y = -635.47, z = 28.67 } }, + { Item1 = { x = 164.18, y = -1280.21, z = 29.38 }, Item2 = { x = 136.5, y = -1278.69, z = 29.36 } }, + { Item1 = { x = 75.71, y = 164.41, z = 104.93 }, Item2 = { x = 78.55, y = 180.44, z = 104.63 } }, + { Item1 = { x = -226.62, y = 308.87, z = 92.4 }, Item2 = { x = -229.54, y = 293.59, z = 92.19 } }, + { Item1 = { x = -365.87, y = 297.27, z = 85.04 }, Item2 = { x = -370.5, y = 277.98, z = 86.42 } }, + { Item1 = { x = -403.95, y = 196.11, z = 82.67 }, Item2 = { x = -395.17, y = 208.6, z = 83.59 } }, + { Item1 = { x = -412.26, y = 297.95, z = 83.46 }, Item2 = { x = -427.08, y = 294.19, z = 83.23 } }, + { Item1 = { x = -606.23, y = -901.52, z = 25.39 }, Item2 = { x = -592.48, y = -892.76, z = 25.93 } }, + { Item1 = { x = -837.03, y = -1142.46, z = 7.44 }, Item2 = { x = -841.89, y = -1127.91, z = 6.97 } }, + { Item1 = { x = -1061.56, y = -1382.19, z = 5.44 }, Item2 = { x = -1039.38, y = -1396.88, z = 5.55 } }, + { Item1 = { x = 156.41, y = -1651.21, z = 29.53 }, Item2 = { x = 169.11, y = -1633.38, z = 29.29 } }, + { Item1 = { x = 168.13, y = -1470.07, z = 29.37 }, Item2 = { x = 175.78, y = -1461.16, z = 29.24 } }, + { Item1 = { x = 118.99, y = -1486.21, z = 29.38 }, Item2 = { x = 143.54, y = -1481.18, z = 29.36 } }, + { Item1 = { x = -548.34, y = 308.19, z = 83.34 }, Item2 = { x = -546.6, y = 291.46, z = 83.02 } }, } -- Player outfit of scooter Config.OutfitScooter = { - [1] = { drawables = 0, texture = 0 }, - [3] = { drawables = 66, texture = 0 }, - [4] = { drawables = 97, texture = 3 }, - [5] = { drawables = 0, texture = 0 }, - [6] = { drawables = 32, texture = 14 }, - [7] = { drawables = 0, texture = 0 }, - [8] = { drawables = 15, texture = 0 }, - [9] = { drawables = 0, texture = 0 }, - [11] = { drawables = 184, texture = 0 }, - [12] = { drawables = 18, texture = 5 }, - [13] = { drawables = 1280, texture = 2 }, + [1] = { drawables = 0, texture = 0 }, + [3] = { drawables = 66, texture = 0 }, + [4] = { drawables = 97, texture = 3 }, + [5] = { drawables = 0, texture = 0 }, + [6] = { drawables = 32, texture = 14 }, + [7] = { drawables = 0, texture = 0 }, + [8] = { drawables = 15, texture = 0 }, + [9] = { drawables = 0, texture = 0 }, + [11] = { drawables = 184, texture = 0 }, + [12] = { drawables = 18, texture = 5 }, + [13] = { drawables = 1280, texture = 2 }, } -- Player outfit of scooter (female) Config.OutfitScooterF = { - [1] = { drawables = 0, texture = 0 }, - [3] = { drawables = 9, texture = 0 }, - [4] = { drawables = 11, texture = 3 }, - [5] = { drawables = 0, texture = 0 }, - [6] = { drawables = 11, texture = 2 }, - [7] = { drawables = 0, texture = 0 }, - [8] = { drawables = 13, texture = 0 }, - [9] = { drawables = 0, texture = 0 }, - [11] = { drawables = 295, texture = 0 }, - [12] = { drawables = 18, texture = 5 }, - [13] = { drawables = 1280, texture = 2 }, + [1] = { drawables = 0, texture = 0 }, + [3] = { drawables = 9, texture = 0 }, + [4] = { drawables = 11, texture = 3 }, + [5] = { drawables = 0, texture = 0 }, + [6] = { drawables = 11, texture = 2 }, + [7] = { drawables = 0, texture = 0 }, + [8] = { drawables = 13, texture = 0 }, + [9] = { drawables = 0, texture = 0 }, + [11] = { drawables = 295, texture = 0 }, + [12] = { drawables = 18, texture = 5 }, + [13] = { drawables = 1280, texture = 2 }, } -- Player outfit of van and truck Config.OutfitVan = { - [1] = { drawables = 0, texture = 0 }, - [3] = { drawables = 66, texture = 0 }, - [4] = { drawables = 97, texture = 3 }, - [5] = { drawables = 0, texture = 0 }, - [6] = { drawables = 32, texture = 14 }, - [7] = { drawables = 0, texture = 0 }, - [8] = { drawables = 141, texture = 0 }, - [9] = { drawables = 0, texture = 0 }, - [11] = { drawables = 230, texture = 3 }, - [12] = { drawables = 45, texture = 7 }, - [13] = { drawables = 1280, texture = 2 }, + [1] = { drawables = 0, texture = 0 }, + [3] = { drawables = 66, texture = 0 }, + [4] = { drawables = 97, texture = 3 }, + [5] = { drawables = 0, texture = 0 }, + [6] = { drawables = 32, texture = 14 }, + [7] = { drawables = 0, texture = 0 }, + [8] = { drawables = 141, texture = 0 }, + [9] = { drawables = 0, texture = 0 }, + [11] = { drawables = 230, texture = 3 }, + [12] = { drawables = 45, texture = 7 }, + [13] = { drawables = 1280, texture = 2 }, } -- Player outfit of van and truck (female) Config.OutfitVanF = { - [1] = { drawables = 0, texture = 0 }, - [3] = { drawables = 14, texture = 0 }, - [4] = { drawables = 45, texture = 1 }, - [5] = { drawables = 0, texture = 0 }, - [6] = { drawables = 27, texture = 0 }, - [7] = { drawables = 0, texture = 0 }, - [8] = { drawables = 14, texture = 0 }, - [9] = { drawables = 0, texture = 0 }, - [11] = { drawables = 14, texture = 3 }, - [12] = { drawables = 18, texture = 7 }, - [13] = { drawables = 1280, texture = 2 }, + [1] = { drawables = 0, texture = 0 }, + [3] = { drawables = 14, texture = 0 }, + [4] = { drawables = 45, texture = 1 }, + [5] = { drawables = 0, texture = 0 }, + [6] = { drawables = 27, texture = 0 }, + [7] = { drawables = 0, texture = 0 }, + [8] = { drawables = 14, texture = 0 }, + [9] = { drawables = 0, texture = 0 }, + [11] = { drawables = 14, texture = 3 }, + [12] = { drawables = 18, texture = 7 }, + [13] = { drawables = 1280, texture = 2 }, } -- Random van goods Config.VanGoodsPropNames = { - "prop_crate_11e", - "prop_cardbordbox_02a", + "prop_crate_11e", + "prop_cardbordbox_02a", } diff --git a/server-data/resources/[bpt_addons]/bpt_deliveries/fxmanifest.lua b/server-data/resources/[bpt_addons]/bpt_deliveries/fxmanifest.lua index c15a84914..c99fdc1c8 100644 --- a/server-data/resources/[bpt_addons]/bpt_deliveries/fxmanifest.lua +++ b/server-data/resources/[bpt_addons]/bpt_deliveries/fxmanifest.lua @@ -4,17 +4,17 @@ description("bpt_deliveries") version("1.0.1") client_scripts({ - "@es_extended/locale.lua", - "locales/*.lua", - "config.lua", - "client/*.lua", + "@es_extended/locale.lua", + "locales/*.lua", + "config.lua", + "client/*.lua", }) server_scripts({ - "@es_extended/locale.lua", - "locales/*.lua", - "config.lua", - "server/*.lua", + "@es_extended/locale.lua", + "locales/*.lua", + "config.lua", + "server/*.lua", }) dependency("es_extended") diff --git a/server-data/resources/[bpt_addons]/bpt_deliveries/locales/en.lua b/server-data/resources/[bpt_addons]/bpt_deliveries/locales/en.lua index e2c20f333..0fed11ce2 100644 --- a/server-data/resources/[bpt_addons]/bpt_deliveries/locales/en.lua +++ b/server-data/resources/[bpt_addons]/bpt_deliveries/locales/en.lua @@ -1,25 +1,25 @@ Locales["en"] = { - ["delivery_not_available"] = "This model is ~r~Unavailable~w~, please use ~g~bike~w~ or ~g~van~w~.", - ["start_delivery"] = "Press ~INPUT_CONTEXT~ to start the delivery job, you need to pay the safe deposit for ~g~$", - ["safe_deposit_received"] = "The safe deposit has been remove from your bank account", - ["safe_deposit_returned"] = "The safe deposit return to your bank account now", - ["safe_deposit_withheld"] = "Mission ~r~failed~w~, your safe deposit has been ~r~detain~w~.", - ["delivery_point_reward"] = "Mission complete, you received ~g~$", - ["get_back_in_vehicle"] = "Enter in your ~y~vehicle~s~", - ["remove_goods"] = "Press ~INPUT_CONTEXT~ to take out the ~y~goods~s~ from the car", - ["remove_goods_subtext"] = "Leave your car and take out the ~y~goods~w~", - ["drive_next_point"] = "Drive the car to next ~y~destination~w~", - ["deliver_inside_shop"] = "Take the ~y~goods~w~ to the next destination", - ["get_back_to_deliveryhub"] = "Back to the delivery hub and return the car", - ["delivery_vehicle_returned"] = "Your car has been return", - ["finish_job"] = "Mission status: ~g~", - ["end_delivery"] = "Press ~INPUT_CONTEXT~ to terminate the mission, please sit in the car, or you will not get the safe deposit", - ["blip_name"] = "Delivery Hub", - ["dst_blip"] = "Delivery", - ["delivery_end"] = "Delivery End", - ["delivery_failed"] = "You will lose the safe deposit because your car broken or lost", - ["delivery_finish"] = "You finished the deliveries mission", - ["delivery_start"] = "Delivery", - ["delivery_tips"] = "Drive the car safely to the destination and delivery the ~y~goods~s~", - ["not_enough_money"] = "Your have not enough bank money to pay the ~r~safe deposit~s~", + ["delivery_not_available"] = "This model is ~r~Unavailable~w~, please use ~g~bike~w~ or ~g~van~w~.", + ["start_delivery"] = "Press ~INPUT_CONTEXT~ to start the delivery job, you need to pay the safe deposit for ~g~$", + ["safe_deposit_received"] = "The safe deposit has been remove from your bank account", + ["safe_deposit_returned"] = "The safe deposit return to your bank account now", + ["safe_deposit_withheld"] = "Mission ~r~failed~w~, your safe deposit has been ~r~detain~w~.", + ["delivery_point_reward"] = "Mission complete, you received ~g~$", + ["get_back_in_vehicle"] = "Enter in your ~y~vehicle~s~", + ["remove_goods"] = "Press ~INPUT_CONTEXT~ to take out the ~y~goods~s~ from the car", + ["remove_goods_subtext"] = "Leave your car and take out the ~y~goods~w~", + ["drive_next_point"] = "Drive the car to next ~y~destination~w~", + ["deliver_inside_shop"] = "Take the ~y~goods~w~ to the next destination", + ["get_back_to_deliveryhub"] = "Back to the delivery hub and return the car", + ["delivery_vehicle_returned"] = "Your car has been return", + ["finish_job"] = "Mission status: ~g~", + ["end_delivery"] = "Press ~INPUT_CONTEXT~ to terminate the mission, please sit in the car, or you will not get the safe deposit", + ["blip_name"] = "Delivery Hub", + ["dst_blip"] = "Delivery", + ["delivery_end"] = "Delivery End", + ["delivery_failed"] = "You will lose the safe deposit because your car broken or lost", + ["delivery_finish"] = "You finished the deliveries mission", + ["delivery_start"] = "Delivery", + ["delivery_tips"] = "Drive the car safely to the destination and delivery the ~y~goods~s~", + ["not_enough_money"] = "Your have not enough bank money to pay the ~r~safe deposit~s~", } diff --git a/server-data/resources/[bpt_addons]/bpt_deliveries/locales/fr.lua b/server-data/resources/[bpt_addons]/bpt_deliveries/locales/fr.lua index 4c22dfc8c..78b101579 100644 --- a/server-data/resources/[bpt_addons]/bpt_deliveries/locales/fr.lua +++ b/server-data/resources/[bpt_addons]/bpt_deliveries/locales/fr.lua @@ -1,25 +1,25 @@ Locales["fr"] = { - ["delivery_not_available"] = "Ce modèle est ~r~indisponible~w~, merci d'utilisé une ~g~moto~w~ ou un ~g~van~w~.", - ["start_delivery"] = "Appuyez sur ~INPUT_CONTEXT~ pour demarrer les livraisons, dépôt de garantie ~g~$", - ["safe_deposit_received"] = "Le dépôt de garantie à été retiré de votre compte bancaire", - ["safe_deposit_returned"] = "Le dépôt de garantie revient maintenant sur votre compte bancaire", - ["safe_deposit_withheld"] = "Mission ~r~échoué~w~, votre dépôt de garantie à été ~r~retenue~w~.", - ["delivery_point_reward"] = "Mission réussie, vous recevez ~g~$", - ["get_back_in_vehicle"] = "Entrez dans votre ~y~véhicule~s~", - ["remove_goods"] = "Appuyez sur ~INPUT_CONTEXT~ pour retirer votre ~y~marchandise~s~ de votre véhicule", - ["remove_goods_subtext"] = "Laissez votre voiture et sortez la ~y~marchandise~w~", - ["drive_next_point"] = "Conduisez à la prochaine ~y~destination~w~", - ["deliver_inside_shop"] = "Ammener votre ~y~marchandise~w~ à la destination", - ["get_back_to_deliveryhub"] = "Retour au centre de livraison et restituer votre véhicule", - ["delivery_vehicle_returned"] = "Vous avez bien rendu le véhicule", - ["finish_job"] = "Status de la mission: ~g~", - ["end_delivery"] = "Appuyez sur ~INPUT_CONTEXT~ pour terminer la mission", - ["blip_name"] = "Centre de livraison", - ["dst_blip"] = "Livraison", - ["delivery_end"] = "Fin de livraison", - ["delivery_failed"] = "Vous avez perdue votre caution, car le véhicule est endommmager", - ["delivery_finish"] = "Vous avez terminer vos missions de livraison", - ["delivery_start"] = "Livraison", - ["delivery_tips"] = "Conduisez votre véhicule en toute sécurité jusqu'à la destination et livrer la ~y~marchandise~s~", - ["not_enough_money"] = "Vous n'avez pas assez d'argent sur votre compte en banque pour payer la ~r~caution~s~", + ["delivery_not_available"] = "Ce modèle est ~r~indisponible~w~, merci d'utilisé une ~g~moto~w~ ou un ~g~van~w~.", + ["start_delivery"] = "Appuyez sur ~INPUT_CONTEXT~ pour demarrer les livraisons, dépôt de garantie ~g~$", + ["safe_deposit_received"] = "Le dépôt de garantie à été retiré de votre compte bancaire", + ["safe_deposit_returned"] = "Le dépôt de garantie revient maintenant sur votre compte bancaire", + ["safe_deposit_withheld"] = "Mission ~r~échoué~w~, votre dépôt de garantie à été ~r~retenue~w~.", + ["delivery_point_reward"] = "Mission réussie, vous recevez ~g~$", + ["get_back_in_vehicle"] = "Entrez dans votre ~y~véhicule~s~", + ["remove_goods"] = "Appuyez sur ~INPUT_CONTEXT~ pour retirer votre ~y~marchandise~s~ de votre véhicule", + ["remove_goods_subtext"] = "Laissez votre voiture et sortez la ~y~marchandise~w~", + ["drive_next_point"] = "Conduisez à la prochaine ~y~destination~w~", + ["deliver_inside_shop"] = "Ammener votre ~y~marchandise~w~ à la destination", + ["get_back_to_deliveryhub"] = "Retour au centre de livraison et restituer votre véhicule", + ["delivery_vehicle_returned"] = "Vous avez bien rendu le véhicule", + ["finish_job"] = "Status de la mission: ~g~", + ["end_delivery"] = "Appuyez sur ~INPUT_CONTEXT~ pour terminer la mission", + ["blip_name"] = "Centre de livraison", + ["dst_blip"] = "Livraison", + ["delivery_end"] = "Fin de livraison", + ["delivery_failed"] = "Vous avez perdue votre caution, car le véhicule est endommmager", + ["delivery_finish"] = "Vous avez terminer vos missions de livraison", + ["delivery_start"] = "Livraison", + ["delivery_tips"] = "Conduisez votre véhicule en toute sécurité jusqu'à la destination et livrer la ~y~marchandise~s~", + ["not_enough_money"] = "Vous n'avez pas assez d'argent sur votre compte en banque pour payer la ~r~caution~s~", } diff --git a/server-data/resources/[bpt_addons]/bpt_deliveries/locales/it.lua b/server-data/resources/[bpt_addons]/bpt_deliveries/locales/it.lua index b671d4ba6..2335d7c5c 100644 --- a/server-data/resources/[bpt_addons]/bpt_deliveries/locales/it.lua +++ b/server-data/resources/[bpt_addons]/bpt_deliveries/locales/it.lua @@ -1,25 +1,25 @@ Locales["it"] = { - ["delivery_not_available"] = "Questo modello è ~r~Unavailable~w~, utilizza ~g~bike~w~ o ~g~van~w~.", - ["start_delivery"] = "Premi ~INPUT_CONTEXT~ per iniziare il lavoro, è necessario pagare la cauzione del veicolo ~g~$", - ["safe_deposit_received"] = "La cauzione è stata rimossa dal tuo conto bancario", - ["safe_deposit_returned"] = "La cauzione verrà restituita sul tuo conto bancario ora", - ["safe_deposit_withheld"] = "Missione ~r~failed~w~, la cauzione è stata ~r~detain~w~.", - ["delivery_point_reward"] = "Missione completata, hai ricevuto ~g~$", - ["get_back_in_vehicle"] = "Ritorna nel veicolo", - ["remove_goods"] = "Premi ~INPUT_CONTEXT~ per estrarre il ~y~merce~s~ dalla macchina", - ["remove_goods_subtext"] = "Lascia la macchina e prendi la ~y~merce~w~", - ["drive_next_point"] = "Guida l'auto fino al prossimo ~y~destination~w~", - ["deliver_inside_shop"] = "Prendi la ~y~merce~w~ e consegnala", - ["get_back_to_deliveryhub"] = "Ritorno all'hub di consegna e riconsegna l'auto", - ["delivery_vehicle_returned"] = "La tua auto è stata restituita", - ["finish_job"] = "Stato della missione: ~g~", - ["end_delivery"] = "Premi ~INPUT_CONTEXT~ per terminare la missione, recati in macchina, altrimenti non riceverai la cauzione", - ["blip_name"] = "Hub di consegna", - ["dst_blip"] = "Consegna", - ["delivery_end"] = "Fine consegna", - ["delivery_failed"] = "Perderai la cauzione del veicolo perché la tua auto è rotta o smarrita", - ["delivery_finish"] = "Hai completato le missioni", - ["delivery_start"] = "Consegna", - ["delivery_tips"] = "Guida l'auto fino alla destinazione e consegnala ~y~goods~s~", - ["not_enough_money"] = "Non hai abbastanza soldi in banca per pagare ~r~safe deposit~s~", + ["delivery_not_available"] = "Questo modello è ~r~Unavailable~w~, utilizza ~g~bike~w~ o ~g~van~w~.", + ["start_delivery"] = "Premi ~INPUT_CONTEXT~ per iniziare il lavoro, è necessario pagare la cauzione del veicolo ~g~$", + ["safe_deposit_received"] = "La cauzione è stata rimossa dal tuo conto bancario", + ["safe_deposit_returned"] = "La cauzione verrà restituita sul tuo conto bancario ora", + ["safe_deposit_withheld"] = "Missione ~r~failed~w~, la cauzione è stata ~r~detain~w~.", + ["delivery_point_reward"] = "Missione completata, hai ricevuto ~g~$", + ["get_back_in_vehicle"] = "Ritorna nel veicolo", + ["remove_goods"] = "Premi ~INPUT_CONTEXT~ per estrarre il ~y~merce~s~ dalla macchina", + ["remove_goods_subtext"] = "Lascia la macchina e prendi la ~y~merce~w~", + ["drive_next_point"] = "Guida l'auto fino al prossimo ~y~destination~w~", + ["deliver_inside_shop"] = "Prendi la ~y~merce~w~ e consegnala", + ["get_back_to_deliveryhub"] = "Ritorno all'hub di consegna e riconsegna l'auto", + ["delivery_vehicle_returned"] = "La tua auto è stata restituita", + ["finish_job"] = "Stato della missione: ~g~", + ["end_delivery"] = "Premi ~INPUT_CONTEXT~ per terminare la missione, recati in macchina, altrimenti non riceverai la cauzione", + ["blip_name"] = "Hub di consegna", + ["dst_blip"] = "Consegna", + ["delivery_end"] = "Fine consegna", + ["delivery_failed"] = "Perderai la cauzione del veicolo perché la tua auto è rotta o smarrita", + ["delivery_finish"] = "Hai completato le missioni", + ["delivery_start"] = "Consegna", + ["delivery_tips"] = "Guida l'auto fino alla destinazione e consegnala ~y~goods~s~", + ["not_enough_money"] = "Non hai abbastanza soldi in banca per pagare ~r~safe deposit~s~", } diff --git a/server-data/resources/[bpt_addons]/bpt_deliveries/locales/zh.lua b/server-data/resources/[bpt_addons]/bpt_deliveries/locales/zh.lua index f1c6eefd3..6be2df8da 100644 --- a/server-data/resources/[bpt_addons]/bpt_deliveries/locales/zh.lua +++ b/server-data/resources/[bpt_addons]/bpt_deliveries/locales/zh.lua @@ -1,25 +1,25 @@ Locales["zh"] = { - ["delivery_not_available"] = "這個模式 ~r~不可用~w~,請使用 ~g~自行車~w~ 或 ~g~廂型車~w~.", - ["start_delivery"] = "按下 ~INPUT_CONTEXT~ 來開始送貨,你需要支付押金 ~g~¥", - ["safe_deposit_received"] = "車輛押金已經從你的銀行賬戶扣除", - ["safe_deposit_returned"] = "車輛押金已經退還到你的銀行賬戶", - ["safe_deposit_withheld"] = "送貨任務 ~r~失敗~w~。你的押金已經被 ~r~扣留~w~ 了", - ["delivery_point_reward"] = "任務完成,你收到了 ~g~¥", - ["get_back_in_vehicle"] = "進入你的 ~b~車輛 ~s~!", - ["remove_goods"] = "按下 ~INPUT_CONTEXT~ 來卸下 ~b~貨物~w~", - ["remove_goods_subtext"] = "離開車輛並從車尾取下 ~b~貨物~w~", - ["drive_next_point"] = "開車出發前往下一個 ~b~送貨地點~w~", - ["deliver_inside_shop"] = "將 ~b~貨物~w~ 送到指定地點", - ["get_back_to_deliveryhub"] = "回到 ~y~調度中心 ~s~並退還車輛", - ["delivery_vehicle_returned"] = "你的車輛已經退還", - ["finish_job"] = "任務完成進度:~g~", - ["end_delivery"] = "按下 ~INPUT_CONTEXT~ 來結束任務,確保你在車里,否則無法退還你的押金", - ["blip_name"] = "物流調度中心", - ["dst_blip"] = "目的地", - ["delivery_end"] = "運輸任務結束", - ["delivery_failed"] = "由於你的車輛損壞或丟失,你失去了所有的押金", - ["delivery_finish"] = "你已經完成了運輸貨物任務", - ["delivery_start"] = "運輸任務開始", - ["delivery_tips"] = "安全駕駛車輛到達目的地並交付 ~b~貨物~s~", - ["not_enough_money"] = "你的銀行賬戶沒有足夠的錢支付 ~r~押金~s~", + ["delivery_not_available"] = "這個模式 ~r~不可用~w~,請使用 ~g~自行車~w~ 或 ~g~廂型車~w~.", + ["start_delivery"] = "按下 ~INPUT_CONTEXT~ 來開始送貨,你需要支付押金 ~g~¥", + ["safe_deposit_received"] = "車輛押金已經從你的銀行賬戶扣除", + ["safe_deposit_returned"] = "車輛押金已經退還到你的銀行賬戶", + ["safe_deposit_withheld"] = "送貨任務 ~r~失敗~w~。你的押金已經被 ~r~扣留~w~ 了", + ["delivery_point_reward"] = "任務完成,你收到了 ~g~¥", + ["get_back_in_vehicle"] = "進入你的 ~b~車輛 ~s~!", + ["remove_goods"] = "按下 ~INPUT_CONTEXT~ 來卸下 ~b~貨物~w~", + ["remove_goods_subtext"] = "離開車輛並從車尾取下 ~b~貨物~w~", + ["drive_next_point"] = "開車出發前往下一個 ~b~送貨地點~w~", + ["deliver_inside_shop"] = "將 ~b~貨物~w~ 送到指定地點", + ["get_back_to_deliveryhub"] = "回到 ~y~調度中心 ~s~並退還車輛", + ["delivery_vehicle_returned"] = "你的車輛已經退還", + ["finish_job"] = "任務完成進度:~g~", + ["end_delivery"] = "按下 ~INPUT_CONTEXT~ 來結束任務,確保你在車里,否則無法退還你的押金", + ["blip_name"] = "物流調度中心", + ["dst_blip"] = "目的地", + ["delivery_end"] = "運輸任務結束", + ["delivery_failed"] = "由於你的車輛損壞或丟失,你失去了所有的押金", + ["delivery_finish"] = "你已經完成了運輸貨物任務", + ["delivery_start"] = "運輸任務開始", + ["delivery_tips"] = "安全駕駛車輛到達目的地並交付 ~b~貨物~s~", + ["not_enough_money"] = "你的銀行賬戶沒有足夠的錢支付 ~r~押金~s~", } diff --git a/server-data/resources/[bpt_addons]/bpt_deliveries/server/main.lua b/server-data/resources/[bpt_addons]/bpt_deliveries/server/main.lua index 590c190ee..19d494616 100644 --- a/server-data/resources/[bpt_addons]/bpt_deliveries/server/main.lua +++ b/server-data/resources/[bpt_addons]/bpt_deliveries/server/main.lua @@ -8,59 +8,59 @@ RegisterServerEvent("bpt_deliveries:getPlayerJob:server") -- Return safe deposit event AddEventHandler("bpt_deliveries:returnSafe:server", function(deliveryType, safeReturn) - local xPlayer = ESX.GetPlayerFromId(source) - if safeReturn then - local SafeMoney = 4000 - for k, v in pairs(Config.Safe) do - if k == deliveryType then - SafeMoney = v - break - end - end - xPlayer.addAccountMoney("bank", SafeMoney) - xPlayer.showNotification(TranslateCap("safe_deposit_returned")) - else - xPlayer.showNotification(TranslateCap("safe_deposit_withheld")) - end + local xPlayer = ESX.GetPlayerFromId(source) + if safeReturn then + local SafeMoney = 4000 + for k, v in pairs(Config.Safe) do + if k == deliveryType then + SafeMoney = v + break + end + end + xPlayer.addAccountMoney("bank", SafeMoney) + xPlayer.showNotification(TranslateCap("safe_deposit_returned")) + else + xPlayer.showNotification(TranslateCap("safe_deposit_withheld")) + end end) -- Finish delivery mission event AddEventHandler("bpt_deliveries:finishDelivery:server", function(deliveryType) - local xPlayer = ESX.GetPlayerFromId(source) - local deliveryMoney = 800 - for k, v in pairs(Config.Rewards) do - if k == deliveryType then - deliveryMoney = v - break - end - end - xPlayer.addMoney(deliveryMoney) - xPlayer.showNotification(TranslateCap("delivery_point_reward") .. tostring(deliveryMoney)) + local xPlayer = ESX.GetPlayerFromId(source) + local deliveryMoney = 800 + for k, v in pairs(Config.Rewards) do + if k == deliveryType then + deliveryMoney = v + break + end + end + xPlayer.addMoney(deliveryMoney) + xPlayer.showNotification(TranslateCap("delivery_point_reward") .. tostring(deliveryMoney)) end) -- Remove safe deposit event (On start mission) AddEventHandler("bpt_deliveries:removeSafeMoney:server", function(deliveryType) - local xPlayer = ESX.GetPlayerFromId(source) - local SafeMoney = 4000 - for k, v in pairs(Config.Safe) do - if k == deliveryType then - SafeMoney = v - break - end - end - local PlayerMoney = xPlayer.getAccount("bank").money - if PlayerMoney >= SafeMoney then - xPlayer.removeAccountMoney("bank", SafeMoney) - xPlayer.showNotification(TranslateCap("safe_deposit_received")) - TriggerClientEvent("bpt_deliveries:startJob:client", source, deliveryType) - else - xPlayer.showNotification(TranslateCap("not_enough_money")) - end + local xPlayer = ESX.GetPlayerFromId(source) + local SafeMoney = 4000 + for k, v in pairs(Config.Safe) do + if k == deliveryType then + SafeMoney = v + break + end + end + local PlayerMoney = xPlayer.getAccount("bank").money + if PlayerMoney >= SafeMoney then + xPlayer.removeAccountMoney("bank", SafeMoney) + xPlayer.showNotification(TranslateCap("safe_deposit_received")) + TriggerClientEvent("bpt_deliveries:startJob:client", source, deliveryType) + else + xPlayer.showNotification(TranslateCap("not_enough_money")) + end end) -- Get the player job name AddEventHandler("bpt_deliveries:getPlayerJob:server", function() - local xPlayer = ESX.GetPlayerFromId(source) - print("Player request job: " .. source .. ", " .. xPlayer.job.name) - TriggerClientEvent("bpt_deliveries:setPlayerJob:client", source, xPlayer.job.name) + local xPlayer = ESX.GetPlayerFromId(source) + print("Player request job: " .. source .. ", " .. xPlayer.job.name) + TriggerClientEvent("bpt_deliveries:setPlayerJob:client", source, xPlayer.job.name) end)