mirror of
https://github.com/jimathy/jim-payments.git
synced 2026-08-17 06:16:02 +01:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ee11d79fa6 | ||
|
|
784d13914f | ||
|
|
10f14f846e | ||
|
|
1ca2e45a37 | ||
|
|
2e3fef8846 | ||
|
|
1b69b44f5c |
@@ -24,22 +24,29 @@ if Config.Banks.enable then
|
|||||||
jobroles[k] = 0
|
jobroles[k] = 0
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
createCircleTarget(
|
local options = {
|
||||||
{ name, vec3(v[i].x, v[i].y, v[i].z+0.2), 2.0, { name = name, debugPoly = debugMode, useZ = true, }, }, {
|
{ action = function()
|
||||||
{ action = function()
|
|
||||||
if Config.General.Peds and isStarted("jim-talktonpc") then
|
if Config.General.Peds and isStarted("jim-talktonpc") then
|
||||||
exports["jim-talktonpc"]:createCam(Peds[name], true, "generic", true)
|
exports["jim-talktonpc"]:createCam(Peds[name], true, "generic", true)
|
||||||
end
|
end
|
||||||
TriggerEvent(getScript()..":Client:Bank", { ped = Config.General.Peds and Peds[name] })
|
TriggerEvent(getScript()..":Client:Bank", { ped = Config.General.Peds and Peds[name] })
|
||||||
end,
|
end,
|
||||||
icon = "fas fa-piggy-bank", label = locale("target", "bank") },
|
icon = "fas fa-piggy-bank", label = locale("target", "bank")
|
||||||
|
},
|
||||||
|
}
|
||||||
|
if Config.Receipts.CashInAnywhere then
|
||||||
|
options[#options+1] =
|
||||||
{ action = function() TriggerEvent(getScript()..":Tickets:Menu", { gang = false }) end,
|
{ action = function() TriggerEvent(getScript()..":Tickets:Menu", { gang = false }) end,
|
||||||
icon = "fas fa-receipt", label = locale("target", "cashin_boss"), job = jobroles,
|
icon = "fas fa-receipt", label = locale("target", "cashin_boss"), job = jobroles,
|
||||||
},
|
}
|
||||||
|
options[#options+1] =
|
||||||
{ action = function() TriggerEvent(getScript()..":Tickets:Menu", { gang = true }) end,
|
{ action = function() TriggerEvent(getScript()..":Tickets:Menu", { gang = true }) end,
|
||||||
icon = "fas fa-receipt", label = locale("target", "cashin_gang"), gang = gangroles,
|
icon = "fas fa-receipt", label = locale("target", "cashin_gang"), gang = gangroles,
|
||||||
},
|
}
|
||||||
}, 2.5)
|
end
|
||||||
|
jsonPrint(options)
|
||||||
|
createCircleTarget(
|
||||||
|
{ name, vec3(v[i].x, v[i].y, v[i].z+0.2), 2.0, { name = name, debugPoly = debugMode, useZ = true, }, }, options, 2.5)
|
||||||
if Config.Banks.showBlips then
|
if Config.Banks.showBlips then
|
||||||
makeBlip({coords = v[i], sprite = 814, col = 2, scale = 0.7, disp = 6, name = locale("blip", "blip_bank") })
|
makeBlip({coords = v[i], sprite = 814, col = 2, scale = 0.7, disp = 6, name = locale("blip", "blip_bank") })
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -7,9 +7,17 @@ function spawnCustomRegisters()
|
|||||||
for i = 1, #v do
|
for i = 1, #v do
|
||||||
local job, gang = v[i].gang and nil or k, v[i].gang and k or nil
|
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}}, {
|
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, 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"),
|
||||||
|
job = job,
|
||||||
|
gang = gang
|
||||||
|
}
|
||||||
}, 2.0)
|
}, 2.0)
|
||||||
if v[i].prop then makeProp({prop = "prop_till_03", coords = v[i].coords}, 1, false) end
|
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
|
end
|
||||||
end
|
end
|
||||||
@@ -25,8 +33,13 @@ RegisterNetEvent(getScript()..":client:Charge", function(data, outside)
|
|||||||
--Retrieve a list of nearby players from server
|
--Retrieve a list of nearby players from server
|
||||||
local onlineList = triggerCallback(getScript()..":MakePlayerList")
|
local onlineList = triggerCallback(getScript()..":MakePlayerList")
|
||||||
--Convert list of players nearby into one qb-input understands + add distance info
|
--Convert list of players nearby into one qb-input understands + add distance info
|
||||||
|
|
||||||
local playerCoords = GetEntityCoords(PlayerPedId())
|
local playerCoords = GetEntityCoords(PlayerPedId())
|
||||||
|
|
||||||
|
if onlineList == nil or #onlineList == 0 then
|
||||||
|
goto failed
|
||||||
|
end
|
||||||
|
|
||||||
for _, v in ipairs(GetPlayersFromCoords(playerCoords, Config.General.PaymentRadius)) do
|
for _, v in ipairs(GetPlayersFromCoords(playerCoords, Config.General.PaymentRadius)) do
|
||||||
local ped = GetPlayerPed(v)
|
local ped = GetPlayerPed(v)
|
||||||
local dist = #(GetEntityCoords(ped) - playerCoords)
|
local dist = #(GetEntityCoords(ped) - playerCoords)
|
||||||
@@ -42,6 +55,7 @@ RegisterNetEvent(getScript()..":client:Charge", function(data, outside)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
::failed::
|
||||||
|
|
||||||
--If list is empty(no one nearby) show error and stop
|
--If list is empty(no one nearby) show error and stop
|
||||||
if not nearbyList[1] then
|
if not nearbyList[1] then
|
||||||
|
|||||||
@@ -1,3 +1,46 @@
|
|||||||
|
if not Config.Banks.enable or not Config.Receipts.CashInAnywhere then
|
||||||
|
onPlayerLoaded(function()
|
||||||
|
local locations = BankLocations
|
||||||
|
if not Config.Receipts.CashInAnywhere then
|
||||||
|
locations = {
|
||||||
|
["receipts"] = Config.Receipts.CashInLocations
|
||||||
|
}
|
||||||
|
end
|
||||||
|
for k, v in pairs(locations) do
|
||||||
|
for i = 1, #v do
|
||||||
|
local name = getScript()..":BankLocation:"..k..i
|
||||||
|
if Config.General.Peds then
|
||||||
|
if not Config.Gabz then CreateModelHide(v[i].xyz, 1.0, `v_corp_bk_chair3`, true) end
|
||||||
|
if not Peds[name] then
|
||||||
|
Peds[name] = makePed(Config.General.PedPool[math.random(1, #Config.General.PedPool)], v[i], false, false)
|
||||||
|
if isStarted("jim-talktonpc") then
|
||||||
|
exports["jim-talktonpc"]:createDistanceMessage("hi", Peds[name], 3.0, false)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local jobroles = {}
|
||||||
|
local gangroles = {}
|
||||||
|
for k, v in pairs(Config.Receipts.Jobs) do
|
||||||
|
if v.gang then
|
||||||
|
gangroles[k] = 0
|
||||||
|
else
|
||||||
|
jobroles[k] = 0
|
||||||
|
end
|
||||||
|
end
|
||||||
|
createCircleTarget(
|
||||||
|
{ name, vec3(v[i].x, v[i].y, v[i].z+0.2), 2.0, { name = name, debugPoly = debugMode, useZ = true, }, }, {
|
||||||
|
{ action = function() TriggerEvent(getScript()..":Tickets:Menu", { gang = false }) end,
|
||||||
|
icon = "fas fa-receipt", label = locale("target", "cashin_boss"), job = jobroles,
|
||||||
|
},
|
||||||
|
{ action = function() TriggerEvent(getScript()..":Tickets:Menu", { gang = true }) end,
|
||||||
|
icon = "fas fa-receipt", label = locale("target", "cashin_gang"), gang = gangroles,
|
||||||
|
},
|
||||||
|
}, 2.5)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end, true)
|
||||||
|
end
|
||||||
|
|
||||||
RegisterNetEvent(getScript()..":Tickets:Menu", function(data)
|
RegisterNetEvent(getScript()..":Tickets:Menu", function(data)
|
||||||
local PlayerInfo = getPlayer()
|
local PlayerInfo = getPlayer()
|
||||||
local hasItem, hasTable = hasItem("payticket", 1)
|
local hasItem, hasTable = hasItem("payticket", 1)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
name "Jim-Payments"
|
name "Jim-Payments"
|
||||||
author "Jimathy"
|
author "Jimathy"
|
||||||
version "3.0.03"
|
version "3.0.04"
|
||||||
description "Payment Script"
|
description "Payment Script"
|
||||||
fx_version "cerulean"
|
fx_version "cerulean"
|
||||||
game "gta5"
|
game "gta5"
|
||||||
|
|||||||
@@ -27,7 +27,9 @@ BankLocations = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if Config.General.Gabz then
|
if Config.General.Gabz then
|
||||||
Config.Receipts.CashInLocation = vec4(269.28, 217.24, 106.28, 69.0)
|
Config.Receipts.CashInLocations = {
|
||||||
|
vec4(269.28, 217.24, 106.28, 69.0)
|
||||||
|
}
|
||||||
BankLocations = {
|
BankLocations = {
|
||||||
["legion"] = {
|
["legion"] = {
|
||||||
vec4(149.5, -1042.08, 29.37, 342.74), -- Legion Fleeca
|
vec4(149.5, -1042.08, 29.37, 342.74), -- Legion Fleeca
|
||||||
|
|||||||
10
version.txt
10
version.txt
@@ -1,7 +1,9 @@
|
|||||||
3.0.03
|
3.0.04
|
||||||
|
|
||||||
- Adjust commands to unify /cashregister and /terminal
|
- Fix custom cash register spawn offset locations
|
||||||
- If "Usebzzz = true" both commands will trigger the emote
|
- Fix job/gang lock on custom registers
|
||||||
- Updated readme to explain this
|
- Add workaround for if `onlineList` is `nil`
|
||||||
|
- Fix type for Gabz default ticket cash in location
|
||||||
|
- Separate and fix ped creation for banks and tickets
|
||||||
|
|
||||||
https://github.com/jimathy/jim-payments
|
https://github.com/jimathy/jim-payments
|
||||||
Reference in New Issue
Block a user