mirror of
https://github.com/jimathy/jim-payments.git
synced 2026-08-17 06:16:02 +01:00
Compare commits
6 Commits
c6ef0897fc
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d05d8626c4 | ||
|
|
35c95f500d | ||
|
|
0da4cfb191 | ||
|
|
f723d6f444 | ||
|
|
26cf5f4cc9 | ||
|
|
f90161b82d |
@@ -3,23 +3,22 @@ local Till = {}
|
||||
|
||||
function spawnCustomRegisters()
|
||||
Wait(1000)
|
||||
for k, v in pairs(Config.CustomCashRegisters) do
|
||||
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}}, {
|
||||
{
|
||||
action = function()
|
||||
TriggerEvent(getScript()..":client:Charge", { job = job, gang = gang, img = ""})
|
||||
end,
|
||||
for k, v in pairs(Config.CustomCashRegisters) do
|
||||
for i = 1, #v do
|
||||
local job, gang = v[i].gang and nil or k, v[i].gang and k or nil
|
||||
local img = v.img or v[i].img
|
||||
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}}, {
|
||||
{
|
||||
action = function() TriggerEvent(getScript()..":client:Charge", {job = job, gang = gang, img = img}) end,
|
||||
icon = "fas fa-credit-card",
|
||||
label = locale("target", "charge"),
|
||||
label = locale("target","charge"),
|
||||
job = job,
|
||||
gang = gang
|
||||
}
|
||||
}, 2.0)
|
||||
if v[i].prop then makeProp({prop = "prop_till_03", coords = v[i].coords + vec4(0,0,1.0, 0.0)}, 1, false) end
|
||||
end
|
||||
end
|
||||
}, 2.0)
|
||||
if v[i].prop then makeProp({prop = "prop_till_03", coords = v[i].coords+vec4(0,0,1.0, 0.0)}, 1, false) end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
onPlayerLoaded(function() spawnCustomRegisters() end, true)
|
||||
@@ -311,4 +310,6 @@ RegisterNetEvent(getScript()..":client:PayPopup", function(amount, biller, billt
|
||||
})
|
||||
end,
|
||||
})
|
||||
end)
|
||||
|
||||
end)
|
||||
|
||||
|
||||
38
config.lua
38
config.lua
@@ -12,13 +12,13 @@ Config = {
|
||||
Notify = "gta", -- "qb", "ox", "gta", "esx"
|
||||
ProgressBar = "gta", -- "qb", "ox", "gta", "esx"
|
||||
|
||||
|
||||
|
||||
DontUseTarget = false, -- uses drawtext targets instead of alt targets
|
||||
},
|
||||
|
||||
Crafting = {
|
||||
craftCam = true,
|
||||
MultiCraft = true,
|
||||
MultiCraftAmounts = { [1], [5], [10] },
|
||||
showItemBox = true,
|
||||
},
|
||||
|
||||
@@ -84,6 +84,7 @@ Config = {
|
||||
|
||||
CustomCashRegisters = {
|
||||
-- ["jobname"] = { -- Player job role restriction
|
||||
-- img = "https://i.ibb.co/HfVy87fW/image.png", -- url to image file
|
||||
-- { coords = vector4(0, 0, 0, 0), }, -- vector4 to place the till and the way it faces
|
||||
-- { coords = vector4(0, 0, 0, 0), prop = true, }, -- "prop = true" spawns a prop at the coords
|
||||
-- },
|
||||
@@ -158,12 +159,35 @@ Config = {
|
||||
|
||||
PlayerGang, PlayerJob, onDuty = {}, {}, nil
|
||||
|
||||
-- Test function for locales
|
||||
-- Function for locales
|
||||
-- Don't touch unless you know what you're doing
|
||||
-- This needs to be here because it loads before everything else
|
||||
function locale(section, string)
|
||||
if not Config.Lan or Config.Lan == "" then return print("Error, no langauge set") end
|
||||
if not Config.Lan or Config.Lan == "" then
|
||||
print("^1Error^7: ^3Config^7.^3Lan ^1not set^7, ^2falling back to Config.Lan = 'en'")
|
||||
Config = Config or {}
|
||||
Config.Lan = "en"
|
||||
end
|
||||
|
||||
local localTable = Loc[Config.Lan]
|
||||
if not localTable then return "Locale Table Not Found" end
|
||||
if not localTable[section] then return "["..section.."] Invalid" end
|
||||
if not localTable[section][string] then return "["..string.."] Invalid" end
|
||||
-- If Loc[..] doesn't exist, warn user
|
||||
if not localTable then
|
||||
print("Locale Table '"..Config.Lan.."' Not Found")
|
||||
return "Locale Table '"..Config.Lan.."' Not Found"
|
||||
end
|
||||
|
||||
-- If Loc[..].section doesn't exist, warn user
|
||||
if not localTable[section] then
|
||||
print("^1Error^7: Locale Section: ['"..section.."'] Invalid")
|
||||
return "Locale Section: ['"..section.."'] Invalid"
|
||||
end
|
||||
|
||||
-- If Loc[..].section.string doesn't exist, warn user
|
||||
if not localTable[section][string] then
|
||||
print("^1Error^7: Locale String: ['"..section.."']['"..string.."'] Invalid")
|
||||
return "Locale String: ['"..string.."'] Invalid"
|
||||
end
|
||||
|
||||
-- If no issues, return the string
|
||||
return localTable[section][string]
|
||||
end
|
||||
Reference in New Issue
Block a user