Unify cashregister and terminal commands

This makes `/cashregister` and `/terminal` the same, since they were already.

(I kept both as not to confuse people if one went missing)

`/terminal` originally was added to make use of the `bzzz_terminal` prop and anim, but now it works with both commands if enabled in the config
This commit is contained in:
Jim Shield
2025-05-19 15:04:28 +01:00
parent 9eb2e987d4
commit 6ab839e2a3
3 changed files with 21 additions and 14 deletions

View File

@@ -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)