6 Commits

Author SHA1 Message Date
Jim Shield
d252ce6a02 Version Bump
`3.0.02` - `3.0.03`
2025-05-21 11:00:23 +01:00
Jim Shield
4bc2aaa95f Re-add terminal item and info 2025-05-21 10:59:07 +01:00
Jim Shield
fdf92fde64 fix custom cash register function 2025-05-21 10:49:14 +01:00
Jim Shield
954b208016 add if statement to prop removal, just incase 2025-05-19 15:20:26 +01:00
Jim Shield
51265681c1 Update README.md 2025-05-19 15:16:53 +01:00
Jim Shield
6ab839e2a3 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
2025-05-19 15:04:28 +01:00
7 changed files with 47 additions and 21 deletions

View File

@@ -40,19 +40,24 @@ 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
If you enable Config.General.Usebzzz then the script will use `bzzz_terminal` to automatically create a prop and animation when using the commands:
- `/cashregister`
- `/terminal`
This is also available as an item users can use by adding this to your shared items
```lua
['terminal'] = {['name'] = 'terminal', ['label'] = 'Wireless Terminal', ['weight'] = 5000, ["type"] = "item", ["image"] = 'terminal.png', ['unique'] = true, ['useable'] = true, ["shouldClose"] = true, ["combinable"] = nil, ['description'] = ''},
terminal = { name = 'terminal', label = 'Wireless Terminal', weight = 5000, ["type"] = "item", ["image"] = 'terminal.png', unique = true, useable = true, ["shouldClose"] = true, ["combinable"] = nil, description = '' },
```
This payment terminal prop is available as a Free Package from https://bzzz.tebex.io/package/5551076
---
## Item installation
- To make use of the ticket reward system for workers you need to add the ticket item to your shared items lua
- Naviage to `[qb] > qb-core / shared / items.lua` and add this line
```lua
payticket = { name = "payticket", label = "Receipt", weight = 10, type = "item", image = "ticket.png", unique = false, useable = false, shouldClose = false, description = "Cash these in at the bank!" },
payticket = { name = "payticket", label = "Receipt", weight = 10, type = "item", image = "ticket.png", unique = false, useable = false, shouldClose = false, description = "Cash these in at the bank!" },
```
- Add the ticket image to your inventory script:

View File

@@ -7,7 +7,7 @@ function spawnCustomRegisters()
for i = 1, #v do
local job, gang = v[i].gang and nil or k, v[i].gang and k or nil
createBoxTarget({"CustomRegister: "..k..i, v[i].coords.xyz, 0.47, 0.34, { name="CustomRegister: "..k..i, heading = v[i].coords[4], debugPoly=debugMode, minZ=v[i].coords.z-0.1, maxZ=v[i].coords.z+0.4}}, {
{ onSelect = function() TriggerEvent(getScript()..":client:Charge", { job = job, gang = gang, img = ""}) end, icon = "fas fa-credit-card", label = locale("target", "charge"), }
{ action = function() TriggerEvent(getScript()..":client:Charge", { job = job, gang = gang, img = ""}) end, icon = "fas fa-credit-card", label = locale("target", "charge"), }
}, 2.0)
if v[i].prop then makeProp({prop = "prop_till_03", coords = v[i].coords}, 1, false) end
end
@@ -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,10 @@ 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
if Config.General.Usebzzz then
destroyProp(prop)
stopAnim('cellphone@', 'cellphone_text_read_base')
end
end)
RegisterNetEvent(getScript()..":client:PayPopup", function(amount, biller, billtype, img, billerjob, gang, outside)

View File

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

View File

@@ -1,6 +1,6 @@
name "Jim-Payments"
author "Jimathy"
version "3.0.02"
version "3.0.03"
description "Payment Script"
fx_version "cerulean"
game "gta5"
@@ -12,7 +12,7 @@ shared_scripts {
'locales/*.lua',
'config.lua',
--Jim Bridge - https://github.com/jimathy/jim-bridge
--Jim Bridge - https://github.com/jimathy/jim_bridge
'@jim_bridge/starter.lua',
'shared/*.lua',

BIN
images/terminal.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@@ -10,12 +10,20 @@ 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)
for _, v in pairs({"cashregister", "terminal"}) do
registerCommand(v, {
locale("command", "cash_reg"), {}, false,
function(source)
TriggerClientEvent(getScript()..":client:Charge", source, {}, true)
end
})
end
if Items["terminal"] then
createUseableItem("terminal", function(source, item)
TriggerClientEvent(getScript()..":client:Charge", source, {}, true)
end
})
end)
end
createCallback(getScript()..":MakePlayerList", function(source)
local onlineList = {}
@@ -29,12 +37,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)

View File

@@ -1 +1,7 @@
3.0.02
3.0.03
- Adjust commands to unify /cashregister and /terminal
- If "Usebzzz = true" both commands will trigger the emote
- Updated readme to explain this
https://github.com/jimathy/jim-payments