From 05b0b21d893e92e9a50b6d01efb68b0c0587a487 Mon Sep 17 00:00:00 2001 From: bitpredator <67551273+bitpredator@users.noreply.github.com> Date: Wed, 28 Feb 2024 12:25:31 +0100 Subject: [PATCH] chore: bpt_importjob database update - Created database for the Italian language - Translated the database into the main directory in English - fxmanifest updated to version 1.0.1 - Improved code formatting --- .../[bpt_addons]/bpt_importjob/README.md | 2 +- .../bpt_importjob/bpt_importjob.sql | 10 +- .../bpt_importjob/client/main.lua | 636 ++++++++++-------- .../[bpt_addons]/bpt_importjob/config.lua | 59 +- .../[bpt_addons]/bpt_importjob/fxmanifest.lua | 38 +- .../[bpt_addons]/bpt_importjob/locales/en.lua | 68 +- .../[bpt_addons]/bpt_importjob/locales/it.lua | 64 +- .../localization/bpt_importjob.sql | 23 + .../bpt_importjob/server/main.lua | 130 ++-- 9 files changed, 562 insertions(+), 468 deletions(-) create mode 100644 server-data/resources/[bpt_addons]/bpt_importjob/localization/bpt_importjob.sql diff --git a/server-data/resources/[bpt_addons]/bpt_importjob/README.md b/server-data/resources/[bpt_addons]/bpt_importjob/README.md index aa204e336..73cccce79 100644 --- a/server-data/resources/[bpt_addons]/bpt_importjob/README.md +++ b/server-data/resources/[bpt_addons]/bpt_importjob/README.md @@ -1,7 +1,7 @@

bpt_importjob

