diff --git a/client/charge.lua b/client/charge.lua index 2b82b95..68690bc 100644 --- a/client/charge.lua +++ b/client/charge.lua @@ -16,8 +16,8 @@ end onPlayerLoaded(function() spawnCustomRegisters() end, true) -local billPrev = "cash" RegisterNetEvent(getScript()..":client:Charge", function(data, outside) + local billPrev = "cash" --if not outside and not onDuty and data.gang == nil then triggerNotify(nil, locale("error", "not_onduty") return end local newinputs = {} -- Begin qb-input creation here. local nearbyList = {} @@ -42,6 +42,7 @@ RegisterNetEvent(getScript()..":client:Charge", function(data, outside) end end end + --If list is empty(no one nearby) show error and stop if not nearbyList[1] then triggerNotify(nil, locale("error" ,"no_one"), "error") @@ -67,6 +68,14 @@ RegisterNetEvent(getScript()..":client:Charge", function(data, outside) } end + local prop = nil + if Config.General.Usebzzz then + local Ped = PlayerPedId() + prop = makeProp({ prop = 'bzzz_prop_payment_terminal', coords = vec4(0,0,0,0)}, false, true) + AttachEntityToEntity(prop, Ped, GetPedBoneIndex(Ped, 57005), 0.17, 0.04, 0.01, 340.0, 200.0, 50.0, true, true, false, false, 1, true) + playAnim('cellphone@', 'cellphone_text_read_base', -1, 49) + end + --Grab Player Job name or Gang Name if needed local getInfo = getPlayer() --Check if image was given when opening the regsiter @@ -99,6 +108,8 @@ RegisterNetEvent(getScript()..":client:Charge", function(data, outside) billPrev = dialog.billtype TriggerServerEvent(getScript()..":server:Charge", dialog.citizen, dialog.price, dialog.billtype, data.img, outside, gang) end + destroyProp(prop) + stopAnim('cellphone@', 'cellphone_text_read_base') end) RegisterNetEvent(getScript()..":client:PayPopup", function(amount, biller, billtype, img, billerjob, gang, outside) diff --git a/config.lua b/config.lua index 5432a18..aebec7b 100644 --- a/config.lua +++ b/config.lua @@ -28,7 +28,7 @@ Config = { List = true, -- "true" to use nearby player list feature in the cash registers, "false" for manual id entry PaymentRadius = 15, -- This is how far the playerlist will check for nearby players (based on the person charging) - Usebzzz = false, -- enable if you're using the prop from bzzz + Usebzzz = true, -- enable if you're using the prop from bzzz Enablecommand = true, -- Enables the /cashregister command diff --git a/server/chargerserver.lua b/server/chargerserver.lua index 2344b6f..0a5dade 100644 --- a/server/chargerserver.lua +++ b/server/chargerserver.lua @@ -10,12 +10,14 @@ onResourceStart(function() debugPrint("^1Error^7: ^2Unable to find ^7'^3payticket^7' ^2item it in the Shared^7") end - registerCommand("cashregister", { - locale("command", "cash_reg"), {}, false, - function(source) - TriggerClientEvent(getScript()..":client:Charge", source, {}, true) - end - }) + for _, v in pairs({"cashregister", "terminal"}) do + registerCommand(v, { + locale("command", "cash_reg"), {}, false, + function(source) + TriggerClientEvent(getScript()..":client:Charge", source, {}, true) + end + }) + end createCallback(getScript()..":MakePlayerList", function(source) local onlineList = {} @@ -29,12 +31,6 @@ onResourceStart(function() return onlineList end) - - if Config.General.Usebzzz then - createUseableItem('terminal', function(source, item) - TriggerClientEvent(getScript()..":client:Charge", source, {}, true) - end) - end end, true) RegisterServerEvent(getScript()..":server:Charge", function(citizen, price, billtype, img, outside, gang)