From 16515eceea56b22d2147c55b2a469efc014d5a00 Mon Sep 17 00:00:00 2001 From: Stitch Date: Wed, 8 Nov 2023 13:23:06 -0800 Subject: [PATCH] add support for bzzs terminal and disabling the command in config --- README.md | 9 +++++++++ client/client.lua | 7 +++++++ config.lua | 8 +++----- fxmanifest.lua | 2 +- server/server.lua | 19 ++++++++++++++++++- 5 files changed, 38 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 839adf9..b03aa05 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,15 @@ ensure [vehicles] ensure [jim] ``` +--- +## BZZ Terminal Instructions +Free Package https://bzzz.tebex.io/package/5551076 + +Stream the prop and add the emote that is provided to rpemotes or dpemotes +```lua + ['terminal'] = {['name'] = 'terminal', ['label'] = 'Wireless Terminal', ['weight'] = 5000, ["type"] = "item", ["image"] = 'terminal.png', ['unique'] = true, ['useable'] = true, ["shouldClose"] = true, ["combinable"] = nil, ['description'] = ''}, +``` + --- ## Item installation - To make use of the ticket reward system for workers you need to add the ticket item to your shared items lua diff --git a/client/client.lua b/client/client.lua index a8b94c4..e10a08a 100644 --- a/client/client.lua +++ b/client/client.lua @@ -95,6 +95,9 @@ RegisterNetEvent('jim-payments:client:Charge', function(data, outside) if not dialog.citizen or not dialog.price then return end TriggerServerEvent('jim-payments:server:Charge', dialog.citizen, dialog.price, dialog.billtype, data.img, outside, gang) end + if config.Usebzzz then + ExecuteCommand("e c") + end end) RegisterNetEvent('jim-payments:client:PolCharge', function() @@ -186,3 +189,7 @@ AddEventHandler('onResourceStop', function(r) if r ~= GetCurrentResourceName() t for i = 1, #Till do DeleteEntity(Till[i]) end unloadModel(GetEntityModel(BankPed)) DeletePed(BankPed) end) + +RegisterNetEvent('terminal', function() + TriggerEvent('animations:client:EmoteCommandStart', {'terminal'}) +end) \ No newline at end of file diff --git a/config.lua b/config.lua index 2e7004d..f69963f 100644 --- a/config.lua +++ b/config.lua @@ -38,6 +38,9 @@ Config = { `U_F_M_CasinoShop_01`, }, + usebzzz = false, -- enable if you're using the prop from bzzz + Enablecommand = true, -- Enables the cashregister command + PhoneBank = false, -- Set this to false to use the popup payment system FOR CARD/BANK PAYMENTS instead of using phone invoices -- This doesn't affect Cash payments as they by default use confirmation now -- This is helpful for phones that don't support invoices well @@ -82,11 +85,6 @@ Config = { CustomCashRegisters = { }, - ------------------------------ - -- Custom Job Cash Register -- - ------------------------------ - Bzzprop = false -- Set to true if you want to use the FREE bzzz terminal prop https://bzzz.tebex.io/package/5551076 - Disableregistercommand = false -- Set to true to disable the command -- The /polcharge command requires specific jobs to be set -- No tickets for these, it's just commission (0.25 = 25%) diff --git a/fxmanifest.lua b/fxmanifest.lua index 4a8c7c9..d3eb49e 100644 --- a/fxmanifest.lua +++ b/fxmanifest.lua @@ -1,6 +1,6 @@ name "Jim-Payments" author "Jimathy" -version "v2.8.5" +version "v2.8.6" description "Payment Script By Jimathy" fx_version "cerulean" game "gta5" diff --git a/server/server.lua b/server/server.lua index ff4e562..e9c3079 100644 --- a/server/server.lua +++ b/server/server.lua @@ -13,7 +13,13 @@ AddEventHandler('onResourceStart', function(resource) if GetCurrentResourceName( end end) -QBCore.Commands.Add("cashregister", Loc[Config.Lan].command["cash_reg"], {}, false, function(source) TriggerClientEvent("jim-payments:client:Charge", source, {}, true) end) + +CreateThread(function() + if Config.Enablecommand then + QBCore.Commands.Add("cashregister", Loc[Config.Lan].command["cash_reg"], {}, false, function(source) TriggerClientEvent("jim-payments:client:Charge", source, {}, true) end) + end +end) + QBCore.Commands.Add("polcharge", Loc[Config.Lan].command["charge"], {}, false, function(source) TriggerClientEvent("jim-payments:client:PolCharge", source) end) RegisterServerEvent('jim-payments:Tickets:Give', function(data, biller, gang) @@ -247,3 +253,14 @@ QBCore.Functions.CreateCallback('jim-payments:MakePlayerList', function(source, end cb(onlineList) end) + + +CreateThread(function() + if Config.Usebzzz then + QBCore.Functions.CreateUseableItem('terminal', function(source, item) + local src = source + TriggerClientEvent('terminal', src) + TriggerClientEvent("jim-payments:client:Charge", source, {}, true) + end) + end +end) \ No newline at end of file