Discord -Copyright (C) 2022-2023 bitpredator +Copyright (C) 2022-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 the Free Software Foundation, either version 3 Of the License, Or (at your option) any later version. diff --git a/server-data/resources/[bpt_addons]/bpt_importjob/bpt_importjob.sql b/server-data/resources/[bpt_addons]/bpt_importjob/bpt_importjob.sql index 06bcd8f0b..c34857fb5 100644 --- a/server-data/resources/[bpt_addons]/bpt_importjob/bpt_importjob.sql +++ b/server-data/resources/[bpt_addons]/bpt_importjob/bpt_importjob.sql @@ -15,9 +15,9 @@ INSERT INTO `jobs` (name, label) VALUES ; INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES - ('import',0,'ontrial','in prova',12,'{"hair_2":0,"hair_color_2":0,"torso_1":32,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":31,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":0,"age_2":0,"glasses_2":0,"ears_2":0,"arms":27,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), - ('import',1,'employee','dipendente',24,'{"hair_2":0,"hair_color_2":0,"torso_1":32,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":31,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":0,"age_2":0,"glasses_2":0,"ears_2":0,"arms":27,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), - ('import',2,'driver','autista',36,'{"hair_2":0,"hair_color_2":0,"torso_1":26,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":57,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":4,"age_2":0,"glasses_2":0,"ears_2":0,"arms":11,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":0,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), - ('import',3,'responsible','responsabile',48,'{"hair_2":0,"hair_color_2":0,"torso_1":26,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":57,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":4,"age_2":0,"glasses_2":0,"ears_2":0,"arms":11,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":0,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), - ('import',4,'boss','Direttore',0,'{"hair_2":0,"hair_color_2":0,"torso_1":29,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":31,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":4,"age_2":0,"glasses_2":0,"ears_2":0,"arms":1,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":0,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":4,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}') + ('import',0,'ontrial','Ontrial',12,'{"hair_2":0,"hair_color_2":0,"torso_1":32,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":31,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":0,"age_2":0,"glasses_2":0,"ears_2":0,"arms":27,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('import',1,'employee','Employee',24,'{"hair_2":0,"hair_color_2":0,"torso_1":32,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":31,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":0,"age_2":0,"glasses_2":0,"ears_2":0,"arms":27,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('import',2,'driver','Driver',36,'{"hair_2":0,"hair_color_2":0,"torso_1":26,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":57,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":4,"age_2":0,"glasses_2":0,"ears_2":0,"arms":11,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":0,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('import',3,'responsible','Responsible',48,'{"hair_2":0,"hair_color_2":0,"torso_1":26,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":57,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":4,"age_2":0,"glasses_2":0,"ears_2":0,"arms":11,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":0,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('import',4,'boss','Boss',0,'{"hair_2":0,"hair_color_2":0,"torso_1":29,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":31,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":4,"age_2":0,"glasses_2":0,"ears_2":0,"arms":1,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":0,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":4,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}') ; diff --git a/server-data/resources/[bpt_addons]/bpt_importjob/client/main.lua b/server-data/resources/[bpt_addons]/bpt_importjob/client/main.lua index d6f1ab4d9..0b294ae78 100644 --- a/server-data/resources/[bpt_addons]/bpt_importjob/client/main.lua +++ b/server-data/resources/[bpt_addons]/bpt_importjob/client/main.lua @@ -1,381 +1,443 @@ local HasAlreadyEnteredMarker -local CurrentAction, CurrentActionMsg, CurrentActionData = nil, '', {} +local CurrentAction, CurrentActionMsg, CurrentActionData = nil, "", {} local LastZone -RegisterNetEvent('esx:playerLoaded') -AddEventHandler('esx:playerLoaded', function(xPlayer) - ESX.PlayerData = xPlayer - ESX.PlayerLoaded = true +RegisterNetEvent("esx:playerLoaded") +AddEventHandler("esx:playerLoaded", function(xPlayer) + ESX.PlayerData = xPlayer + ESX.PlayerLoaded = true end) -RegisterNetEvent('esx:onPlayerLogout') -AddEventHandler('esx:onPlayerLogout', function() - ESX.PlayerLoaded = false - ESX.PlayerData = {} +RegisterNetEvent("esx:onPlayerLogout") +AddEventHandler("esx:onPlayerLogout", function() + ESX.PlayerLoaded = false + ESX.PlayerData = {} end) -RegisterNetEvent('esx:setJob') -AddEventHandler('esx:setJob', function(job) - ESX.PlayerData.job = job +RegisterNetEvent("esx:setJob") +AddEventHandler("esx:setJob", function(job) + ESX.PlayerData.job = job end) function DrawSub(msg, time) - ClearPrints() - BeginTextCommandPrint('STRING') - AddTextComponentSubstringPlayerName(msg) - EndTextCommandPrint(time, 1) + ClearPrints() + BeginTextCommandPrint("STRING") + AddTextComponentSubstringPlayerName(msg) + EndTextCommandPrint(time, 1) end function ShowLoadingPromt(msg, time, type) - CreateThread(function() - Wait(0) + CreateThread(function() + Wait(0) - BeginTextCommandBusyspinnerOn('STRING') - AddTextComponentSubstringPlayerName(msg) - EndTextCommandBusyspinnerOn(type) - Wait(time) + BeginTextCommandBusyspinnerOn("STRING") + AddTextComponentSubstringPlayerName(msg) + EndTextCommandBusyspinnerOn(type) + Wait(time) - BusyspinnerOff() - end) + BusyspinnerOff() + end) end function OpenCloakroom() - local elements = { - {unselectable = true, icon = "fas fa-shirt", title = _U('cloakroom_menu')}, - {icon = "fas fa-shirt", title = _U('wear_citizen'), value = "wear_citizen"}, - {icon = "fas fa-shirt", title = _U('wear_work'), value = "wear_work"}, - } - - ESX.OpenContext("right", elements, function(_,element) - if element.value == "wear_citizen" then - ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin) - TriggerEvent('skinchanger:loadSkin', skin) - end) - elseif element.value == "wear_work" then - ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) - if skin.sex == 0 then - TriggerEvent('skinchanger:loadClothes', skin, jobSkin.skin_male) - else - TriggerEvent('skinchanger:loadClothes', skin, jobSkin.skin_female) - end - end) - end + local elements = { + { unselectable = true, icon = "fas fa-shirt", title = _U("cloakroom_menu") }, + { icon = "fas fa-shirt", title = _U("wear_citizen"), value = "wear_citizen" }, + { icon = "fas fa-shirt", title = _U("wear_work"), value = "wear_work" }, + } + + ESX.OpenContext("right", elements, function(_, element) + if element.value == "wear_citizen" then + ESX.TriggerServerCallback("esx_skin:getPlayerSkin", function(skin) + TriggerEvent("skinchanger:loadSkin", skin) + end) + elseif element.value == "wear_work" then + ESX.TriggerServerCallback("esx_skin:getPlayerSkin", function(skin, jobSkin) + if skin.sex == 0 then + TriggerEvent("skinchanger:loadClothes", skin, jobSkin.skin_male) + else + TriggerEvent("skinchanger:loadClothes", skin, jobSkin.skin_female) + end + end) + end ESX.CloseContext() - end, function() - CurrentAction = 'cloakroom' - CurrentActionMsg = _U('cloakroom_prompt') - CurrentActionData = {} - end) + end, function() + CurrentAction = "cloakroom" + CurrentActionMsg = _U("cloakroom_prompt") + CurrentActionData = {} + end) end function OpenVehicleSpawnerMenu() - local elements = { - {unselectable = true, icon = "fas fa-car", title = _U('spawn_veh')} - } - - if Config.EnableSocietyOwnedVehicles then - ESX.TriggerServerCallback('esx_society:getVehiclesInGarage', function(vehicles) + local elements = { + { unselectable = true, icon = "fas fa-car", title = _U("spawn_veh") }, + } + if Config.EnableSocietyOwnedVehicles then + ESX.TriggerServerCallback("esx_society:getVehiclesInGarage", function(vehicles) if #vehicles == 0 then - ESX.ShowNotification(_U('empty_garage')) + ESX.ShowNotification(_U("empty_garage")) return end - for i = 1, #vehicles, 1 do - elements[#elements+1] = { - icon = "fas fa-car", - title = GetDisplayNameFromVehicleModel(vehicles[i].model) .. ' [' .. vehicles[i].plate .. ']', - value = vehicles[i] - } - end + for i = 1, #vehicles, 1 do + elements[#elements + 1] = { + icon = "fas fa-car", + title = GetDisplayNameFromVehicleModel(vehicles[i].model) .. " [" .. vehicles[i].plate .. "]", + value = vehicles[i], + } + end - ESX.OpenContext("right", elements, function(_,element) - if not ESX.Game.IsSpawnPointClear(Config.Zones.VehicleSpawnPoint.Pos, 5.0) then - ESX.ShowNotification(_U('spawnpoint_blocked')) - return - end + ESX.OpenContext("right", elements, function(_, element) + if not ESX.Game.IsSpawnPointClear(Config.Zones.VehicleSpawnPoint.Pos, 5.0) then + ESX.ShowNotification(_U("spawnpoint_blocked")) + return + end if element.value == nil then print("ERROR: Context menu clicked item value is nil!") return end - local vehicleProps = element.value - ESX.TriggerServerCallback("bpt_importjob:SpawnVehicle", function() - return - end, vehicleProps.model, vehicleProps) - TriggerServerEvent('esx_society:removeVehicleFromGarage', 'import', vehicleProps) - end, function() - CurrentAction = 'vehicle_spawner' - CurrentActionMsg = _U('spawner_prompt') - CurrentActionData = {} - end) - end, 'import') - else -- not society vehicles - + local vehicleProps = element.value + ESX.TriggerServerCallback("bpt_importjob:SpawnVehicle", function() + return + end, vehicleProps.model, vehicleProps) + TriggerServerEvent("esx_society:removeVehicleFromGarage", "import", vehicleProps) + end, function() + CurrentAction = "vehicle_spawner" + CurrentActionMsg = _U("spawner_prompt") + CurrentActionData = {} + end) + end, "import") + else -- not society vehicles if #Config.AuthorizedVehicles == 0 then - ESX.ShowNotification(_U('empty_garage')) + ESX.ShowNotification(_U("empty_garage")) return end for i = 1, #Config.AuthorizedVehicles, 1 do - elements[#elements+1] = { + elements[#elements + 1] = { icon = "fas fa-car", title = Config.AuthorizedVehicles[i].label, - value = Config.AuthorizedVehicles[i].model + value = Config.AuthorizedVehicles[i].model, } end - ESX.OpenContext("right", elements, function(_,element) - if not ESX.Game.IsSpawnPointClear(Config.Zones.VehicleSpawnPoint.Pos, 5.0) then - ESX.ShowNotification(_U('spawnpoint_blocked')) - return - end + ESX.OpenContext("right", elements, function(_, element) + if not ESX.Game.IsSpawnPointClear(Config.Zones.VehicleSpawnPoint.Pos, 5.0) then + ESX.ShowNotification(_U("spawnpoint_blocked")) + return + end if element.value == nil then print("ERROR: Context menu clicked item value is nil!") return end - ESX.TriggerServerCallback("bpt_importjob:SpawnVehicle", function() - ESX.ShowNotification(_U('vehicle_spawned'), "success") - end, element.value, {plate = "IMPO JOB"}) + ESX.TriggerServerCallback("bpt_importjob:SpawnVehicle", function() + ESX.ShowNotification(_U("vehicle_spawned"), "success") + end, element.value, { plate = "IMPO JOB" }) ESX.CloseContext() - end, function() - CurrentAction = 'vehicle_spawner' - CurrentActionMsg = _U('spawner_prompt') - CurrentActionData = {} - end) - end + end, function() + CurrentAction = "vehicle_spawner" + CurrentActionMsg = _U("spawner_prompt") + CurrentActionData = {} + end) + end end function DeleteJobVehicle() - if Config.EnableSocietyOwnedVehicles then - local vehicleProps = ESX.Game.GetVehicleProperties(CurrentActionData.vehicle) - TriggerServerEvent('esx_society:putVehicleInGarage', 'import', vehicleProps) - ESX.Game.DeleteVehicle(CurrentActionData.vehicle) - else - if IsInAuthorizedVehicle() then - ESX.Game.DeleteVehicle(CurrentActionData.vehicle) - - if Config.MaxInService ~= -1 then - TriggerServerEvent('esx_service:disableService', 'import') - end - else - ESX.ShowNotification(_U('only_import')) - end - end + if Config.EnableSocietyOwnedVehicles then + local vehicleProps = ESX.Game.GetVehicleProperties(CurrentActionData.vehicle) + TriggerServerEvent("esx_society:putVehicleInGarage", "import", vehicleProps) + ESX.Game.DeleteVehicle(CurrentActionData.vehicle) + else + if IsInAuthorizedVehicle() then + ESX.Game.DeleteVehicle(CurrentActionData.vehicle) + + if Config.MaxInService ~= -1 then + TriggerServerEvent("esx_service:disableService", "import") + end + else + ESX.ShowNotification(_U("only_import")) + end + end end function OpenImportActionsMenu() - local elements = { - {unselectable = true, icon = "fas fa-import", title = _U('import')}, - {icon = "fas fa-box",title = _U('deposit_stock'),value = 'put_stock'}, - {icon = "fas fa-box", title = _U('take_stock'), value = 'get_stock'} - } - - if Config.EnablePlayerManagement and ESX.PlayerData.job ~= nil and ESX.PlayerData.job.grade_name == 'boss' then - elements[#elements+1] = { - icon = "fas fa-wallet", - title = _U('boss_actions'), - value = "boss_actions" - } - end - - ESX.OpenContext("right", elements, function(_, element) - if Config.OxInventory and (element.value == 'put_stock' or element.value == 'get_stock') then - exports.ox_inventory:openInventory('stash', 'society_import') - return ESX.CloseContext() - elseif element.value == 'put_stock' then - OpenPutStocksMenu() - elseif element.value == 'get_stock' then - OpenGetStocksMenu() - elseif element.value == 'boss_actions' then - TriggerEvent('esx_society:openBossMenu', 'import', function(_, menu) - menu.close() - end) - end - end, function() - CurrentAction = 'import_actions_menu' - CurrentActionMsg = _U('press_to_open') - CurrentActionData = {} - end) + local elements = { + { unselectable = true, icon = "fas fa-import", title = _U("import") }, + { icon = "fas fa-box", title = _U("deposit_stock"), value = "put_stock" }, + { icon = "fas fa-box", title = _U("take_stock"), value = "get_stock" }, + } + + if Config.EnablePlayerManagement and ESX.PlayerData.job ~= nil and ESX.PlayerData.job.grade_name == "boss" then + elements[#elements + 1] = { + icon = "fas fa-wallet", + title = _U("boss_actions"), + value = "boss_actions", + } + end + + ESX.OpenContext("right", elements, function(_, element) + if Config.OxInventory and (element.value == "put_stock" or element.value == "get_stock") then + exports.ox_inventory:openInventory("stash", "society_import") + return ESX.CloseContext() + elseif element.value == "put_stock" then + OpenPutStocksMenu() + elseif element.value == "get_stock" then + OpenGetStocksMenu() + elseif element.value == "boss_actions" then + TriggerEvent("esx_society:openBossMenu", "import", function(_, menu) + menu.close() + end) + end + end, function() + CurrentAction = "import_actions_menu" + CurrentActionMsg = _U("press_to_open") + CurrentActionData = {} + end) end function OpenMobileImportActionsMenu() - local elements = { - {unselectable = true, icon = "fas fa-import", title = _U('import')}, - {icon = "fas fa-scroll", title = _U('billing'), value = "billing"}, - } - - ESX.OpenContext("right", elements, function(_, element) - if element.value == "billing" then - local elements2 = { - {unselectable = true, icon = "fas fa-import", title = element.title}, - {title = _U('amount'), input = true, inputType = "number", inputMin = 1, inputMax = 250000, inputPlaceholder = _U('bill_amount')}, - {icon = "fas fa-check-double", title = _U('confirm'), value = "confirm"} - } - - ESX.OpenContext("right", elements2, function(menu2) - local amount = tonumber(menu2.eles[2].inputValue) - if amount == nil then - ESX.ShowNotification(_U('amount_invalid')) - else - ESX.CloseContext() - local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer() - if closestPlayer == -1 or closestDistance > 3.0 then - ESX.ShowNotification(_U('no_players_near')) - else - TriggerServerEvent('esx_billing:sendBill', GetPlayerServerId(closestPlayer), 'society_import', - 'Import', amount) - ESX.ShowNotification(_U('billing_sent')) - end - end - end) - end - end) + local elements = { + { unselectable = true, icon = "fas fa-import", title = _U("import") }, + { icon = "fas fa-scroll", title = _U("billing"), value = "billing" }, + } + + ESX.OpenContext("right", elements, function(_, element) + if element.value == "billing" then + local elements2 = { + { unselectable = true, icon = "fas fa-import", title = element.title }, + { + title = _U("amount"), + input = true, + inputType = "number", + inputMin = 1, + inputMax = 250000, + inputPlaceholder = _U("bill_amount"), + }, + { icon = "fas fa-check-double", title = _U("confirm"), value = "confirm" }, + } + + ESX.OpenContext("right", elements2, function(menu2) + local amount = tonumber(menu2.eles[2].inputValue) + if amount == nil then + ESX.ShowNotification(_U("amount_invalid")) + else + ESX.CloseContext() + local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer() + if closestPlayer == -1 or closestDistance > 3.0 then + ESX.ShowNotification(_U("no_players_near")) + else + TriggerServerEvent( + "esx_billing:sendBill", + GetPlayerServerId(closestPlayer), + "society_import", + "Import", + amount + ) + ESX.ShowNotification(_U("billing_sent")) + end + end + end) + end + end) end function IsInAuthorizedVehicle() - local playerPed = PlayerPedId() - local vehModel = GetEntityModel(GetVehiclePedIsIn(playerPed, false)) + local playerPed = PlayerPedId() + local vehModel = GetEntityModel(GetVehiclePedIsIn(playerPed, false)) - for i = 1, #Config.AuthorizedVehicles, 1 do - if vehModel == joaat(Config.AuthorizedVehicles[i].model) then - return true - end - end + for i = 1, #Config.AuthorizedVehicles, 1 do + if vehModel == joaat(Config.AuthorizedVehicles[i].model) then + return true + end + end - return false + return false end -AddEventHandler('bpt_importjob:hasEnteredMarker', function(zone) - if zone == 'VehicleSpawner' then - CurrentAction = 'vehicle_spawner' - CurrentActionMsg = _U('spawner_prompt') - CurrentActionData = {} - elseif zone == 'VehicleDeleter' then - local playerPed = PlayerPedId() - local vehicle = GetVehiclePedIsIn(playerPed, false) - - if IsPedInAnyVehicle(playerPed, false) and GetPedInVehicleSeat(vehicle, -1) == playerPed then - CurrentAction = 'delete_vehicle' - CurrentActionMsg = _U('store_veh') - CurrentActionData = { - vehicle = vehicle - } - end - elseif zone == 'ImportActions' then - CurrentAction = 'import_actions_menu' - CurrentActionMsg = _U('press_to_open') - CurrentActionData = {} - - elseif zone == 'Cloakroom' then - CurrentAction = 'cloakroom' - CurrentActionMsg = _U('cloakroom_prompt') - CurrentActionData = {} - end +AddEventHandler("bpt_importjob:hasEnteredMarker", function(zone) + if zone == "VehicleSpawner" then + CurrentAction = "vehicle_spawner" + CurrentActionMsg = _U("spawner_prompt") + CurrentActionData = {} + elseif zone == "VehicleDeleter" then + local playerPed = PlayerPedId() + local vehicle = GetVehiclePedIsIn(playerPed, false) + + if IsPedInAnyVehicle(playerPed, false) and GetPedInVehicleSeat(vehicle, -1) == playerPed then + CurrentAction = "delete_vehicle" + CurrentActionMsg = _U("store_veh") + CurrentActionData = { + vehicle = vehicle, + } + end + elseif zone == "ImportActions" then + CurrentAction = "import_actions_menu" + CurrentActionMsg = _U("press_to_open") + CurrentActionData = {} + elseif zone == "Cloakroom" then + CurrentAction = "cloakroom" + CurrentActionMsg = _U("cloakroom_prompt") + CurrentActionData = {} + end end) -AddEventHandler('bpt_importjob:hasExitedMarker', function() - ESX.CloseContext() - CurrentAction = nil +AddEventHandler("bpt_importjob:hasExitedMarker", function() + ESX.CloseContext() + CurrentAction = nil end) -- Create Blips CreateThread(function() - local blip = AddBlipForCoord(Config.Zones.ImportActions.Pos.x, Config.Zones.ImportActions.Pos.y, - Config.Zones.ImportActions.Pos.z) - - SetBlipSprite(blip, 478) - SetBlipDisplay(blip, 4) - SetBlipScale(blip, 1.0) - SetBlipColour(blip, 21) - SetBlipAsShortRange(blip, true) - - BeginTextCommandSetBlipName('STRING') - AddTextComponentSubstringPlayerName(_U('blip_import')) - EndTextCommandSetBlipName(blip) + local blip = AddBlipForCoord( + Config.Zones.ImportActions.Pos.x, + Config.Zones.ImportActions.Pos.y, + Config.Zones.ImportActions.Pos.z + ) + + SetBlipSprite(blip, 478) + SetBlipDisplay(blip, 4) + SetBlipScale(blip, 1.0) + SetBlipColour(blip, 21) + SetBlipAsShortRange(blip, true) + + BeginTextCommandSetBlipName("STRING") + AddTextComponentSubstringPlayerName(_U("blip_import")) + EndTextCommandSetBlipName(blip) end) -- Enter / Exit marker events, and draw markers CreateThread(function() - while true do - local sleep = 1500 - if ESX.PlayerData.job and ESX.PlayerData.job.name == 'import' then - - local coords = GetEntityCoords(PlayerPedId()) - local isInMarker, currentZone = false + while true do + local sleep = 1500 + if ESX.PlayerData.job and ESX.PlayerData.job.name == "import" then + local coords = GetEntityCoords(PlayerPedId()) + local isInMarker, currentZone = false local inVeh = IsPedInAnyVehicle(PlayerPedId()) - for k, v in pairs(Config.Zones) do - local zonePos = vector3(v.Pos.x, v.Pos.y, v.Pos.z) - local distance = #(coords - zonePos) + for k, v in pairs(Config.Zones) do + local zonePos = vector3(v.Pos.x, v.Pos.y, v.Pos.z) + local distance = #(coords - zonePos) - if v.Type ~= -1 and distance < Config.DrawDistance then - sleep = 0 + if v.Type ~= -1 and distance < Config.DrawDistance then + sleep = 0 if k == "VehicleDeleter" then if inVeh then - DrawMarker(v.Type, v.Pos.x, v.Pos.y, v.Pos.z, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, v.Size.x, v.Size.y, - v.Size.z, v.Color.r, v.Color.g, v.Color.b, 100, false, false, 2, v.Rotate, nil, nil, false) + DrawMarker( + v.Type, + v.Pos.x, + v.Pos.y, + v.Pos.z, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + v.Size.x, + v.Size.y, + v.Size.z, + v.Color.r, + v.Color.g, + v.Color.b, + 100, + false, + false, + 2, + v.Rotate, + nil, + nil, + false + ) end else - DrawMarker(v.Type, v.Pos.x, v.Pos.y, v.Pos.z, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, v.Size.x, v.Size.y, - v.Size.z, v.Color.r, v.Color.g, v.Color.b, 100, false, false, 2, v.Rotate, nil, nil, false) + DrawMarker( + v.Type, + v.Pos.x, + v.Pos.y, + v.Pos.z, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + v.Size.x, + v.Size.y, + v.Size.z, + v.Color.r, + v.Color.g, + v.Color.b, + 100, + false, + false, + 2, + v.Rotate, + nil, + nil, + false + ) end + end + + if distance < v.Size.x then + isInMarker, currentZone = true, k + end + end - end - - if distance < v.Size.x then - isInMarker, currentZone = true, k - end - end - - if (isInMarker and not HasAlreadyEnteredMarker) or (isInMarker and LastZone ~= currentZone) then - HasAlreadyEnteredMarker, LastZone = true, currentZone - TriggerEvent('bpt_importjob:hasEnteredMarker', currentZone) - end - - if not isInMarker and HasAlreadyEnteredMarker then - HasAlreadyEnteredMarker = false - TriggerEvent('bpt_importjob:hasExitedMarker', LastZone) - end - end - Wait(sleep) - end + if (isInMarker and not HasAlreadyEnteredMarker) or (isInMarker and LastZone ~= currentZone) then + HasAlreadyEnteredMarker, LastZone = true, currentZone + TriggerEvent("bpt_importjob:hasEnteredMarker", currentZone) + end + + if not isInMarker and HasAlreadyEnteredMarker then + HasAlreadyEnteredMarker = false + TriggerEvent("bpt_importjob:hasExitedMarker", LastZone) + end + end + Wait(sleep) + end end) -- Key Controls CreateThread(function() - while true do - local sleep = 1500 - if CurrentAction and not ESX.PlayerData.dead then - sleep = 0 - ESX.ShowHelpNotification(CurrentActionMsg) - - if IsControlJustReleased(0, 38) and ESX.PlayerData.job and ESX.PlayerData.job.name == 'import' then - if CurrentAction == 'import_actions_menu' then - OpenImportActionsMenu() - elseif CurrentAction == 'cloakroom' then - OpenCloakroom() - elseif CurrentAction == 'vehicle_spawner' then - OpenVehicleSpawnerMenu() - elseif CurrentAction == 'delete_vehicle' then - DeleteJobVehicle() - end - - CurrentAction = nil - end - end - Wait(sleep) - end + while true do + local sleep = 1500 + if CurrentAction and not ESX.PlayerData.dead then + sleep = 0 + ESX.ShowHelpNotification(CurrentActionMsg) + + if IsControlJustReleased(0, 38) and ESX.PlayerData.job and ESX.PlayerData.job.name == "import" then + if CurrentAction == "import_actions_menu" then + OpenImportActionsMenu() + elseif CurrentAction == "cloakroom" then + OpenCloakroom() + elseif CurrentAction == "vehicle_spawner" then + OpenVehicleSpawnerMenu() + elseif CurrentAction == "delete_vehicle" then + DeleteJobVehicle() + end + + CurrentAction = nil + end + end + Wait(sleep) + end end) -RegisterCommand('importmenu', function() - if not ESX.PlayerData.dead and Config.EnablePlayerManagement and ESX.PlayerData.job and ESX.PlayerData.job.name == - 'import' then - OpenMobileImportActionsMenu() - end +RegisterCommand("importmenu", function() + if + not ESX.PlayerData.dead + and Config.EnablePlayerManagement + and ESX.PlayerData.job + and ESX.PlayerData.job.name == "import" + then + OpenMobileImportActionsMenu() + end end, false) -RegisterKeyMapping('importmenu', 'Open Import Menu', 'keyboard', 'f6') \ No newline at end of file +RegisterKeyMapping("importmenu", "Open Import Menu", "keyboard", "f6") diff --git a/server-data/resources/[bpt_addons]/bpt_importjob/config.lua b/server-data/resources/[bpt_addons]/bpt_importjob/config.lua index 533c3787d..79fc5889a 100644 --- a/server-data/resources/[bpt_addons]/bpt_importjob/config.lua +++ b/server-data/resources/[bpt_addons]/bpt_importjob/config.lua @@ -1,48 +1,53 @@ -Config = {} -Config.DrawDistance = 10.0 -- How close do you need to be for the markers to be drawn (in GTA units). -Config.EnablePlayerManagement = true -- Enable society managing. +Config = {} +Config.DrawDistance = 10.0 -- How close do you need to be for the markers to be drawn (in GTA units). +Config.EnablePlayerManagement = true -- Enable society managing. Config.EnableSocietyOwnedVehicles = false -Config.Locale = 'it' -Config.OxInventory = ESX.GetConfig().OxInventory +Config.Locale = "it" +Config.OxInventory = ESX.GetConfig().OxInventory Config.AuthorizedVehicles = { - {model = 'rumpo', label = 'Rumpo'} + { model = "rumpo", label = "Rumpo" }, } Config.Zones = { VehicleSpawner = { - Pos = {x = 1021.912109, y = -2372.043945, z = 30.526733}, - Size = {x = 0.6, y = 0.6, z = 0.6}, - Color = {r = 204, g = 204, b = 0}, - Type = 36, Rotate = true + Pos = { x = 1021.912109, y = -2372.043945, z = 30.526733 }, + Size = { x = 0.6, y = 0.6, z = 0.6 }, + Color = { r = 204, g = 204, b = 0 }, + Type = 36, + Rotate = true, }, VehicleSpawnPoint = { - Pos = {x = 1015.740662, y = -2366.624268, z = 30.493042}, - Size = {x = 1.5, y = 1.5, z = 1.0}, - Type = -1, Rotate = false, - Heading = 225.0 + Pos = { x = 1015.740662, y = -2366.624268, z = 30.493042 }, + Size = { x = 1.5, y = 1.5, z = 1.0 }, + Type = -1, + Rotate = false, + Heading = 225.0, }, VehicleDeleter = { - Pos = {x = 1015.740662, y = -2366.624268, z = 29.493042}, - Size = {x = 3.0, y = 3.0, z = 0.25}, - Color = {r = 255, g = 0, b = 0}, - Type = 1, Rotate = false + Pos = { x = 1015.740662, y = -2366.624268, z = 29.493042 }, + Size = { x = 3.0, y = 3.0, z = 0.25 }, + Color = { r = 255, g = 0, b = 0 }, + Type = 1, + Rotate = false, }, ImportActions = { - Pos = {x = 1006.799988, y = -2404.127441, z = 30.122314}, - Size = {x = 0.6, y = 0.6, z = 0.6}, - Color = {r = 204, g = 204, b = 0}, - Type = 20, Rotate = true + Pos = { x = 1006.799988, y = -2404.127441, z = 30.122314 }, + Size = { x = 0.6, y = 0.6, z = 0.6 }, + Color = { r = 204, g = 204, b = 0 }, + Type = 20, + Rotate = true, }, Cloakroom = { - Pos = {x = 1011.837341, y = -2390.004395, z = 30.122314}, - Size = {x = 0.6, y = 0.6, z = 0.6}, - Color = {r = 204, g = 204, b = 0}, - Type = 21, Rotate = true - } + Pos = { x = 1011.837341, y = -2390.004395, z = 30.122314 }, + Size = { x = 0.6, y = 0.6, z = 0.6 }, + Color = { r = 204, g = 204, b = 0 }, + Type = 21, + Rotate = true, + }, } diff --git a/server-data/resources/[bpt_addons]/bpt_importjob/fxmanifest.lua b/server-data/resources/[bpt_addons]/bpt_importjob/fxmanifest.lua index 709c92078..3461c91ed 100644 --- a/server-data/resources/[bpt_addons]/bpt_importjob/fxmanifest.lua +++ b/server-data/resources/[bpt_addons]/bpt_importjob/fxmanifest.lua @@ -1,25 +1,25 @@ -fx_version 'adamant' +fx_version("adamant") -game 'gta5' +game("gta5") -description 'bpt_importjob' -lua54 'yes' -version '1.0.0' +description("bpt_importjob") +lua54("yes") +version("1.0.1") -shared_script '@es_extended/imports.lua' +shared_script("@es_extended/imports.lua") -client_scripts { - '@es_extended/locale.lua', - 'locales/*.lua', - 'config.lua', - 'client/main.lua' -} +client_scripts({ + "@es_extended/locale.lua", + "locales/*.lua", + "config.lua", + "client/main.lua", +}) -server_scripts { - '@es_extended/locale.lua', - 'locales/*.lua', - 'config.lua', - 'server/main.lua' -} +server_scripts({ + "@es_extended/locale.lua", + "locales/*.lua", + "config.lua", + "server/main.lua", +}) -dependency 'es_extended' +dependency("es_extended") diff --git a/server-data/resources/[bpt_addons]/bpt_importjob/locales/en.lua b/server-data/resources/[bpt_addons]/bpt_importjob/locales/en.lua index 597efcfd7..b3b386c12 100644 --- a/server-data/resources/[bpt_addons]/bpt_importjob/locales/en.lua +++ b/server-data/resources/[bpt_addons]/bpt_importjob/locales/en.lua @@ -1,34 +1,34 @@ -Locales['en'] = { - -- cloakroom - ['cloakroom_menu'] = 'cloakroom', - ['cloakroom_prompt'] = 'press [E] to access the cloakroom.', - ['wear_citizen'] = 'civilian clothing', - ['wear_work'] = 'work clothes', - -- Inventory - ['deposit_stock'] = 'Deposit stock', - ['take_stock'] = 'Take stock', - ['have_deposited'] = 'Have deposited', - ['quantity_invalid'] = 'Quantity invelid', - -- garage - ['spawner_prompt'] = 'press [E] to access the garage.', - ["vehicle_spawned"] = "vehicle spawned successfully!", - ['store_veh'] = 'press [E] to deposit the vehicle', - ['spawn_veh'] = 'spawn vehicle', - ['spawnpoint_blocked'] = 'vehicle blocks the spawnpoint!', - ['only_import'] = 'you can only deposit company vehicles.', - ['empty_garage'] = 'no vehicles in the garage!', - ['taking_service'] = 'Take service: Gunsmith', - ['full_service'] = 'complete service: ', - ['amount_invalid'] = 'invalid amount', - ['press_to_open'] = 'press [E] to access the menu', - ['billing'] = 'billing', - ['billing_sent'] = 'the invoice has been posted!', - ['invoice_amount'] = 'invoice amount', - ['no_players_near'] = 'no players nearby', - ['boss_actions'] = 'Boss actions', - ['blip_import'] = 'Import/Export.', - ['import'] = 'Import', - -- billing - ['bill_amount'] = "Amount to bill..", - ['confirm'] = "Confirm" -} \ No newline at end of file +Locales["en"] = { + -- cloakroom + ["cloakroom_menu"] = "cloakroom", + ["cloakroom_prompt"] = "press [E] to access the cloakroom.", + ["wear_citizen"] = "civilian clothing", + ["wear_work"] = "work clothes", + -- Inventory + ["deposit_stock"] = "Deposit stock", + ["take_stock"] = "Take stock", + ["have_deposited"] = "Have deposited", + ["quantity_invalid"] = "Quantity invelid", + -- garage + ["spawner_prompt"] = "press [E] to access the garage.", + ["vehicle_spawned"] = "vehicle spawned successfully!", + ["store_veh"] = "press [E] to deposit the vehicle", + ["spawn_veh"] = "spawn vehicle", + ["spawnpoint_blocked"] = "vehicle blocks the spawnpoint!", + ["only_import"] = "you can only deposit company vehicles.", + ["empty_garage"] = "no vehicles in the garage!", + ["taking_service"] = "Take service: Gunsmith", + ["full_service"] = "complete service: ", + ["amount_invalid"] = "invalid amount", + ["press_to_open"] = "press [E] to access the menu", + ["billing"] = "billing", + ["billing_sent"] = "the invoice has been posted!", + ["invoice_amount"] = "invoice amount", + ["no_players_near"] = "no players nearby", + ["boss_actions"] = "Boss actions", + ["blip_import"] = "Import/Export.", + ["import"] = "Import", + -- billing + ["bill_amount"] = "Amount to bill..", + ["confirm"] = "Confirm", +} diff --git a/server-data/resources/[bpt_addons]/bpt_importjob/locales/it.lua b/server-data/resources/[bpt_addons]/bpt_importjob/locales/it.lua index 9e49b509f..06883aefb 100644 --- a/server-data/resources/[bpt_addons]/bpt_importjob/locales/it.lua +++ b/server-data/resources/[bpt_addons]/bpt_importjob/locales/it.lua @@ -1,33 +1,33 @@ -Locales['it'] = { - -- cloakroom - ['cloakroom_menu'] = 'guardaroba', - ['cloakroom_prompt'] = 'premi [E] per accedere al guardaroba.', - ['wear_citizen'] = 'abiti civili', - ['wear_work'] = 'abiti da lavoro', - -- Inventory - ['deposit_stock'] = 'Depositare', - ['take_stock'] = 'Prendi', - ['have_deposited'] = 'Hai depositato', - ['quantity_invalid'] = 'Quantità non valida', - -- garage - ['spawner_prompt'] = 'premi [E] per accedere al Garage.', - ["vehicle_spawned"] = "Veicolo ritirato con successo!", - ['store_veh'] = 'premi [E] per depositare il veicolo', - ['spawn_veh'] = 'spawn veicolo', - ['spawnpoint_blocked'] = 'lo spawnpoint è bloccato !', - ['only_import'] = 'puoi solo memorizzare import.', - ['taking_service'] = 'prendi servizio: import', - ['full_service'] = 'servizio completo: ', - ['amount_invalid'] = 'importo non valido', - ['press_to_open'] = 'premi [E] per accedere al menu', - ['billing'] = 'fattura', - ['billing_sent'] = 'la fattura è stata registrata!', - ['invoice_amount'] = 'importo della fattura', - ['no_players_near'] = 'nessun giocatore nelle vicinanze', - ['boss_actions'] = 'Azioni del boss', - ['blip_import'] = 'Import/Export', - ['import'] = 'import', - -- billing - ['bill_amount'] = "importo della fattura", - ['confirm'] = "Conferma" +Locales["it"] = { + -- cloakroom + ["cloakroom_menu"] = "guardaroba", + ["cloakroom_prompt"] = "premi [E] per accedere al guardaroba.", + ["wear_citizen"] = "abiti civili", + ["wear_work"] = "abiti da lavoro", + -- Inventory + ["deposit_stock"] = "Depositare", + ["take_stock"] = "Prendi", + ["have_deposited"] = "Hai depositato", + ["quantity_invalid"] = "Quantità non valida", + -- garage + ["spawner_prompt"] = "premi [E] per accedere al Garage.", + ["vehicle_spawned"] = "Veicolo ritirato con successo!", + ["store_veh"] = "premi [E] per depositare il veicolo", + ["spawn_veh"] = "spawn veicolo", + ["spawnpoint_blocked"] = "lo spawnpoint è bloccato !", + ["only_import"] = "puoi solo memorizzare import.", + ["taking_service"] = "prendi servizio: import", + ["full_service"] = "servizio completo: ", + ["amount_invalid"] = "importo non valido", + ["press_to_open"] = "premi [E] per accedere al menu", + ["billing"] = "fattura", + ["billing_sent"] = "la fattura è stata registrata!", + ["invoice_amount"] = "importo della fattura", + ["no_players_near"] = "nessun giocatore nelle vicinanze", + ["boss_actions"] = "Azioni del boss", + ["blip_import"] = "Import/Export", + ["import"] = "import", + -- billing + ["bill_amount"] = "importo della fattura", + ["confirm"] = "Conferma", } diff --git a/server-data/resources/[bpt_addons]/bpt_importjob/localization/bpt_importjob.sql b/server-data/resources/[bpt_addons]/bpt_importjob/localization/bpt_importjob.sql new file mode 100644 index 000000000..06bcd8f0b --- /dev/null +++ b/server-data/resources/[bpt_addons]/bpt_importjob/localization/bpt_importjob.sql @@ -0,0 +1,23 @@ +INSERT INTO `addon_account` (name, label, shared) VALUES + ('society_import', 'Import', 1) +; + +INSERT INTO `datastore` (name, label, shared) VALUES + ('society_import', 'Import', 1) +; + +INSERT INTO `addon_inventory` (name, label, shared) VALUES + ('society_import', 'Import', 1) +; + +INSERT INTO `jobs` (name, label) VALUES + ('import', 'Import') +; + +INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES + ('import',0,'ontrial','in prova',12,'{"hair_2":0,"hair_color_2":0,"torso_1":32,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":31,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":0,"age_2":0,"glasses_2":0,"ears_2":0,"arms":27,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('import',1,'employee','dipendente',24,'{"hair_2":0,"hair_color_2":0,"torso_1":32,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":31,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":0,"age_2":0,"glasses_2":0,"ears_2":0,"arms":27,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('import',2,'driver','autista',36,'{"hair_2":0,"hair_color_2":0,"torso_1":26,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":57,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":4,"age_2":0,"glasses_2":0,"ears_2":0,"arms":11,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":0,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('import',3,'responsible','responsabile',48,'{"hair_2":0,"hair_color_2":0,"torso_1":26,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":57,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":4,"age_2":0,"glasses_2":0,"ears_2":0,"arms":11,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":0,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('import',4,'boss','Direttore',0,'{"hair_2":0,"hair_color_2":0,"torso_1":29,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":31,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":4,"age_2":0,"glasses_2":0,"ears_2":0,"arms":1,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":0,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":4,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}') +; diff --git a/server-data/resources/[bpt_addons]/bpt_importjob/server/main.lua b/server-data/resources/[bpt_addons]/bpt_importjob/server/main.lua index 5a08b5856..2251a4e9b 100644 --- a/server-data/resources/[bpt_addons]/bpt_importjob/server/main.lua +++ b/server-data/resources/[bpt_addons]/bpt_importjob/server/main.lua @@ -1,80 +1,84 @@ -TriggerEvent('esx_society:registerSociety', 'import', 'Import', 'society_import', 'society_import', 'society_import', { - type = 'public' +TriggerEvent("esx_society:registerSociety", "import", "Import", "society_import", "society_import", "society_import", { + type = "public", }) if Config.MaxInService ~= -1 then - TriggerEvent('esx_service:activateService', 'import', Config.MaxInService) + TriggerEvent("esx_service:activateService", "import", Config.MaxInService) end -ESX.RegisterServerCallback("bpt_importjob:SpawnVehicle", function(source, cb, model , props) - local xPlayer = ESX.GetPlayerFromId(source) +ESX.RegisterServerCallback("bpt_importjob:SpawnVehicle", function(source, cb, model, props) + local xPlayer = ESX.GetPlayerFromId(source) - if xPlayer.job.name ~= "import" then - print(('[^3WARNING^7] Player ^5%s^7 attempted to Exploit Vehicle Spawing!!'):format(source)) - return - end - local SpawnPoint = vector3(Config.Zones.VehicleSpawnPoint.Pos.x, Config.Zones.VehicleSpawnPoint.Pos.y, Config.Zones.VehicleSpawnPoint.Pos.z) - ESX.OneSync.SpawnVehicle(joaat(model), SpawnPoint, Config.Zones.VehicleSpawnPoint.Heading, props, function() - local vehicle = NetworkGetEntityFromNetworkId() - while GetVehicleNumberPlateText(vehicle) ~= props.plate do - Wait(0) - end - TaskWarpPedIntoVehicle(GetPlayerPed(source), vehicle, -1) - end) - cb() + if xPlayer.job.name ~= "import" then + print(("[^3WARNING^7] Player ^5%s^7 attempted to Exploit Vehicle Spawing!!"):format(source)) + return + end + local SpawnPoint = vector3( + Config.Zones.VehicleSpawnPoint.Pos.x, + Config.Zones.VehicleSpawnPoint.Pos.y, + Config.Zones.VehicleSpawnPoint.Pos.z + ) + ESX.OneSync.SpawnVehicle(joaat(model), SpawnPoint, Config.Zones.VehicleSpawnPoint.Heading, props, function() + local vehicle = NetworkGetEntityFromNetworkId() + while GetVehicleNumberPlateText(vehicle) ~= props.plate do + Wait(0) + end + TaskWarpPedIntoVehicle(GetPlayerPed(source), vehicle, -1) + end) + cb() end) -RegisterNetEvent('bpt_importjob:getStockItem') -AddEventHandler('bpt_importjob:getStockItem', function(itemName, count) - local xPlayer = ESX.GetPlayerFromId(source) +RegisterNetEvent("bpt_importjob:getStockItem") +AddEventHandler("bpt_importjob:getStockItem", function(itemName, count) + local xPlayer = ESX.GetPlayerFromId(source) - if xPlayer.job.name == 'import' then - TriggerEvent('esx_addoninventory:getSharedInventory', 'society_import', function(inventory) - local item = inventory.getItem(itemName) + if xPlayer.job.name == "import" then + TriggerEvent("esx_addoninventory:getSharedInventory", "society_import", function(inventory) + local item = inventory.getItem(itemName) - -- is there enough in the society? - if count > 0 and item.count >= count then - -- can the player carry the said amount of x item? - if xPlayer.canCarryItem(itemName, count) then - inventory.removeItem(itemName, count) - xPlayer.addInventoryItem(itemName, count) - xPlayer.showNotification(_U('have_withdrawn', count, item.label)) - else - xPlayer.showNotification(_U('player_cannot_hold')) - end - else - xPlayer.showNotification(_U('quantity_invalid')) - end - end) - else - print(('[^3WARNING^7] Player ^5%s^7 attempted ^5bpt_importjob:getStockItem^7 (cheating)'):format(source)) - end + -- is there enough in the society? + if count > 0 and item.count >= count then + -- can the player carry the said amount of x item? + if xPlayer.canCarryItem(itemName, count) then + inventory.removeItem(itemName, count) + xPlayer.addInventoryItem(itemName, count) + xPlayer.showNotification(_U("have_withdrawn", count, item.label)) + else + xPlayer.showNotification(_U("player_cannot_hold")) + end + else + xPlayer.showNotification(_U("quantity_invalid")) + end + end) + else + print(("[^3WARNING^7] Player ^5%s^7 attempted ^5bpt_importjob:getStockItem^7 (cheating)"):format(source)) + end end) -ESX.RegisterServerCallback('bpt_importjob:getStockItems', function(_, cb) - TriggerEvent('esx_addoninventory:getSharedInventory', 'society_import', function(inventory) - cb(inventory.items) - end) +ESX.RegisterServerCallback("bpt_importjob:getStockItems", function(_, cb) + TriggerEvent("esx_addoninventory:getSharedInventory", "society_import", function(inventory) + cb(inventory.items) + end) end) -RegisterNetEvent('bpt_importjob:putStockItems') -AddEventHandler('bpt_importjob:putStockItems', function(itemName, count) - local xPlayer = ESX.GetPlayerFromId(source) +RegisterNetEvent("bpt_importjob:putStockItems") +AddEventHandler("bpt_importjob:putStockItems", function(itemName, count) + local xPlayer = ESX.GetPlayerFromId(source) local sourceItem = xPlayer.getInventoryItem(itemName) - if xPlayer.job.name == 'import' then - TriggerEvent('esx_addoninventory:getSharedInventory', 'society_import', function(inventory) - local item = inventory.getItem(itemName) + if xPlayer.job.name == "import" then + TriggerEvent("esx_addoninventory:getSharedInventory", "society_import", function(inventory) + local item = inventory.getItem(itemName) - if sourceItem.count >= count and count > 0 then - xPlayer.removeInventoryItem(itemName, count) - inventory.addItem(itemName, count) - xPlayer.showNotification(_U('have_deposited', count, item.label)) - else - xPlayer.showNotification(_U('quantity_invalid')) - end - end) - else - print(('[^3WARNING^7] Player ^5%s^7 attempted ^5bpt_importjob:putStockItems^7 (cheating)'):format(source)) - end -end) \ No newline at end of file + if sourceItem.count >= count and count > 0 then + xPlayer.removeInventoryItem(itemName, count) + inventory.addItem(itemName, count) + xPlayer.showNotification(_U("have_deposited", count, item.label)) + else + xPlayer.showNotification(_U("quantity_invalid")) + end + end) + else + print(("[^3WARNING^7] Player ^5%s^7 attempted ^5bpt_importjob:putStockItems^7 (cheating)"):format(source)) + end +end)