Add files via upload

This commit is contained in:
Jim Shield
2025-02-22 13:23:43 +00:00
committed by GitHub
parent 2ebfeff554
commit ef6b664890
14 changed files with 1093 additions and 1020 deletions

414
README.md
View File

@@ -1,208 +1,208 @@
# jim-payments # jim-payments
- QBCore based payment system - QBCore based payment system
- Enchanced QB-Input payment system from my other scripts now free on its own - Enchanced QB-Input payment system from my other scripts now free on its own
### If you need support I have a discord server available, it helps me keep track of issues and give better support. ### If you need support I have a discord server available, it helps me keep track of issues and give better support.
## https://discord.gg/xKgQZ6wZvS ## https://discord.gg/xKgQZ6wZvS
### We also have Documentation over on Gitbook, feel free to check it out ### We also have Documentation over on Gitbook, feel free to check it out
## https://jixelpatterns.gitbook.io/jixelpatterns-script-guide/overview/who-we-are ## https://jixelpatterns.gitbook.io/jixelpatterns-script-guide/overview/who-we-are
### If you think I did a good job here, consider donating as it keeps by lights on and my cat fat/floofy: ### If you think I did a good job here, consider donating as it keeps by lights on and my cat fat/floofy:
## https://ko-fi.com/jixelpatterns ## https://ko-fi.com/jixelpatterns
--- ---
- If you use a different phone/invoice system let me know and I will add support for it as best I can! - If you use a different phone/invoice system let me know and I will add support for it as best I can!
- Currently supported are: - Currently supported are:
- qb-phone - qb-phone
- gks-phone - gks-phone
- qs-smartphone - Leave the setting as "qb" - qs-smartphone - Leave the setting as "qb"
--- ---
# Installation # Installation
--- ---
- I always recommend starting my scripts AFTER `[qb]` not inside it as it can mess with any dependancies on server load - I always recommend starting my scripts AFTER `[qb]` not inside it as it can mess with any dependancies on server load
- I have a separate folder called `[jim]` (that is also in the resources folder) that starts WAY after everything else. - I have a separate folder called `[jim]` (that is also in the resources folder) that starts WAY after everything else.
- This ensure's it has everything it requires before trying to load - This ensure's it has everything it requires before trying to load
- Example of my load order: - Example of my load order:
```CSS ```CSS
# QBCore & Extra stuff # QBCore & Extra stuff
ensure qb-core ensure qb-core
ensure [qb] ensure [qb]
ensure [standalone] ensure [standalone]
ensure [voice] ensure [voice]
ensure [defaultmaps] ensure [defaultmaps]
ensure [vehicles] ensure [vehicles]
#Extra Jim Stuff #Extra Jim Stuff
ensure [jim] ensure [jim]
``` ```
--- ---
## BZZ Terminal Instructions ## BZZ Terminal Instructions
Free Package https://bzzz.tebex.io/package/5551076 Free Package https://bzzz.tebex.io/package/5551076
Stream the prop and add the emote that is provided to rpemotes or dpemotes Stream the prop and add the emote that is provided to rpemotes or dpemotes
```lua ```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'] = ''},
``` ```
--- ---
## Item installation ## Item installation
- To make use of the ticket reward system for workers you need to add the ticket item to your shared items lua - 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 - Naviage to `[qb] > qb-core / shared / items.lua` and add this line
```lua ```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: - Add the ticket image to your inventory script:
- Naviage to `[qb] > qb-inventory > html > images` and add this line - Naviage to `[qb] > qb-inventory > html > images` and add this line
![](https://github.com/jimathy/jim-payments/blob/main/images/ticket.png?raw=true) ![](https://github.com/jimathy/jim-payments/blob/main/images/ticket.png?raw=true)
--- ---
## Phone Setup ## Phone Setup
- There are two modes in the script, one that uses the phone for invoices/bank charges - There are two modes in the script, one that uses the phone for invoices/bank charges
- The script supports many features like pay tickets, commission payments etc. - The script supports many features like pay tickets, commission payments etc.
- If you want to use phone systems for these then you need to add the event for when a payment is accepted: - If you want to use phone systems for these then you need to add the event for when a payment is accepted:
- REMINDER: IF using phone invoices, the money being added to the society accounts is handled `BY THE PHONE`, not by my script. If money isn't going to the account its the phone system or bossmenu script. - REMINDER: IF using phone invoices, the money being added to the society accounts is handled `BY THE PHONE`, not by my script. If money isn't going to the account its the phone system or bossmenu script.
#### QB-Phone: #### QB-Phone:
- Go to `[qb] > qb-phone > client > main.lua` - Go to `[qb] > qb-phone > client > main.lua`
- Search for the event `RegisterNUICallback('PayInvoice', function(data, cb)` and look for the line: - Search for the event `RegisterNUICallback('PayInvoice', function(data, cb)` and look for the line:
```lua ```lua
TriggerServerEvent('qb-phone:server:BillingEmail', data, true) TriggerServerEvent('qb-phone:server:BillingEmail', data, true)
``` ```
- Directly *above* this line add: - Directly *above* this line add:
```lua ```lua
TriggerServerEvent('jim-payments:Tickets:Give', data) TriggerServerEvent('jim-payments:Tickets:Give', data)
``` ```
- The phone should now be integrated with jim-payments - The phone should now be integrated with jim-payments
#### GKS-Phone: #### GKS-Phone:
- Go to `gks-phone > server > serverapi.lua` - Go to `gks-phone > server > serverapi.lua`
- Search for the event: `gksphone:faturapayBill` and search for this line: - Search for the event: `gksphone:faturapayBill` and search for this line:
```lua ```lua
Ply.Functions.RemoveMoney('bank', data[1].amount, "paid-invoice") Ply.Functions.RemoveMoney('bank', data[1].amount, "paid-invoice")
``` ```
- Directly under this line add this event: - Directly under this line add this event:
```lua ```lua
TriggerEvent('jim-payments:Tickets:Give', { sender = Ply.PlayerData.charinfo.firstname, senderCitizenId = data[1].sendercitizenid, society = data[1].society, amount = data[1].amount }) TriggerEvent('jim-payments:Tickets:Give', { sender = Ply.PlayerData.charinfo.firstname, senderCitizenId = data[1].sendercitizenid, society = data[1].society, amount = data[1].amount })
``` ```
- The phone should now be integrated with jim-payments - The phone should now be integrated with jim-payments
#### Renewed QB-Phone: #### Renewed QB-Phone:
- Go to `qb-phone > server > invoices.lua` - Go to `qb-phone > server > invoices.lua`
- Search for the event: `qb-phone:server:PayMyInvoice` and search for this line: - Search for the event: `qb-phone:server:PayMyInvoice` and search for this line:
```lua ```lua
TriggerEvent("qb-phone:server:InvoiceHandler", true, amount, src, resource) TriggerEvent("qb-phone:server:InvoiceHandler", true, amount, src, resource)
``` ```
- Directly under this line add this event: - Directly under this line add this event:
```lua ```lua
TriggerEvent('jim-payments:Tickets:Give', { amount = amount, senderCitizenId = sendercitizenid, sender = SenderPly.PlayerData.charinfo.firstname, society = society }, SenderPly) TriggerEvent('jim-payments:Tickets:Give', { amount = amount, senderCitizenId = sendercitizenid, sender = SenderPly.PlayerData.charinfo.firstname, society = society }, SenderPly)
``` ```
- When invoices are paid, they should now be integrated with jim-payments - When invoices are paid, they should now be integrated with jim-payments
# Setup/Config # Setup/Config
## Custom Locations ## Custom Locations
- You can make of this payment system for a job script that wasn't created by me - You can make of this payment system for a job script that wasn't created by me
- All you need to do is add the job, grab a `vector4` (vector3 + heading) and set if you need a to spawn prop or not - All you need to do is add the job, grab a `vector4` (vector3 + heading) and set if you need a to spawn prop or not
- For example: - For example:
```lua ```lua
CustomCashRegisters = { -- Located in the config.lua CustomCashRegisters = { -- Located in the config.lua
["burgershot"] = { -- Player job role restriction ["burgershot"] = { -- Player job role restriction
{ coords = vector4(-1185.5, -878.54, 13.91, 305.53), prop = true, }, -- vector4 to place the till and the way it faces { coords = vector4(-1185.5, -878.54, 13.91, 305.53), prop = true, }, -- vector4 to place the till and the way it faces
{ coords = vector4(-1184.34, -880.51, 13.93, 302.04), prop = true, }, -- "prop = true" spawns a prop at the coords { coords = vector4(-1184.34, -880.51, 13.93, 302.04), prop = true, }, -- "prop = true" spawns a prop at the coords
}, },
}, },
``` ```
### This does not need to be done for MY job scripts, they already have built in support ### This does not need to be done for MY job scripts, they already have built in support
--- ---
## PayTickets ## PayTickets
![](https://i.imgur.com/ICbQyeQ.jpeg) ![](https://i.imgur.com/ICbQyeQ.jpeg)
- This script has a built in ticket reward system - This script has a built in ticket reward system
- On successful sale, the employees will be handed a ticket if they are clocked in - On successful sale, the employees will be handed a ticket if they are clocked in
- This can then be handed in to the bank to receive payment - This can then be handed in to the bank to receive payment
- Works as a reward and incentive for turning up to do work - Works as a reward and incentive for turning up to do work
- The values are set per job in `Config.Jobs` - The values are set per job in `Config.Jobs`
- `TicketSystem` Enable this if you want to use the ticket system false - `TicketSystem` Enable this if you want to use the ticket system false
- `TicketSystemAll` Enable this to give tickets to all workers clocked in - `TicketSystemAll` Enable this to give tickets to all workers clocked in
--- ---
## Commission System ## Commission System
- Support for commission to be paid as a reward for each successful payment - Support for commission to be paid as a reward for each successful payment
- Very customisable with the config.lua - Very customisable with the config.lua
- `Commission` Choose wether people get commission from every sale - `Commission` Choose wether people get commission from every sale
- `CommissionAll` Choose if **EVERY** worker gets Commission that is on duty - `CommissionAll` Choose if **EVERY** worker gets Commission that is on duty
- `CommissionDouble` Choose if Commission is limited by `MinAmountForTicket` - `CommissionDouble` Choose if Commission is limited by `MinAmountForTicket`
- `CommissionLimit` Choose if the worker charging the customer gets double commission - `CommissionLimit` Choose if the worker charging the customer gets double commission
--- ---
## Multiple Job and Gang Role support ## Multiple Job and Gang Role support
- The script supports adding job roles to the config so they can get rewards for successful payments - The script supports adding job roles to the config so they can get rewards for successful payments
- This includes Gang roles for stores/bars owned by a gang allowing them to get ticket rewards and commission - This includes Gang roles for stores/bars owned by a gang allowing them to get ticket rewards and commission
- Examples of adding jobs / gangs to config.lua: - Examples of adding jobs / gangs to config.lua:
```lua ```lua
Jobs = { Jobs = {
['mechanic'] = { MinAmountforTicket = 1000, PayPerTicket = 500, Commission = 0.10, }, ['mechanic'] = { MinAmountforTicket = 1000, PayPerTicket = 500, Commission = 0.10, },
['lostmc'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, gang = true, }, ['lostmc'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, gang = true, },
}, },
``` ```
- `MinAmountforTicket` is the amount required in a charge before they can get a ticket - `MinAmountforTicket` is the amount required in a charge before they can get a ticket
- `PayPerTicket` is the amount paid per ticket at the bank for the job role - `PayPerTicket` is the amount paid per ticket at the bank for the job role
- I personally recommend this being lower than `MinAmountforTicket`, being too high makes it exploitable - I personally recommend this being lower than `MinAmountforTicket`, being too high makes it exploitable
- `Commission` is the amount of commission given to players on successful payments (0.10 = 10%) - `Commission` is the amount of commission given to players on successful payments (0.10 = 10%)
- `gang = true` add this if the added role is a gang role - `gang = true` add this if the added role is a gang role
--- ---
## /cashgive ## /cashgive
![](https://i.imgur.com/AIdXzxX.jpeg) ![](https://i.imgur.com/AIdXzxX.jpeg)
- Alternative to /givecash - Alternative to /givecash
- A simple command built in to send cash to a `nearby player` - A simple command built in to send cash to a `nearby player`
- Shows a list of names and id's of people nearby to select from rather - Shows a list of names and id's of people nearby to select from rather
- Better experience than trying to figure out their ID and entering it manually - Better experience than trying to figure out their ID and entering it manually
--- ---
## /cashregister ## /cashregister
![](https://i.imgur.com/37d2mE3.jpeg) ![](https://i.imgur.com/37d2mE3.jpeg)
- This command is mean't as a portable cash register alternative - This command is mean't as a portable cash register alternative
- For example: - For example:
- When a person is devliering food they can do `/cashregister` and the payment will still be sent to the society account - When a person is devliering food they can do `/cashregister` and the payment will still be sent to the society account
- Doesn't utilize the ticket reward system unfortunately - Doesn't utilize the ticket reward system unfortunately
--- ---
## /polcharge ## /polcharge
- This script supports a customisable "police billing" - This script supports a customisable "police billing"
- This is the ability for selected jobroles to charge a nearby player - This is the ability for selected jobroles to charge a nearby player
- Depending on how you've set it up, this can take money directly from the players bank to the job's society account - Depending on how you've set it up, this can take money directly from the players bank to the job's society account
- This is by default enabled for `police` and `ambulance` - This is by default enabled for `police` and `ambulance`
- This also supports giving the player a cut of the payment as `commission` - This also supports giving the player a cut of the payment as `commission`
- Default Config: - Default Config:
```lua ```lua
FineJobs = { FineJobs = {
['police'] = { Commission = 0.25, }, ['police'] = { Commission = 0.25, },
['ambulance'] = { Commission = 0.25, }, ['ambulance'] = { Commission = 0.25, },
}, },
FineJobConfirmation = false, -- "true" makes it so fines need confirmation, "false" skips this ands just removes the money FineJobConfirmation = false, -- "true" makes it so fines need confirmation, "false" skips this ands just removes the money
FineJobList = true, -- "true" to use nearby player list feature in the cash registers, "false" for manual id entry FineJobList = true, -- "true" to use nearby player list feature in the cash registers, "false" for manual id entry
``` ```
--- ---
## Banking ## Banking
![](https://i.imgur.com/RYADcI2.jpeg) ![](https://i.imgur.com/RYADcI2.jpeg)
- This script has simple banking systems built in - This script has simple banking systems built in
- Works as a basic replacement for qb-banking and qb-atms - Works as a basic replacement for qb-banking and qb-atms
- Adjust the options in config.lua: - Adjust the options in config.lua:
- `useATM` Choose wether to make atm's usable - `useATM` Choose wether to make atm's usable
- `useBanks` Choose wether to make bank desks/teller's usable - `useBanks` Choose wether to make bank desks/teller's usable
- `BankBlips` Enable this if you disabled qb-banking and need bank locations - `BankBlips` Enable this if you disabled qb-banking and need bank locations
- `ATMBlips` Enable this if you are a pyscho and need every ATM to be on the map too - `ATMBlips` Enable this if you are a pyscho and need every ATM to be on the map too
- `Gabz` Enable to change to Gabz Bank locations, this corrects the ATM/Bank Cashier + Ticket Cash in - `Gabz` Enable to change to Gabz Bank locations, this corrects the ATM/Bank Cashier + Ticket Cash in
--- ---
### Renewed's qb-phone ### Renewed's qb-phone
- Simply leave the Config.PhoneType as `"qb"` - Simply leave the Config.PhoneType as `"qb"`
### AP-Goverment ### AP-Goverment
- Support for AP-Goverment Tax on payments - Support for AP-Goverment Tax on payments
- Toggle `ApGov` in the config.lua to enable this - Toggle `ApGov` in the config.lua to enable this

View File

@@ -109,3 +109,62 @@ function atmWithdrawl(info)
end end
end end
RegisterNetEvent(getScript()..":client:ATM:give", function()
local newinputs = {} -- Begin qb-input creation here.
local nearbyList = {}
if Config.General.List then -- If nearby player list is wanted:
--Retrieve a list of nearby players from server
local onlineList = triggerCallback(getScript()..":MakePlayerList")
--Convert list of players nearby into one qb-input understands + add distance info
local playerCoords = GetEntityCoords(PlayerPedId())
for _, v in ipairs(GetPlayersFromCoords(playerCoords, Config.General.PaymentRadius)) do
local ped = GetPlayerPed(v)
local dist = #(GetEntityCoords(ped) - playerCoords)
for i = 1, #onlineList do
if onlineList[i].value == GetPlayerServerId(v) then
if v ~= PlayerId() or debugMode then
nearbyList[#nearbyList+1] = {
value = onlineList[i].value,
label = onlineList[i].text .. ' (' .. math.floor(dist+0.05) .. 'm)',
text = onlineList[i].text .. ' (' .. math.floor(dist+0.05) .. 'm)'
}
end
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") return end
else -- If Config.List is false, create input text box for ID's
newinputs[#newinputs+1] = { type = 'text', isRequired = true, required = true, name = 'citizen', label = locale("menu" ,"person_id"), text = locale("menu" ,"person_id") }
end
if Config.General.List then
newinputs[#newinputs+1] = { type = "select", text = locale("menu" ,"cus_id"), name = "citizen", label = locale("menu" ,"cus_id"), default = 1, options = nearbyList }
else
newinputs[#newinputs+1] = { type = 'text', isRequired = true, name = 'citizen', text = locale("menu" ,"cus_id") }
end
newinputs[#newinputs+1] = {
type = 'select',
name = 'billtype',
text = locale("menu" ,"type"),
default = billPrev,
options = {
{ value = "cash", text = locale("menu" ,"cash"), label = locale("menu" ,"cash") },
}
}
newinputs[#newinputs+1] = { type = 'number', isRequired = true, name = 'price', text = locale("menu" ,"amount_charge") }
local dialog = createInput(locale("menu", "give_cash"), newinputs)
if dialog then
if dialog[1] then
dialog.citizen = dialog[1]
dialog.billtype = dialog[2]
dialog.price = dialog[3]
end
billPrev = dialog.billtype
TriggerServerEvent('jim-payments:server:ATM:give', dialog.citizen, dialog.price)
end
end)

View File

@@ -103,7 +103,7 @@ RegisterNetEvent(getScript()..":Client:Bank", function(data) local setheader = n
bankTransaction(info, bankinfo) bankTransaction(info, bankinfo)
end, end,
} }
if isStarted(QBExport) then if isStarted(QBExport) then -- only supports qbcore account transfers
Menu[#Menu+1] = { Menu[#Menu+1] = {
header = locale("target", "soc_trans"), header = locale("target", "soc_trans"),
txt = Jobs[info.job].label or "Error", txt = Jobs[info.job].label or "Error",

View File

@@ -5,8 +5,8 @@ function spawnCustomRegisters()
for k, v in pairs(Config.CustomCashRegisters) do for k, v in pairs(Config.CustomCashRegisters) do
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=Config.Debug, 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}}, {
{ onSelect = function() TriggerEvent(getScript()..":client:Charge", { job = job, gang = gang, img = ""}) end, icon = "fas fa-credit-card", label = Loc[Config.Lan].target["charge"], } { onSelect = function() TriggerEvent(getScript()..":client:Charge", { job = job, gang = gang, img = ""}) end, icon = "fas fa-credit-card", label = locale("target", "charge"), }
}, 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}, 1, false) end
end end
@@ -17,50 +17,57 @@ onPlayerLoaded(function() spawnCustomRegisters() end, true)
local billPrev = "cash" local billPrev = "cash"
RegisterNetEvent(getScript()..":client:Charge", function(data, outside) RegisterNetEvent(getScript()..":client:Charge", function(data, outside)
--Check if player is using /cashregister command --if not outside and not onDuty and data.gang == nil then triggerNotify(nil, locale("error", "not_onduty") return end
local dialog
--if not outside and not onDuty and data.gang == nil then triggerNotify(nil, Loc[Config.Lan].error["not_onduty"], "error") return end
local newinputs = {} -- Begin qb-input creation here. local newinputs = {} -- Begin qb-input creation here.
local nearbyList = {} local nearbyList = {}
if Config.General.List then -- If nearby player list is wanted: if Config.General.List then -- If nearby player list is wanted:
--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
for _, v in pairs(Core.Functions.GetPlayersFromCoords(GetEntityCoords(PlayerPedId()), Config.General.PaymentRadius)) do local playerCoords = GetEntityCoords(PlayerPedId())
local dist = #(GetEntityCoords(GetPlayerPed(v)) - GetEntityCoords(PlayerPedId()))
for i = 1, #onlineList do for _, v in ipairs(GetPlayersFromCoords(playerCoords, Config.General.PaymentRadius)) do
if onlineList[i].value == GetPlayerServerId(v) then local ped = GetPlayerPed(v)
if v ~= PlayerId() or debugMode then local dist = #(GetEntityCoords(ped) - playerCoords)
nearbyList[#nearbyList+1] = { value = onlineList[i].value, label = onlineList[i].text..' ('..math.floor(dist+0.05)..'m)', text = onlineList[i].text..' ('..math.floor(dist+0.05)..'m)' } for i = 1, #onlineList do
end if onlineList[i].value == GetPlayerServerId(v) then
end if v ~= PlayerId() or debugMode then
end nearbyList[#nearbyList+1] = {
end value = onlineList[i].value,
label = onlineList[i].text .. ' (' .. math.floor(dist+0.05) .. 'm)',
text = onlineList[i].text .. ' (' .. math.floor(dist+0.05) .. 'm)'
}
end
end
end
end
--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 triggerNotify(nil, Loc[Config.Lan].error["no_one"], "error") return end if not nearbyList[1] then triggerNotify(nil, locale("error" ,"no_one"), "error") return end
else -- If Config.List is false, create input text box for ID's else -- If Config.List is false, create input text box for ID's
newinputs[#newinputs+1] = { type = 'text', isRequired = true, required = true, name = 'citizen', label = Loc[Config.Lan].menu["person_id"], text = Loc[Config.Lan].menu["person_id"] } newinputs[#newinputs+1] = { type = 'text', isRequired = true, required = true, name = 'citizen', label = locale("menu" ,"person_id"), text = locale("menu" ,"person_id") }
end end
--Check if image was given when opening the regsiter
local img = Config.System.Menu == "qb" and "<center><img src="..(data.img and data.img or "").." width=200px></center>" or ""
--Grab Player Job name or Gang Name if needed --Grab Player Job name or Gang Name if needed
local label = data.gang and PlayerGang.label or PlayerJob.label local getInfo = getPlayer()
--Check if image was given when opening the regsiter
local img = data.img ~= nil and (Config.System.Menu == "qb" and "<center><img src="..(data.img).." width=200px></center>") or Jobs[getInfo.job].label
if Config.General.List then if Config.General.List then
newinputs[#newinputs+1] = { type = "select", text = Loc[Config.Lan].menu["cus_id"], name = "citizen", label = Loc[Config.Lan].menu["cus_id"], default = 1, options = nearbyList } newinputs[#newinputs+1] = { type = "select", text = locale("menu" ,"cus_id"), name = "citizen", label = locale("menu" ,"cus_id"), default = 1, options = nearbyList }
else else
newinputs[#newinputs+1] = { type = 'text', isRequired = true, name = 'citizen', text = Loc[Config.Lan].menu["cus_id"] } newinputs[#newinputs+1] = { type = 'text', isRequired = true, name = 'citizen', text = locale("menu" ,"cus_id") }
end end
newinputs[#newinputs+1] = { newinputs[#newinputs+1] = {
type = 'select', type = 'select',
name = 'billtype', name = 'billtype',
text = Loc[Config.Lan].menu["type"], text = locale("menu" ,"type"),
default = billPrev, default = billPrev,
options = { options = {
{ value = "cash", text = Loc[Config.Lan].menu["cash"], label = Loc[Config.Lan].menu["cash"] }, { value = "cash", text = locale("menu" ,"cash"), label = locale("menu" ,"cash") },
{ value = "bank", text = Loc[Config.Lan].menu["card"], label = Loc[Config.Lan].menu["card"] } { value = "bank", text = locale("menu" ,"card"), label = locale("menu" ,"card") }
} }
} }
newinputs[#newinputs+1] = { type = 'number', isRequired = true, name = 'price', text = Loc[Config.Lan].menu["amount_charge"] } newinputs[#newinputs+1] = { type = 'number', isRequired = true, name = 'price', text = locale("menu" ,"amount_charge") }
local dialog = createInput(img, newinputs) local dialog = createInput(img, newinputs)
@@ -77,26 +84,31 @@ end)
RegisterNetEvent(getScript()..":client:PayPopup", function(amount, biller, billtype, img, billerjob, gang, outside) RegisterNetEvent(getScript()..":client:PayPopup", function(amount, biller, billtype, img, billerjob, gang, outside)
local setimage = "" local setimage = ""
if Config.System.Menu == "qb" then print(billerjob)
setimage = "<center><img src="..(img and img or "").." width=200px></center>" if not img then
elseif Config.System.Menu == "ox" then setimage = billerjob
setimage = '!['..''.. ']('..(img and img or "")..')' else
if Config.System.Menu == "qb" then
setimage = "<center><img src="..(img and img or "").." width=200px></center>"
elseif Config.System.Menu == "ox" then
setimage = '!['..''.. ']('..(img and img or "")..')'
end
end end
local Menu = {} local Menu = {}
Menu[#Menu+1] = { Menu[#Menu+1] = {
isMenuHeader = true, isMenuHeader = true,
header = "🧾 "..billerjob..Loc[Config.Lan].menu["payment"], header = "🧾 "..locale("menu" ,"payment"),
txt = Loc[Config.Lan].menu["accept_payment"] txt = locale("menu" ,"accept_payment")
} }
Menu[#Menu+1] = { Menu[#Menu+1] = {
isMenuHeader = true, isMenuHeader = true,
header = "", header = "",
txt = billtype:gsub("^%l", string.upper)..Loc[Config.Lan].menu["payment_amount"]..amount txt = billtype:gsub("^%l", string.upper)..locale("menu" ,"payment_amount")..amount
} }
Menu[#Menu+1] = { Menu[#Menu+1] = {
icon = "fas fa-circle-check", icon = "fas fa-circle-check",
header = Loc[Config.Lan].menu["yes"], header = locale("menu" ,"yes"),
txt = "", txt = "",
onSelect = function() onSelect = function()
TriggerServerEvent(getScript()..":server:PayPopup", { TriggerServerEvent(getScript()..":server:PayPopup", {
@@ -110,7 +122,7 @@ RegisterNetEvent(getScript()..":client:PayPopup", function(amount, biller, billt
} }
Menu[#Menu+1] = { Menu[#Menu+1] = {
icon = "fas fa-circle-xmark", icon = "fas fa-circle-xmark",
header = Loc[Config.Lan].menu["no"], header = locale("menu" ,"no"),
onSelect = function() onSelect = function()
TriggerServerEvent(getScript()..":server:PayPopup", { TriggerServerEvent(getScript()..":server:PayPopup", {
accept = false, accept = false,
@@ -121,6 +133,7 @@ RegisterNetEvent(getScript()..":client:PayPopup", function(amount, biller, billt
}) })
end, end,
} }
debugPrint(setimage)
openMenu(Menu, { openMenu(Menu, {
header = setimage, header = setimage,
onExit = function() onExit = function()

View File

@@ -1,8 +1,9 @@
RegisterNetEvent(getScript()..":client:PolCharge", function() RegisterNetEvent(getScript()..":client:PolCharge", function()
local Playerinfo = getPlayer()
--Check if player is allowed to use /cashregister command --Check if player is allowed to use /cashregister command
local allowed = false local allowed = false
for k in pairs(Config.PolCharge.FineJobs) do if k == PlayerJob.name then allowed = true end end for k in pairs(Config.PolCharge.FineJobs) do if k == Playerinfo.job then allowed = true end end
if not allowed then triggerNotify(nil, Loc[Config.Lan].error["no_job"], "error") return end if not allowed then triggerNotify(nil, locale("error", "no_job"), "error") return end
local newinputs = {} -- Begin qb-input creation here. local newinputs = {} -- Begin qb-input creation here.
local nearbyList = {} local nearbyList = {}
@@ -21,17 +22,17 @@ RegisterNetEvent(getScript()..":client:PolCharge", function()
end end
end end
--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 triggerNotify(nil, Loc[Config.Lan].error["no_one"], "error") return end if not nearbyList[1] then triggerNotify(nil, locale("error" ,"no_one"), "error") return end
end end
if Config.PolCharge.FineJobList then if Config.PolCharge.FineJobList then
newinputs[#newinputs+1] = { type = "select", text = Loc[Config.Lan].menu["cus_id"], name = "citizen", label = Loc[Config.Lan].menu["cus_id"], default = 1, options = nearbyList } newinputs[#newinputs+1] = { type = "select", text = locale("menu" ,"cus_id"), name = "citizen", label = locale("menu" ,"cus_id"), default = 1, options = nearbyList }
else else
newinputs[#newinputs+1] = { type = 'text', isRequired = true, name = 'citizen', text = Loc[Config.Lan].menu["cus_id"] } newinputs[#newinputs+1] = { type = 'text', isRequired = true, name = 'citizen', text = locale("menu" ,"cus_id") }
end end
newinputs[#newinputs+1] = { type = 'number', isRequired = true, name = 'price', text = Loc[Config.Lan].menu["amount_charge"] } newinputs[#newinputs+1] = { type = 'number', isRequired = true, name = 'price', text = locale("menu" ,"amount_charge") }
local dialog = createInput(img, newinputs) local dialog = createInput(Jobs[Playerinfo.job].label, newinputs)
if dialog then if dialog then
if dialog[1] then if dialog[1] then
dialog.citizen = dialog[1] dialog.citizen = dialog[1]
@@ -43,10 +44,10 @@ end)
RegisterNetEvent(getScript()..":client:PolPopup", function(amount, biller, billerjob) RegisterNetEvent(getScript()..":client:PolPopup", function(amount, biller, billerjob)
local Menu = {} local Menu = {}
Menu[#Menu+1] = { isMenuHeader = true, header = "", txt = Loc[Config.Lan].menu["bank_charge"]..amount } Menu[#Menu+1] = { isMenuHeader = true, header = "", txt = locale("menu" ,"bank_charge")..amount }
Menu[#Menu+1] = { Menu[#Menu+1] = {
icon = "fas fa-circle-check", icon = "fas fa-circle-check",
header = Loc[Config.Lan].menu["yes"], header = locale("menu" ,"yes"),
txt = "", txt = "",
onSelect = function() onSelect = function()
TriggerServerEvent(getScript()..":server:PolPopup", { TriggerServerEvent(getScript()..":server:PolPopup", {
@@ -58,7 +59,7 @@ RegisterNetEvent(getScript()..":client:PolPopup", function(amount, biller, bille
} }
Menu[#Menu+1] = { Menu[#Menu+1] = {
icon = "fas fa-circle-xmark", icon = "fas fa-circle-xmark",
header = Loc[Config.Lan].menu["no"], header = locale("menu" ,"no"),
onSelect = function() onSelect = function()
TriggerServerEvent(getScript()..":server:PolPopup", { TriggerServerEvent(getScript()..":server:PolPopup", {
accept = false, accept = false,
@@ -68,8 +69,8 @@ RegisterNetEvent(getScript()..":client:PolPopup", function(amount, biller, bille
end, end,
} }
openMenu(Menu, { openMenu(Menu, {
header = "🧾 "..billerjob..Loc[Config.Lan].menu["payment"], header = "🧾 "..billerjob..locale("menu" ,"payment"),
headertxt = Loc[Config.Lan].menu["accept_payment"], headertxt = locale("menu" ,"accept_payment"),
onExit = function() onExit = function()
TriggerServerEvent(getScript()..":server:PolPopup", { TriggerServerEvent(getScript()..":server:PolPopup", {
accept = false, accept = false,

View File

@@ -1,23 +1,27 @@
RegisterNetEvent(getScript()..":Tickets:Menu", function(data) RegisterNetEvent(getScript()..":Tickets:Menu", function(data)
local PlayerInfo = getPlayer()
local hasItem, hasTable = hasItem("payticket", 1) local hasItem, hasTable = hasItem("payticket", 1)
if not hasItem then if not hasItem then
triggerNotify(nil, Loc[Config.Lan].error["no_ticket"], "error") triggerNotify(nil, locale("error" ,"no_ticket"), "error")
return return
end end
local amount, sellable, name, label = hasTable["payticket"].count, false, "", "" local amount, sellable, name, label = hasTable["payticket"].count, false, "", ""
for k, v in pairs(Config.Receipts.Jobs) do for k, v in pairs(Config.Receipts.Jobs) do
sellable = (data.gang and v.gang and k == PlayerGang.name) or (not data.gang and not v.gang and k == PlayerJob.name) sellable = (data.gang and v.gang and k == PlayerInfo.gang) or (not data.gang and not v.gang and k == PlayerInfo.job)
if sellable then name, label = k, (data.gang and PlayerGang.label) or (not data.gang and PlayerJob.label) break end if sellable then name, label = k, (data.gang and Gangs[PlayerInfo.gang].label) or (not data.gang and Jobs[PlayerInfo.job].label) break end
end end
if sellable then local Menu = {} if sellable then local Menu = {}
Menu[#Menu+1] = { Menu[#Menu+1] = {
isMenuHeader = true, isMenuHeader = true,
txt = Loc[Config.Lan].menu["ticket_amount"]..amount..Loc[Config.Lan].menu["total_pay"]..(Config.Receipts.Jobs[name].PayPerTicket * amount) txt = locale("menu" ,"ticket_amount")..amount..locale("menu" ,"total_pay")..(Config.Receipts.Jobs[name].PayPerTicket * amount)
} }
Menu[#Menu+1] = { Menu[#Menu+1] = {
icon = "fas fa-circle-check", header = Loc[Config.Lan].menu["yes"], icon = "fas fa-circle-check", header = locale("menu" ,"yes"),
onSelect = function() TriggerServerEvent(getScript()..":Tickets:Sell") end, onSelect = function()
TriggerServerEvent(getScript()..":Tickets:Sell")
playAnim("pickup_object", "putdown_low", 2000, 1)
end,
} }
openMenu(Menu, { header = "🧾 "..label..Loc[Config.Lan].menu["receipt"], headertxt = Loc[Config.Lan].menu["trade_confirm"], canClose = true, }) openMenu(Menu, { header = "🧾 "..label..locale("menu" ,"receipt"), headertxt = locale("menu" ,"trade_confirm"), canClose = true, })
end end
end) end)

View File

@@ -1,166 +1,164 @@
print("^2Jim^7-^2Payments ^7v^4"..GetResourceMetadata(GetCurrentResourceName(), 'version', nil):gsub("%.", "^7.^4").."^7 - ^2Payments Script by ^1Jimathy^7") -- If you need support I now have a discord available, it helps me keep track of issues and give better support.
-- If you need support I now have a discord available, it helps me keep track of issues and give better support. -- https://discord.gg/xKgQZ6wZvS
-- https://discord.gg/xKgQZ6wZvS Config = {
Lan = "en",
Config = { System = {
Lan = "en", Debug = false,
System = { EventDebug = false,
Debug = false,
EventDebug = false, Menu = "qb", -- "qb", "ox", "gta"
Notify = "qb", -- "qb", "ox", "gta", "esx"
Menu = "qb", -- "qb", "ox", "gta" ProgressBar = "qb", -- "qb", "ox", "gta", "esx"
Notify = "qb", -- "qb", "ox", "gta", "esx" },
ProgressBar = "qb", -- "qb", "ox", "gta", "esx"
}, Crafting = {
craftCam = true,
Crafting = { MultiCraft = true,
craftCam = true, MultiCraftAmounts = { [1], [5], [10] },
MultiCraft = true, showItemBox = true,
MultiCraftAmounts = { [1], [5], [10] }, },
showItemBox = true,
}, General = {
ApGov = false, -- Toggle support for AP-Goverment Tax
General = {
ApGov = false, -- Toggle support for AP-Goverment Tax 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)
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 = false, -- enable if you're using the prop from bzzz Enablecommand = true, -- Enables the /cashregister command
Enablecommand = true, -- Enables the /cashregister command PhoneBank = false, -- Set this to false to use the popup payment system FOR CARD/BANK PAYMENTS instead of using phone invoices
-- This doesn't affect Cash payments as they by default use a confirmation window
PhoneBank = false, -- Set this to false to use the popup payment system FOR CARD/BANK PAYMENTS instead of using phone invoices -- This is helpful for phones that don't support invoices well
-- This doesn't affect Cash payments as they by default use a confirmation window
-- This is helpful for phones that don't support invoices well Peds = true, -- "true" to enable peds spawning in banks
PedPool = { -- If Peds is true, use this pool of ped models to pick from
Peds = true, -- "true" to enable peds spawning in banks "IG_Bankman",
PedPool = { -- If Peds is true, use this pool of ped models to pick from "U_M_M_BankMan",
"IG_Bankman", "S_F_M_Shop_HIGH",
"U_M_M_BankMan", "S_M_M_HighSec_02",
"S_F_M_Shop_HIGH", "S_M_M_HighSec_03",
"S_M_M_HighSec_02", "S_M_M_HighSec_04",
"S_M_M_HighSec_03", "A_F_Y_Business_01",
"S_M_M_HighSec_04", "A_F_Y_Business_02",
"A_F_Y_Business_01", "A_F_Y_Business_03",
"A_F_Y_Business_02", "A_F_Y_Business_04",
"A_F_Y_Business_03", "A_M_M_Business_01",
"A_F_Y_Business_04", "A_M_Y_Business_02",
"A_M_M_Business_01", "A_M_Y_Business_03",
"A_M_Y_Business_02", "U_F_M_CasinoShop_01",
"A_M_Y_Business_03", },
"U_F_M_CasinoShop_01",
}, PhoneType = "qb", -- Change this setting to make invoices work with your phone script [still testing this currently]
-- "qb" for qb-phone
PhoneType = "qb", -- Change this setting to make invoices work with your phone script [still testing this currently] -- "gks" for GKSPhone
-- "qb" for qb-phone
-- "gks" for GKSPhone
Gabz = false, -- "true" to enable Gabz Bank locations
-- this corrects the ATM/Bank Cashier + Ticket Cash in locations
Gabz = false, -- "true" to enable Gabz Bank locations
-- this corrects the ATM/Bank Cashier + Ticket Cash in locations menuLogo = "https://static.wikia.nocookie.net/gtawiki/images/b/bd/Fleeca-GTAV-Logo.png",
menuLogo = "https://static.wikia.nocookie.net/gtawiki/images/b/bd/Fleeca-GTAV-Logo.png", },
}, ATMs = {
enable = true, -- Enable this if wanting to use jim-payments atm systems
ATMs = { showBlips = true,
enable = true, -- Enable this if wanting to use jim-payments atm systems
showBlips = true, ATMModels = { `prop_atm_01`, `prop_atm_02`, `prop_atm_03`, `prop_fleeca_atm`, `gabz_sm_pb_atmframe` },
ATMModels = { `prop_atm_01`, `prop_atm_02`, `prop_atm_03`, `prop_fleeca_atm`, `gabz_sm_pb_atmframe` }, },
}, Banks = {
enable = true, -- Enable this if wanting to use jim-payments banking systems
Banks = { showBlips = true,
enable = true, -- Enable this if wanting to use jim-payments banking systems
showBlips = true, },
}, CustomCashRegisters = {
-- ["jobname"] = { -- Player job role restriction
CustomCashRegisters = { -- { coords = vector4(0, 0, 0, 0), }, -- vector4 to place the till and the way it faces
-- ["jobname"] = { -- Player job role restriction -- { coords = vector4(0, 0, 0, 0), prop = true, }, -- "prop = true" spawns a prop at the coords
-- { 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 },
-- },
}, Receipts = {
TicketSystem = true, -- Enable this if you want to use the ticket system false
Receipts = { TicketSystemAll = true, -- Enable this to give tickets to all workers clocked in
TicketSystem = true, -- Enable this if you want to use the ticket system false
TicketSystemAll = true, -- Enable this to give tickets to all workers clocked in Commission = true, -- Set this to true to enable Commissions and give the person charging a percentage of the total
CommissionAll = false, -- Set this to true to give commission to workers clocked in
Commission = true, -- Set this to true to enable Commissions and give the person charging a percentage of the total CommissionDouble = false, -- Set this to true if you want the person charging to get double Commission
CommissionAll = false, -- Set this to true to give commission to workers clocked in CommissionLimit = false, -- If true, this limits the Commission to only be given if over the "MinAmountForTicket".
CommissionDouble = false, -- Set this to true if you want the person charging to get double Commission -- If false, Commission will be given for any amount
CommissionLimit = false, -- If true, this limits the Commission to only be given if over the "MinAmountForTicket".
-- If false, Commission will be given for any amount CashInLocations = {
vec4(252.23, 223.11, 106.29, 159.2), -- Default Third Window along in Pacific Bank
CashInLocations = { },
vec4(252.23, 223.11, 106.29, 159.2), -- Default Third Window along in Pacific Bank
}, CashInAnywhere = true, -- enable this to add cash ticket option to any banking location
CashInAnywhere = true, -- enable this to add cash ticket option to any banking location -- MinAmountforTicket should be your cheapest item
-- PayPerTicket should never be higher than MinAmountforTicket
-- MinAmountforTicket should be your cheapest item -- Commission is a percentage eg "0.10" becomes 10%
-- PayPerTicket should never be higher than MinAmountforTicket Jobs = {
-- Commission is a percentage eg "0.10" becomes 10% -- Jim Businesses | https://jimathy666.tebex.io/
Jobs = { ['bakery'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, },
-- Jim Businesses | https://jimathy666.tebex.io/ ['beanmachine'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, },
['bakery'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, }, ['burgershot'] = { MinAmountforTicket = 50, PayPerTicket = 50 , Commission = 0.10, },
['beanmachine'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, }, ['catcafe'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, },
['burgershot'] = { MinAmountforTicket = 50, PayPerTicket = 50 , Commission = 0.10, }, ['henhouse'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, },
['catcafe'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, }, ['pizzathis'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, },
['henhouse'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, }, ['popsdiner'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, },
['pizzathis'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, }, ['tequilala'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, },
['popsdiner'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, }, ['vanilla'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, },
['tequilala'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, }, ['upnatom'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, },
['vanilla'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, }, ['hornys'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, },
['upnatom'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, },
['hornys'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, }, -- JixelTay Businesses | https://jixeltay.tebex.io/
['cigarbar'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, },
-- JixelTay Businesses | https://jixeltay.tebex.io/ ['cluckinbell'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, },
['cigarbar'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, }, ['smokeshop'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, },
['cluckinbell'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, }, ['pearls'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, },
['smokeshop'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, }, ['kois'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, },
['pearls'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, }, ['whitewidow'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, },
['kois'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, }, ['bestbuds'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, },
['whitewidow'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, },
['bestbuds'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, }, -- Jim Mechanic | https://jimathy666.tebex.io/
['mechanic'] = { MinAmountforTicket = 1000, PayPerTicket = 500, Commission = 0.10, },
-- Jim Mechanic | https://jimathy666.tebex.io/ ['tuners'] = { MinAmountforTicket = 1000, PayPerTicket = 500, Commission = 0.10, },
['mechanic'] = { MinAmountforTicket = 1000, PayPerTicket = 500, Commission = 0.10, }, ['ottos'] = { MinAmountforTicket = 1000, PayPerTicket = 500, Commission = 0.10, },
['tuners'] = { MinAmountforTicket = 1000, PayPerTicket = 500, Commission = 0.10, }, ['lscustoms'] = { MinAmountforTicket = 1000, PayPerTicket = 500, Commission = 0.10, },
['ottos'] = { MinAmountforTicket = 1000, PayPerTicket = 500, Commission = 0.10, }, ['bennys'] = { MinAmountforTicket = 1000, PayPerTicket = 500, Commission = 0.10, },
['lscustoms'] = { MinAmountforTicket = 1000, PayPerTicket = 500, Commission = 0.10, },
['bennys'] = { MinAmountforTicket = 1000, PayPerTicket = 500, Commission = 0.10, }, -- Gangs | Example of a gang being supported
['lostmc'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, gang = true, },
-- Gangs | Example of a gang being supported },
['lostmc'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, gang = true, },
}, },
PolCharge = {
}, -- The /polcharge command requires specific jobs to be set
PolCharge = { -- No tickets for these, it's just commission (0.25 = 25%)
-- The /polcharge command requires specific jobs to be set FineJobs = {
-- No tickets for these, it's just commission (0.25 = 25%) ['police'] = { Commission = 0.25, },
FineJobs = { ['ambulance'] = { Commission = 0.25, },
['police'] = { Commission = 0.25, }, },
['ambulance'] = { Commission = 0.25, }, FineJobConfirmation = false, --"true" makes it so fines need confirmation, "false" skips this ands just removes the money
}, FineJobList = true, -- "true" to use nearby player list feature in the cash registers, "false" for manual id entry
FineJobConfirmation = false, --"true" makes it so fines need confirmation, "false" skips this ands just removes the money },
FineJobList = true, -- "true" to use nearby player list feature in the cash registers, "false" for manual id entry }
},
} PlayerGang, PlayerJob, onDuty = {}, {}, nil
PlayerGang, PlayerJob, onDuty = {}, {}, nil -- Test function for locales
function locale(section, string)
-- Test function for locales if not Config.Lan or Config.Lan == "" then return print("Error, no langauge set") end
function locale(section, string) local localTable = Loc[Config.Lan]
if not Config.Lan or Config.Lan == "" then return print("Error, no langauge set") end if not localTable then return "Locale Table Not Found" end
local localTable = Loc[Config.Lan] if not localTable[section] then return "["..section.."] Invalid" end
if not localTable then return "Locale Table Not Found" end if not localTable[section][string] then return "["..string.."] Invalid" end
if not localTable[section] then return "["..section.."] Invalid" end return localTable[section][string]
if not localTable[section][string] then return "["..string.."] Invalid" end
return localTable[section][string]
end end

View File

@@ -1,136 +1,136 @@
-- Provided by iplayer1337fivem on Github -- Provided by iplayer1337fivem on Github
Loc = Loc or {} Loc = Loc or {}
Loc["da"] = { Loc["da"] = {
error = { error = {
["cancel"] = "Afbestilt", ["cancel"] = "Afbestilt",
["no_one"] = "Ingen i nærheden at opkræve", ["no_one"] = "Ingen i nærheden at opkræve",
["not_onduty"] = "Ikke logget ind!", ["not_onduty"] = "Ikke logget ind!",
["no_job"] = "Du har ikke det påkrævede job", ["no_job"] = "Du har ikke det påkrævede job",
["no_ticket"] = "Du har ingen billetter at handle med", ["no_ticket"] = "Du har ingen billetter at handle med",
["bank_low"] = "Bankbalance for lav", ["bank_low"] = "Bankbalance for lav",
["no_cash"] = "Ikke nok kontanter", ["no_cash"] = "Ikke nok kontanter",
["saving_low"] = "Savings balance for lav", ["saving_low"] = "Savings balance for lav",
["soc_low"] = "Society balance for lav", ["soc_low"] = "Society balance for lav",
["nomoney_bank"] = "Ikke nok penge på din bankkonto", ["nomoney_bank"] = "Ikke nok penge på din bankkonto",
["error_start"] = "Fejl: Konto '", ["error_start"] = "Fejl: Konto '",
["error_end"] = "' ikke fundet", ["error_end"] = "' ikke fundet",
["not_enough"] = "Du har ikke nok kontanter til at give", ["not_enough"] = "Du har ikke nok kontanter til at give",
["zero"] = "Du kan ikke give DKK0", ["zero"] = "Du kan ikke give DKK0",
["charge_zero"] = "Du kan ikke opkræve 0 DKK", ["charge_zero"] = "Du kan ikke opkræve 0 DKK",
["no_ticket_to"] = "Ingen billetter at handle med", ["no_ticket_to"] = "Ingen billetter at handle med",
["customer_nocash"] = "Kunden har ikke nok kontanter til at betale", ["customer_nocash"] = "Kunden har ikke nok kontanter til at betale",
["you_nocash"] = "Du har ikke nok kontanter til at betale", ["you_nocash"] = "Du har ikke nok kontanter til at betale",
["decline_pay"] = " afslog DKK", ["decline_pay"] = " afslog DKK",
["declined_payment"] = "Du afslog betalingen", ["declined_payment"] = "Du afslog betalingen",
}, },
success = { success = {
["draw"] = "Hævet DKK", ["draw"] = "Hævet DKK",
["from_bank"] = " fra banken", ["from_bank"] = " fra banken",
["deposited"] = "Indsat DKK", ["deposited"] = "Indsat DKK",
["into_bank"] = " på bankkontoen", ["into_bank"] = " på bankkontoen",
["draw_save"] = " Trukket fra opsparingskontoen til bankkontoen", ["draw_save"] = " Trukket fra opsparingskontoen til bankkontoen",
["depos_save"] = " Indsat fra bankkontoen til opsparingen", ["depos_save"] = " Indsat fra bankkontoen til opsparingen",
["fromthe"] = " fra ", ["fromthe"] = " fra ",
["into"] = " til ", ["into"] = " til ",
["account"] = " konto", ["account"] = " konto",
["sent"] = "Sendt DKK", ["sent"] = "Sendt DKK",
["recieved"] = "Modtaget DKK", ["recieved"] = "Modtaget DKK",
["to"] = " til ", ["to"] = " til ",
["from"] = " fra ", ["from"] = " fra ",
["you_gave"] = "Du gav ", ["you_gave"] = "Du gav ",
["you_got"] = "Du fik DKK", ["you_got"] = "Du fik DKK",
["invoice_start"] = " Betalte deres DKK", ["invoice_start"] = " Betalte deres DKK",
["invoice_end"] = " faktura", ["invoice_end"] = " faktura",
["rec_rec"] = "Kvittering modtaget", ["rec_rec"] = "Kvittering modtaget",
["commission"] = " i provision", ["commission"] = " i provision",
["trade_ticket_start"] = "Billetter handlet: ", ["trade_ticket_start"] = "Billetter handlet: ",
["trade_ticket_end"] = " I alt: DKK", ["trade_ticket_end"] = " I alt: DKK",
["inv_succ"] = "Faktura sendt med succes", ["inv_succ"] = "Faktura sendt med succes",
["inv_recieved"] = "Ny faktura modtaget", ["inv_recieved"] = "Ny faktura modtaget",
["declined"] = "Du afslog betalingen", ["declined"] = "Du afslog betalingen",
["accepted_pay"] = " accepterede DKK", ["accepted_pay"] = " accepterede DKK",
["payment"] = " betaling", ["payment"] = " betaling",
["charged"] = " blev opkrævet for DKK", ["charged"] = " blev opkrævet for DKK",
["you_charged"] = "Du blev opkrævet for DKK", ["you_charged"] = "Du blev opkrævet for DKK",
["charge_end"] = " opkrævning", ["charge_end"] = " opkrævning",
}, },
blip = { blip = {
["blip_atm"] = "Hæveautomat", ["blip_atm"] = "Hæveautomat",
["blip_bank"] = "Bank", ["blip_bank"] = "Bank",
}, },
command = { command = {
["pay_user"] = "Betal en bruger i nærheden", ["pay_user"] = "Betal en bruger i nærheden",
["cash_reg"] = "Brug mobil kontantregister", ["cash_reg"] = "Brug mobil kontantregister",
["charge"] = "Opkræv en anden person", ["charge"] = "Opkræv en anden person",
}, },
target = { target = {
["atm"] = "Brug hæveautomat", ["atm"] = "Brug hæveautomat",
["bank"] = "Brug bank", ["bank"] = "Brug bank",
["transfer"] = "Overfør penge", ["transfer"] = "Overfør penge",
["saving"] = "Adgang til opsparing", ["saving"] = "Adgang til opsparing",
["soc_saving"] = "Adgang til society-konto", ["soc_saving"] = "Adgang til society-konto",
["soc_trans"] = "Society pengetransfer", ["soc_trans"] = "Society pengetransfer",
["gang_acct"] = "Gang Society-konto", ["gang_acct"] = "Gang Society-konto",
["gang_trans"] = "Gang pengetransfer", ["gang_trans"] = "Gang pengetransfer",
["charge"] = "Opkræv kunde", ["charge"] = "Opkræv kunde",
["cashin_boss"] = "Indbetal jobkvitteringer", ["cashin_boss"] = "Indbetal jobkvitteringer",
["cashin_gang"] = "Indbetal gangkvitteringer", ["cashin_gang"] = "Indbetal gangkvitteringer",
}, },
menu = { menu = {
["close"] = "Luk", ["close"] = "Luk",
["withdraw"] = "Hæv", ["withdraw"] = "Hæv",
["deposit"] = "Indsæt", ["deposit"] = "Indsæt",
["transfer"] = "Overfør", ["transfer"] = "Overfør",
["transfer_money"] = "Overfør penge", ["transfer_money"] = "Overfør penge",
["header_atm"] = "💵 Hæveautomat Bank 💵", ["header_atm"] = "💵 Hæveautomat Bank 💵",
["header_trans_amount"] = "💵 Beløb at overføre", ["header_trans_amount"] = "💵 Beløb at overføre",
["header_bank"] = "🏦 Bankvæsen 🏦", ["header_bank"] = "🏦 Bankvæsen 🏦",
["header_trans"] = "🔀 Overførselsservice 🔀", ["header_trans"] = "🔀 Overførselsservice 🔀",
["header_account_no"] = "🏦 Kontonr.", ["header_account_no"] = "🏦 Kontonr.",
["header_saving"] = "💰 Opsparing 💰", ["header_saving"] = "💰 Opsparing 💰",
["acc_atm"] = "Adgang til hæveautomat", ["acc_atm"] = "Adgang til hæveautomat",
["acc_bank"] = "Adgang til bank", ["acc_bank"] = "Adgang til bank",
["acc_trans"] = "Adgang til overførsler", ["acc_trans"] = "Adgang til overførsler",
["acc_saving"] = "Adgang til opsparing", ["acc_saving"] = "Adgang til opsparing",
["acc_boss"] = "Adgang til society-konto", ["acc_boss"] = "Adgang til society-konto",
["acc_boss_trans"] = "Adgang til society-overførsler", ["acc_boss_trans"] = "Adgang til society-overførsler",
["acc_gang"] = "Adgang til gang-society-konto", ["acc_gang"] = "Adgang til gang-society-konto",
["acc_gang_trans"] = "Adgang til gangoverførsler", ["acc_gang_trans"] = "Adgang til gangoverførsler",
["header_soc"] = "- Society-konto -", ["header_soc"] = "- Society-konto -",
["header_soc_bank"] = "🏢 Society Bank 🏢", ["header_soc_bank"] = "🏢 Society Bank 🏢",
["amount_pay"] = "💵 Beløb at betale", ["amount_pay"] = "💵 Beløb at betale",
["give_cash"] = "Giv nogen kontanter", ["give_cash"] = "Giv nogen kontanter",
["give"] = "Giv", ["give"] = "Giv",
["welcome"] = "Velkommen tilbage, ", ["welcome"] = "Velkommen tilbage, ",
["citizenid"] = "- Borger-ID -", ["citizenid"] = "- Borger-ID -",
["header_acc"] = "- Konto -", ["header_acc"] = "- Konto -",
["header_info"] = "- Kontoinformation -Opsparings-ID: ", ["header_info"] = "- Kontoinformation -Opsparings-ID: ",
["header_balance_bank"] = "- Balancer -🏦Bank - DKK", ["header_balance_bank"] = "- Balancer -🏦Bank - DKK",
["header_option"] = "- Valg -", ["header_option"] = "- Valg -",
["cash_balance"] = "💵Kontanter - DKK", ["cash_balance"] = "💵Kontanter - DKK",
["bank_balance"] = "🏦Bank - DKK", ["bank_balance"] = "🏦Bank - DKK",
["saving_balance"] = "- Balancer -💰Opsparing - DKK", ["saving_balance"] = "- Balancer -💰Opsparing - DKK",
["cus_id"] = "# Kundens ID #", ["cus_id"] = "# Kundens ID #",
["type"] = "Betalingstype", ["type"] = "Betalingstype",
["amount_charge"] = "💵 Beløb at opkræve", ["amount_charge"] = "💵 Beløb at opkræve",
["cash_reg"] = "Kontantregister", ["cash_reg"] = "Kontantregister",
["person_id"] = "# Personens ID #", ["person_id"] = "# Personens ID #",
["charge"] = "Opkræv", ["charge"] = "Opkræv",
["send"] = "Send", ["send"] = "Send",
["receipt"] = "Kvitteringer 🧾", ["receipt"] = "Kvitteringer 🧾",
["payment"] = " Betaling 🧾", ["payment"] = " Betaling 🧾",
["trade_confirm"] = "Vil du bytte dine kvitteringer til betaling?", ["trade_confirm"] = "Vil du bytte dine kvitteringer til betaling?",
["accept_payment"] = "Vil du acceptere betalingen?", ["accept_payment"] = "Vil du acceptere betalingen?",
["accept_charge"] = "Vil du acceptere opkrævningen?", ["accept_charge"] = "Vil du acceptere opkrævningen?",
["ticket_amount"] = "Antal billetter: ", ["ticket_amount"] = "Antal billetter: ",
["total_pay"] = "Total betaling: DKK", ["total_pay"] = "Total betaling: DKK",
["confirm"] = "Ja", ["confirm"] = "Ja",
["yes"] = "Ja", ["yes"] = "Ja",
["no"] = "Nej", ["no"] = "Nej",
["cash"] = "Kontanter", ["cash"] = "Kontanter",
["card"] = "Kort", ["card"] = "Kort",
["payment_amount"] = " Betaling: DKK", ["payment_amount"] = " Betaling: DKK",
["bank_charge"] = "Bankgebyr: DKK", ["bank_charge"] = "Bankgebyr: DKK",
}, },
} }

View File

@@ -1,135 +1,135 @@
Loc = Loc or {} Loc = Loc or {}
Loc["de"] = { Loc["de"] = {
error = { error = {
["cancel"] = "Abgebrochen", ["cancel"] = "Abgebrochen",
["no_one"] = "Keiner in der Nähe zum Aufladen", ["no_one"] = "Keiner in der Nähe zum Aufladen",
["not_onduty"] = "Nicht eingestempelt!", ["not_onduty"] = "Nicht eingestempelt!",
["no_job"] = "Sie haben nicht den gewünschten Beruf", ["no_job"] = "Sie haben nicht den gewünschten Beruf",
["no_ticket"] = "Sie haben keine Tickets zum Tauschen", ["no_ticket"] = "Sie haben keine Tickets zum Tauschen",
["bank_low"] = "Kontostand zu niedrig", ["bank_low"] = "Kontostand zu niedrig",
["no_cash"] = "Nicht genug Bargeld", ["no_cash"] = "Nicht genug Bargeld",
["saving_low"] = "Sparguthaben zu niedrig", ["saving_low"] = "Sparguthaben zu niedrig",
["soc_low"] = "Firmenkontoguthaben zu niedrig", ["soc_low"] = "Firmenkontoguthaben zu niedrig",
["nomoney_bank"] = "Nicht genug Geld auf Ihrer Bank", ["nomoney_bank"] = "Nicht genug Geld auf Ihrer Bank",
["error_start"] = "Fehler: Konto '", ["error_start"] = "Fehler: Konto '",
["error_end"] = "' nicht gefunden", ["error_end"] = "' nicht gefunden",
["not_enough"] = "Sie haben nicht genug Geld zum übergeben", ["not_enough"] = "Sie haben nicht genug Geld zum übergeben",
["zero"] = "Sie können nicht 0$ geben", ["zero"] = "Sie können nicht 0$ geben",
["charge_zero"] = "Sie können keine $0 berechnen", ["charge_zero"] = "Sie können keine $0 berechnen",
["no_ticket_to"] = "Keine Tickets zum Tauschen", ["no_ticket_to"] = "Keine Tickets zum Tauschen",
["customer_nocash"] = "Der Kunde hat nicht genug Bargeld, um zu bezahlen", ["customer_nocash"] = "Der Kunde hat nicht genug Bargeld, um zu bezahlen",
["you_nocash"] = "Sie haben nicht genug Geld, um zu bezahlen", ["you_nocash"] = "Sie haben nicht genug Geld, um zu bezahlen",
["decline_pay"] = " lehnte die $ ab", ["decline_pay"] = " lehnte die $ ab",
["declined_payment"] = "Sie haben die Zahlung abgelehnt", ["declined_payment"] = "Sie haben die Zahlung abgelehnt",
}, },
success = { success = {
["draw"] = "Abgehoben $", ["draw"] = "Abgehoben $",
["from_bank"] = " von der Bank", ["from_bank"] = " von der Bank",
["deposited"] = "Eingezahlt $", ["deposited"] = "Eingezahlt $",
["into_bank"] = " in die Bank", ["into_bank"] = " in die Bank",
["draw_save"] = " Abhebung von Ersparnissen auf ein Bankkonto", ["draw_save"] = " Abhebung von Ersparnissen auf ein Bankkonto",
["depos_save"] = " Vom Bankkonto auf das Sparkonto eingezahlt", ["depos_save"] = " Vom Bankkonto auf das Sparkonto eingezahlt",
["fromthe"] = " von der ", ["fromthe"] = " von der ",
["into"] = " in die ", ["into"] = " in die ",
["account"] = " Konto", ["account"] = " Konto",
["sent"] = "Gesendet $", ["sent"] = "Gesendet $",
["recieved"] = "Empfangen $", ["recieved"] = "Empfangen $",
["to"] = " zu ", ["to"] = " zu ",
["from"] = " von ", ["from"] = " von ",
["you_gave"] = "Sie gaben ", ["you_gave"] = "Sie gaben ",
["you_got"] = "Sie haben $", ["you_got"] = "Sie haben $",
["invoice_start"] = " Bezahlten ihre $", ["invoice_start"] = " Bezahlten ihre $",
["invoice_end"] = " Rechnung", ["invoice_end"] = " Rechnung",
["rec_rec"] = "Erhaltene Quittung", ["rec_rec"] = "Erhaltene Quittung",
["commission"] = " in der Kommission", ["commission"] = " in der Kommission",
["trade_ticket_start"] = "Gehandelte Tickets: ", ["trade_ticket_start"] = "Gehandelte Tickets: ",
["trade_ticket_end"] = " Total: $", ["trade_ticket_end"] = " Total: $",
["inv_succ"] = "Rechnung erfolgreich gesendet", ["inv_succ"] = "Rechnung erfolgreich gesendet",
["inv_recieved"] = "Neue Rechnung erhalten", ["inv_recieved"] = "Neue Rechnung erhalten",
["declined"] = "Sie haben die Zahlung abgelehnt", ["declined"] = "Sie haben die Zahlung abgelehnt",
["accepted_pay"] = " akzeptierte die $", ["accepted_pay"] = " akzeptierte die $",
["payment"] = " Zahlung", ["payment"] = " Zahlung",
["charged"] = " wurde berechnet für $", ["charged"] = " wurde berechnet für $",
["you_charged"] = "Sie wurden berechnet für $", ["you_charged"] = "Sie wurden berechnet für $",
["charge_end"] = " Gebühr", ["charge_end"] = " Gebühr",
}, },
blip = { blip = {
["blip_atm"] = "ATM", ["blip_atm"] = "ATM",
["blip_bank"] = "Bank", ["blip_bank"] = "Bank",
}, },
command = { command = {
["pay_user"] = "Einen Bürger in der Nähe bezahlen", ["pay_user"] = "Einen Bürger in der Nähe bezahlen",
["cash_reg"] = "Mobile Registrierkasse verwenden", ["cash_reg"] = "Mobile Registrierkasse verwenden",
["charge"] = "Eine andere Person belasten", ["charge"] = "Eine andere Person belasten",
}, },
target = { target = {
["atm"] = "ATM benutzen", ["atm"] = "ATM benutzen",
["bank"] = "Bank benutzen", ["bank"] = "Bank benutzen",
["transfer"] = "Geld überweisen", ["transfer"] = "Geld überweisen",
["saving"] = "Zugang Ersparnisse", ["saving"] = "Zugang Ersparnisse",
["soc_saving"] = "Zugang Firmenkonto", ["soc_saving"] = "Zugang Firmenkonto",
["soc_trans"] = "Firmenkonto Geldüberweisung", ["soc_trans"] = "Firmenkonto Geldüberweisung",
["gang_acct"] = "Gang Konto", ["gang_acct"] = "Gang Konto",
["gang_trans"] = "Gang Geldtransfer", ["gang_trans"] = "Gang Geldtransfer",
["charge"] = "Gebühr für den Kunden", ["charge"] = "Gebühr für den Kunden",
["cashin_boss"] = "Bargeld in Job-Einnahmen", ["cashin_boss"] = "Bargeld in Job-Einnahmen",
["cashin_gang"] = "Bargeld in Bandeneinnahmen", ["cashin_gang"] = "Bargeld in Bandeneinnahmen",
}, },
menu = { menu = {
["close"] = "Schließen", ["close"] = "Schließen",
["withdraw"] = "Abheben", ["withdraw"] = "Abheben",
["deposit"] = "Einzahlen", ["deposit"] = "Einzahlen",
["transfer"] = "Überweißen", ["transfer"] = "Überweißen",
["transfer_money"] = "Geld überweisen", ["transfer_money"] = "Geld überweisen",
["header_atm"] = "💵 ATM Banking 💵", ["header_atm"] = "💵 ATM Banking 💵",
["header_trans_amount"] = "💵 Überweisungsbetrag", ["header_trans_amount"] = "💵 Überweisungsbetrag",
["header_bank"] = "🏦 Banking 🏦", ["header_bank"] = "🏦 Banking 🏦",
["header_trans"] = "🔀 Transferdienste 🔀", ["header_trans"] = "🔀 Transferdienste 🔀",
["header_account_no"] = "🏦 Kontonummer.", ["header_account_no"] = "🏦 Kontonummer.",
["header_saving"] = "💰 Ersparnisse 💰", ["header_saving"] = "💰 Ersparnisse 💰",
["acc_atm"] = "Zugang zu ATM", ["acc_atm"] = "Zugang zu ATM",
["acc_bank"] = "Zugang Bank", ["acc_bank"] = "Zugang Bank",
["acc_trans"] = "Zugriff auf Überweisungen", ["acc_trans"] = "Zugriff auf Überweisungen",
["acc_saving"] = "Zugang zu Ersparnissen", ["acc_saving"] = "Zugang zu Ersparnissen",
["acc_boss"] = "Zugriff auf das Firmenkonto", ["acc_boss"] = "Zugriff auf das Firmenkonto",
["acc_boss_trans"] = "Zugang zu Firmenkontotransfers", ["acc_boss_trans"] = "Zugang zu Firmenkontotransfers",
["acc_gang"] = "Zugriff auf das Gangkonto", ["acc_gang"] = "Zugriff auf das Gangkonto",
["acc_gang_trans"] = "Zugang zu Gangkontotransfers", ["acc_gang_trans"] = "Zugang zu Gangkontotransfers",
["header_soc"] = "- Firmenkonto -", ["header_soc"] = "- Firmenkonto -",
["header_soc_bank"] = "🏢 Firmen Banking 🏢", ["header_soc_bank"] = "🏢 Firmen Banking 🏢",
["amount_pay"] = "💵 Zu zahlender Betrag'", ["amount_pay"] = "💵 Zu zahlender Betrag'",
["give_cash"] = "Jemandem Bargeld geben", ["give_cash"] = "Jemandem Bargeld geben",
["give"] = "Geben", ["give"] = "Geben",
["welcome"] = "Willkommen zurück, ", ["welcome"] = "Willkommen zurück, ",
["citizenid"] = "- Ausweisnummer -", ["citizenid"] = "- Ausweisnummer -",
["header_acc"] = "- Konto -", ["header_acc"] = "- Konto -",
["header_info"] = "- Konto Info -Ersparnis-ID: ", ["header_info"] = "- Konto Info -Ersparnis-ID: ",
["header_balance_bank"] = "- Kontostand -🏦Bank - $", ["header_balance_bank"] = "- Kontostand -🏦Bank - $",
["header_option"] = "- Optionen -", ["header_option"] = "- Optionen -",
["cash_balance"] = "💵Bargeld - $", ["cash_balance"] = "💵Bargeld - $",
["bank_balance"] = "🏦Bank - $", ["bank_balance"] = "🏦Bank - $",
["saving_balance"] = "- Kontostand -💰Ersparnisses - $", ["saving_balance"] = "- Kontostand -💰Ersparnisses - $",
["cus_id"] = "# Kunden ID #", ["cus_id"] = "# Kunden ID #",
["type"] = "Zahlungsart", ["type"] = "Zahlungsart",
["amount_charge"] = "💵 Zu berechnender Betrag", ["amount_charge"] = "💵 Zu berechnender Betrag",
["cash_reg"] = " Registrierkasse", ["cash_reg"] = " Registrierkasse",
["person_id"] = "# Bürger ID #", ["person_id"] = "# Bürger ID #",
["charge"] = " Laden Sie", ["charge"] = " Laden Sie",
["send"] = "Send", ["send"] = "Send",
["receipt"] = " Quittungen 🧾", ["receipt"] = " Quittungen 🧾",
["payment"] = " Zahlung 🧾", ["payment"] = " Zahlung 🧾",
["trade_confirm"] = "Möchten Sie Ihre Quittungen gegen Bezahlung eintauschen??", ["trade_confirm"] = "Möchten Sie Ihre Quittungen gegen Bezahlung eintauschen??",
["accept_payment"] = "Möchten Sie die Zahlung akzeptieren?", ["accept_payment"] = "Möchten Sie die Zahlung akzeptieren?",
["accept_charge"] = "Möchten Sie die Gebühr akzeptieren?", ["accept_charge"] = "Möchten Sie die Gebühr akzeptieren?",
["ticket_amount"] = "Anzahl der Tickets: ", ["ticket_amount"] = "Anzahl der Tickets: ",
["total_pay"] = "Gesamte Zahlung: $", ["total_pay"] = "Gesamte Zahlung: $",
["confirm"] = "Ja", ["confirm"] = "Ja",
["yes"] = "Ja", ["yes"] = "Ja",
["no"] = "Nein", ["no"] = "Nein",
["cash"] = "Bargeld", ["cash"] = "Bargeld",
["card"] = "Karte", ["card"] = "Karte",
["payment_amount"] = " Zahlung: $", ["payment_amount"] = " Zahlung: $",
["bank_charge"] = "Bankgebühr: $", ["bank_charge"] = "Bankgebühr: $",
}, },
} }

View File

@@ -1,135 +1,135 @@
Loc = Loc or {} Loc = Loc or {}
Loc["en"] = { Loc["en"] = {
error = { error = {
["cancel"] = "Cancelled", ["cancel"] = "Cancelled",
["no_one"] = "No one near by to charge", ["no_one"] = "No one near by to charge",
["not_onduty"] = "Not Clocked in!", ["not_onduty"] = "Not Clocked in!",
["no_job"] = "You don't have the required job", ["no_job"] = "You don't have the required job",
["no_ticket"] = "You don't have any tickets to trade", ["no_ticket"] = "You don't have any tickets to trade",
["bank_low"] = "Bank Balance too low", ["bank_low"] = "Bank Balance too low",
["no_cash"] = "Not enough cash", ["no_cash"] = "Not enough cash",
["saving_low"] = "Savings Balance too low", ["saving_low"] = "Savings Balance too low",
["soc_low"] = "Society balance too low", ["soc_low"] = "Society balance too low",
["nomoney_bank"] = "Not enough money in your bank", ["nomoney_bank"] = "Not enough money in your bank",
["error_start"] = "Error: Account '", ["error_start"] = "Error: Account '",
["error_end"] = "' not found", ["error_end"] = "' not found",
["not_enough"] = "You don't have enough cash to give", ["not_enough"] = "You don't have enough cash to give",
["zero"] = "You can't give $0", ["zero"] = "You can't give $0",
["charge_zero"] = "You can't charge $0", ["charge_zero"] = "You can't charge $0",
["no_ticket_to"] = "No tickets to trade", ["no_ticket_to"] = "No tickets to trade",
["customer_nocash"] = "Customer doesn't have enough cash to pay", ["customer_nocash"] = "Customer doesn't have enough cash to pay",
["you_nocash"] = "You don't have enough cash to pay", ["you_nocash"] = "You don't have enough cash to pay",
["decline_pay"] = " declined the $", ["decline_pay"] = " declined the $",
["declined_payment"] = "You declined the payment", ["declined_payment"] = "You declined the payment",
}, },
success = { success = {
["draw"] = "Withdrew $", ["draw"] = "Withdrew $",
["from_bank"] = " from the bank", ["from_bank"] = " from the bank",
["deposited"] = "Deposited $", ["deposited"] = "Deposited $",
["into_bank"] = " into the Bank", ["into_bank"] = " into the Bank",
["draw_save"] = " Withdrawn from savings into bank account", ["draw_save"] = " Withdrawn from savings into bank account",
["depos_save"] = " Deposited from bank account into savings", ["depos_save"] = " Deposited from bank account into savings",
["fromthe"] = " from the ", ["fromthe"] = " from the ",
["into"] = " into the ", ["into"] = " into the ",
["account"] = " account", ["account"] = " account",
["sent"] = "Sent $", ["sent"] = "Sent $",
["recieved"] = "Recieved $", ["recieved"] = "Recieved $",
["to"] = " to ", ["to"] = " to ",
["from"] = " from ", ["from"] = " from ",
["you_gave"] = "You gave ", ["you_gave"] = "You gave ",
["you_got"] = "You got $", ["you_got"] = "You got $",
["invoice_start"] = " Paid their $", ["invoice_start"] = " Paid their $",
["invoice_end"] = " invoice", ["invoice_end"] = " invoice",
["rec_rec"] = "Receipt received", ["rec_rec"] = "Receipt received",
["commission"] = " in Commission", ["commission"] = " in Commission",
["trade_ticket_start"] = "Tickets traded: ", ["trade_ticket_start"] = "Tickets traded: ",
["trade_ticket_end"] = " Total: $", ["trade_ticket_end"] = " Total: $",
["inv_succ"] = "Invoice Successfully Sent", ["inv_succ"] = "Invoice Successfully Sent",
["inv_recieved"] = "New Invoice Received", ["inv_recieved"] = "New Invoice Received",
["declined"] = "You declined the payment", ["declined"] = "You declined the payment",
["accepted_pay"] = " accepted the $", ["accepted_pay"] = " accepted the $",
["payment"] = " payment", ["payment"] = " payment",
["charged"] = " was charged for $", ["charged"] = " was charged for $",
["you_charged"] = "You were charged for $", ["you_charged"] = "You were charged for $",
["charge_end"] = " charge", ["charge_end"] = " charge",
}, },
blip = { blip = {
["blip_atm"] = "ATM", ["blip_atm"] = "ATM",
["blip_bank"] = "Bank", ["blip_bank"] = "Bank",
}, },
command = { command = {
["pay_user"] = "Pay a user nearby", ["pay_user"] = "Pay a user nearby",
["cash_reg"] = "Use mobile cash register", ["cash_reg"] = "Use mobile cash register",
["charge"] = "Charge another person", ["charge"] = "Charge another person",
}, },
target = { target = {
["atm"] = "Use ATM", ["atm"] = "Use ATM",
["bank"] = "Use Bank", ["bank"] = "Use Bank",
["transfer"] = "Transfer Money", ["transfer"] = "Transfer Money",
["saving"] = "Access Savings", ["saving"] = "Access Savings",
["soc_saving"] = "Access Society Account", ["soc_saving"] = "Access Society Account",
["soc_trans"] = "Society Money Transfer", ["soc_trans"] = "Society Money Transfer",
["gang_acct"] = "Gang Society Account", ["gang_acct"] = "Gang Society Account",
["gang_trans"] = "Gang Money Transfer", ["gang_trans"] = "Gang Money Transfer",
["charge"] = "Charge Customer", ["charge"] = "Charge Customer",
["cashin_boss"] = "Cash in Job Receipts", ["cashin_boss"] = "Cash in Job Receipts",
["cashin_gang"] = "Cash in Gang Receipts", ["cashin_gang"] = "Cash in Gang Receipts",
}, },
menu = { menu = {
["close"] = "Close", ["close"] = "Close",
["withdraw"] = "Withdrawal", ["withdraw"] = "Withdrawal",
["deposit"] = "Deposit", ["deposit"] = "Deposit",
["transfer"] = "Transfer", ["transfer"] = "Transfer",
["transfer_money"] = "Transfer Money", ["transfer_money"] = "Transfer Money",
["header_atm"] = "💵 ATM Banking 💵", ["header_atm"] = "💵 ATM Banking 💵",
["header_trans_amount"] = "💵 Amount to transfer", ["header_trans_amount"] = "💵 Amount to transfer",
["header_bank"] = "🏦 Banking 🏦", ["header_bank"] = "🏦 Banking 🏦",
["header_trans"] = "🔀 Transfer Services 🔀", ["header_trans"] = "🔀 Transfer Services 🔀",
["header_account_no"] = "🏦 Account no.", ["header_account_no"] = "🏦 Account no.",
["header_saving"] = "💰 Savings 💰", ["header_saving"] = "💰 Savings 💰",
["acc_atm"] = "Accessing ATM", ["acc_atm"] = "Accessing ATM",
["acc_bank"] = "Accessing Bank", ["acc_bank"] = "Accessing Bank",
["acc_trans"] = "Accessing Transfers", ["acc_trans"] = "Accessing Transfers",
["acc_saving"] = "Accessing Savings", ["acc_saving"] = "Accessing Savings",
["acc_boss"] = "Accessing Society Account", ["acc_boss"] = "Accessing Society Account",
["acc_boss_trans"] = "Accessing Society Transfers", ["acc_boss_trans"] = "Accessing Society Transfers",
["acc_gang"] = "Accessing Gang Society Account", ["acc_gang"] = "Accessing Gang Society Account",
["acc_gang_trans"] = "Accessing Gang Transfers", ["acc_gang_trans"] = "Accessing Gang Transfers",
["header_soc"] = "Society Account -", ["header_soc"] = "Society Account -",
["header_soc_bank"] = "Society Banking", ["header_soc_bank"] = "Society Banking",
["amount_pay"] = "💵 Amount to Pay'", ["amount_pay"] = "💵 Amount to Pay'",
["give_cash"] = "Give someone cash", ["give_cash"] = "Give someone cash",
["give"] = "Give", ["give"] = "Give",
["welcome"] = "Welcome back, ", ["welcome"] = "Welcome back, ",
["citizenid"] = "Citizen ID -", ["citizenid"] = "Citizen ID -",
["header_acc"] = "Account -", ["header_acc"] = "Account -",
["header_info"] = "Account Info - Savings ID: ", ["header_info"] = "Account Info - Savings ID: ",
["header_balance"] = "Balances -", ["header_balance"] = "Balances -",
["header_option"] = "Options -", ["header_option"] = "Options -",
["cash_balance"] = "💵Cash - $", ["cash_balance"] = "💵Cash - $",
["bank_balance"] = "🏦Bank - $", ["bank_balance"] = "🏦Bank - $",
["saving_balance"] = "💰Savings - $", ["saving_balance"] = "💰Savings - $",
["cus_id"] = "# Customer ID #", ["cus_id"] = "# Customer ID #",
["type"] = "Payment Type", ["type"] = "Payment Type",
["amount_charge"] = "💵 Amount to Charge", ["amount_charge"] = "💵 Amount to Charge",
["cash_reg"] = " Cash Register", ["cash_reg"] = " Cash Register",
["person_id"] = "# Person's ID #", ["person_id"] = "# Person's ID #",
["charge"] = " Charge", ["charge"] = " Charge",
["send"] = "Send", ["send"] = "Send",
["receipt"] = " Receipts 🧾", ["receipt"] = " Receipts 🧾",
["payment"] = " Payment 🧾", ["payment"] = " Payment 🧾",
["trade_confirm"] = "Do you want trade your receipts for payment?", ["trade_confirm"] = "Do you want trade your receipts for payment?",
["accept_payment"] = "Do you want accept the payment?", ["accept_payment"] = "Do you want accept the payment?",
["accept_charge"] = "Do you want accept the charge?", ["accept_charge"] = "Do you want accept the charge?",
["ticket_amount"] = "Amount of Tickets: ", ["ticket_amount"] = "Amount of Tickets: ",
["total_pay"] = "<br>Total Payment: $", ["total_pay"] = "<br>Total Payment: $",
["confirm"] = "Confirm", ["confirm"] = "Confirm",
["yes"] = "Yes", ["yes"] = "Yes",
["no"] = "No", ["no"] = "No",
["cash"] = "Cash", ["cash"] = "Cash",
["card"] = "Card", ["card"] = "Card",
["payment_amount"] = " Payment: $", ["payment_amount"] = " Payment: $",
["bank_charge"] = "Bank Charge: $", ["bank_charge"] = "Bank Charge: $",
}, },
} }

View File

@@ -1,13 +1,11 @@
Core.Commands.Add("cashgive", registerCommand("cashgive", {
Loc[Config.Lan].command["pay_user"], {}, false, function(source) TriggerClientEvent(getScript()..":client:ATM:give", source) end) locale("command" , "pay_user"), {}, false,
registerCommand("polcharge", {
Loc[Config.Lan].command["pay_user"], {}, false,
function(source) function(source)
TriggerClientEvent(getScript()..":client:ATM:give", source) TriggerClientEvent(getScript()..":client:ATM:give", source)
end end
}) })
RegisterServerEvent(getScript()..":server:ATM:use", function(amount, billtype, baccount, account, society, gsociety) RegisterServerEvent(getScript()..":server:ATM:use", function(amount, billtype, baccount, account, society, gsociety)
local src = source local src = source
local Player = getPlayer(src) local Player = getPlayer(src)
@@ -18,19 +16,19 @@ RegisterServerEvent(getScript()..":server:ATM:use", function(amount, billtype, b
if account == "bank" or account == "atm" then if account == "bank" or account == "atm" then
if billtype == "withdraw" then if billtype == "withdraw" then
if Player.bank < amount then if Player.bank < amount then
triggerNotify(nil, Loc[Config.Lan].error["bank_low"], "error", src) triggerNotify(nil, locale("error" ,"bank_low"), "error", src)
elseif Player.bank >= tonumber(amount) then elseif Player.bank >= tonumber(amount) then
triggerNotify(nil, Loc[Config.Lan].success["draw"]..cv(amount)..Loc[Config.Lan].success["from_bank"], "success") -- Don't really need this as phone gets notified when money is withdrawn triggerNotify(nil, locale("success" ,"draw")..cv(amount)..locale("success" ,"from_bank"), "success") -- Don't really need this as phone gets notified when money is withdrawn
chargePlayer(amount, "bank", src) Wait(1500) chargePlayer(amount, "bank", src) Wait(1500)
fundPlayer(amount, "cash", src) fundPlayer(amount, "cash", src)
end end
elseif billtype == "deposit" then elseif billtype == "deposit" then
if Player.cash < amount then if Player.cash < amount then
triggerNotify(nil, Loc[Config.Lan].error["no_cash"], "error", src) triggerNotify(nil, locale("error" ,"no_cash"), "error", src)
elseif Player.cash >= amount then elseif Player.cash >= amount then
chargePlayer(amount, "cash", src) Wait(1500) chargePlayer(amount, "cash", src) Wait(1500)
fundPlayer(amount, "bank", src) fundPlayer(amount, "bank", src)
triggerNotify(nil, Loc[Config.Lan].success["deposited"]..cv(amount)..Loc[Config.Lan].success["into_bank"], "success", src) triggerNotify(nil, locale("success" ,"deposited")..cv(amount)..locale("success" ,"into_bank"), "success", src)
end end
end end
-- Transfers from bank to savings account -- -- Transfers from bank to savings account --
@@ -42,29 +40,29 @@ RegisterServerEvent(getScript()..":server:ATM:use", function(amount, billtype, b
if savbal >= amount then if savbal >= amount then
savbal -= amount savbal -= amount
fundPlayer(amount, "cash", src) fundPlayer(amount, "cash", src)
triggerNotify(nil, "$"..cv(amount)..Loc[Config.Lan].success["draw_save"], "success", src) triggerNotify(nil, "$"..cv(amount)..locale("success" ,"draw_save"), "success", src)
MySQL.Async.execute('UPDATE bank_accounts SET account_balance = ? WHERE citizenid = ?', { savbal, Player.citizenId}, function(success) MySQL.Async.execute('UPDATE bank_accounts SET account_balance = ? WHERE citizenid = ?', { savbal, Player.citizenId }, function(success)
if success then return true else return false end if success then return true else return false end
end) end)
elseif savbal < amount then elseif savbal < amount then
triggerNotify(nil, Loc[Config.Lan].error["saving_low"], "error") triggerNotify(nil, locale("error" ,"saving_low"), "error")
end end
elseif billtype == "deposit" then elseif billtype == "deposit" then
if amount < Player.bank then if amount < Player.bank then
savbal += amount savbal += amount
chargePlayer(amount, "bank", src) chargePlayer(amount, "bank", src)
triggerNotify(nil, "$"..cv(amount)..Loc[Config.Lan].success["depos_save"], "success", src) triggerNotify(nil, "$"..cv(amount)..locale("success", "depos_save"), "success", src)
MySQL.Async.execute('UPDATE bank_accounts SET account_balance = ? WHERE citizenid = ?', { savbal, Player.citizenId}, function(success) MySQL.Async.execute('UPDATE bank_accounts SET account_balance = ? WHERE citizenid = ?', { savbal, Player.citizenId}, function(success)
if success then return true else return false end if success then return true else return false end
end) end)
else triggerNotify(nil, Loc[Config.Lan].error["bank_low"], "error", src) else triggerNotify(nil, locale("error" ,"bank_low"), "error", src)
end end
end end
--Simple transfers from society account to bank -- --Simple transfers from society account to bank --
elseif account == "society" then elseif account == "society" then
if billtype == "withdraw" then if billtype == "withdraw" then
if tonumber(society) < amount then if tonumber(society) < amount then
triggerNotify(nil, Loc[Config.Lan].error["soc_low"], "error", src) triggerNotify(nil, locale("error" ,"soc_low"), "error", src)
elseif tonumber(society) >= amount then elseif tonumber(society) >= amount then
if isStarted("Renewed-Banking") then if isStarted("Renewed-Banking") then
@@ -87,10 +85,10 @@ RegisterServerEvent(getScript()..":server:ATM:use", function(amount, billtype, b
fundPlayer(amount, "bank", src) fundPlayer(amount, "bank", src)
debugPrint("^5Debug^7: ^3"..bankScript.."^7(^3Job^7): ^2Removing ^7$"..amount.." ^2from account ^7'^6"..Player.job.."^7' ($"..newAmount..")") debugPrint("^5Debug^7: ^3"..bankScript.."^7(^3Job^7): ^2Removing ^7$"..amount.." ^2from account ^7'^6"..Player.job.."^7' ($"..newAmount..")")
triggerNotify(nil, Loc[Config.Lan].success["draw"]..cv(amount)..Loc[Config.Lan].success["fromthe"]..Jobs[Player.job].label..Loc[Config.Lan].success["account"], "success", src) triggerNotify(nil, locale("success", "draw")..cv(amount)..locale("success", "fromthe")..Jobs[Player.job].label..locale("success" ,"account"), "success", src)
end end
elseif billtype == "deposit" then elseif billtype == "deposit" then
if Player.bank < amount then triggerNotify(nil, Loc[Config.Lan].error["nomoney_bank"], "error", src) if Player.bank < amount then triggerNotify(nil, locale("error", "nomoney_bank"), "error", src)
elseif Player.bank >= amount then elseif Player.bank >= amount then
if isStarted("Renewed-Banking") then if isStarted("Renewed-Banking") then
bankScript = "Renewed-Banking" bankScript = "Renewed-Banking"
@@ -112,7 +110,7 @@ RegisterServerEvent(getScript()..":server:ATM:use", function(amount, billtype, b
end end
chargePlayer(amount, "bank", src) Wait(1500) chargePlayer(amount, "bank", src) Wait(1500)
debugPrint("^5Debug^7: ^3"..bankScript.."^7(^3Job^7): ^2Adding ^7$"..amount.." ^2to account ^7'^6"..Player.job.."^7' ($"..newAmount..")") debugPrint("^5Debug^7: ^3"..bankScript.."^7(^3Job^7): ^2Adding ^7$"..amount.." ^2to account ^7'^6"..Player.job.."^7' ($"..newAmount..")")
triggerNotify(nil, Loc[Config.Lan].success["deposited"]..cv(amount)..Loc[Config.Lan].success["into"]..Jobs[Player.job].label..Loc[Config.Lan].success["account"], "success", src) triggerNotify(nil, locale("success", "deposited")..cv(amount)..locale("success", "into")..Jobs[Player.job].label..locale("success", "account"), "success", src)
end end
end end
-- Transfer from boss account to players -- -- Transfer from boss account to players --
@@ -145,14 +143,14 @@ RegisterServerEvent(getScript()..":server:ATM:use", function(amount, billtype, b
end end
if Reciever then if Reciever then
Reciever.Functions.AddMoney('bank', amount) Reciever.Functions.AddMoney('bank', amount)
triggerNotify(nil, Loc[Config.Lan].success["sent"]..amount..Loc[Config.Lan].success["to"]..Reciever.PlayerData.charinfo.firstname.." "..Reciever.PlayerData.charinfo.lastname, "success", src) triggerNotify(nil, locale("success" ,"sent"]..amount..locale("success" ,"to"]..Reciever.PlayerData.charinfo.firstname.." "..Reciever.PlayerData.charinfo.lastname, "success", src)
triggerNotify(nil, Loc[Config.Lan].success["recieved"]..cv(amount)..Loc[Config.Lan].success["from"]..tostring(Player.PlayerData.job.label)..Loc[Config.Lan].success["account"], "success", Reciever.PlayerData.source) triggerNotify(nil, locale("success" ,"recieved"]..cv(amount)..locale("success" ,"from"]..tostring(Player.PlayerData.job.label)..locale("success" ,"account"], "success", Reciever.PlayerData.source)
else else
local RecieverMoney = json.decode(result[1].money) local RecieverMoney = json.decode(result[1].money)
RecieverMoney.bank += amount RecieverMoney.bank += amount
MySQL.Async.execute('UPDATE players SET money = ? WHERE citizenid = ?', {json.encode(RecieverMoney), result[1].citizenid}) MySQL.Async.execute('UPDATE players SET money = ? WHERE citizenid = ?', {json.encode(RecieverMoney), result[1].citizenid})
end end
elseif not result[1] then triggerNotify(nil, Loc[Config.Lan].error["error_start"]..baccount..Loc[Config.Lan].error["error_end"], "error", src) elseif not result[1] then triggerNotify(nil, locale("error" ,"error_start"]..baccount..locale("error" ,"error_end"], "error", src)
end end
end]] end]]
@@ -160,7 +158,7 @@ RegisterServerEvent(getScript()..":server:ATM:use", function(amount, billtype, b
elseif account == "gang" then elseif account == "gang" then
if billtype == "withdraw" then if billtype == "withdraw" then
if tonumber(gsociety) < amount then if tonumber(gsociety) < amount then
triggerNotify(nil, Loc[Config.Lan].error["soc_low"], "error", src) triggerNotify(nil, locale("error" ,"soc_low"), "error", src)
elseif tonumber(gsociety) >= amount then elseif tonumber(gsociety) >= amount then
if isStarted("Renewed-Banking") then if isStarted("Renewed-Banking") then
exports['Renewed-Banking']:removeAccountMoney(Player.gang, amount) exports['Renewed-Banking']:removeAccountMoney(Player.gang, amount)
@@ -174,11 +172,11 @@ RegisterServerEvent(getScript()..":server:ATM:use", function(amount, billtype, b
end end
fundPlayer(amount, "bank", src) fundPlayer(amount, "bank", src)
triggerNotify(nil, Loc[Config.Lan].success["draw"]..cv(amount)..Loc[Config.Lan].success["fromthe"]..Gangs[Player.gang].label..Loc[Config.Lan].success["account"], "success", src) triggerNotify(nil, locale("success" ,"draw")..cv(amount)..locale("success" ,"fromthe")..Gangs[Player.gang].label..locale("success" ,"account"), "success", src)
elseif billtype == "deposit" then elseif billtype == "deposit" then
if Player.bank < amount then if Player.bank < amount then
triggerNotify(nil, Loc[Config.Lan].error["nomoney_bank"], "error", src) triggerNotify(nil, locale("error" ,"nomoney_bank"), "error", src)
elseif Player.bank >= amount then elseif Player.bank >= amount then
if isStarted("Renewed-Banking") then if isStarted("Renewed-Banking") then
exports['Renewed-Banking']:addAccountMoney(Player.gang, amount) exports['Renewed-Banking']:addAccountMoney(Player.gang, amount)
@@ -190,7 +188,7 @@ RegisterServerEvent(getScript()..":server:ATM:use", function(amount, billtype, b
exports["okokBanking"]:AddMoney(Player.gang, amount) exports["okokBanking"]:AddMoney(Player.gang, amount)
end end
Player.Functions.RemoveMoney('bank', amount) Wait(1500) Player.Functions.RemoveMoney('bank', amount) Wait(1500)
triggerNotify(nil, Loc[Config.Lan].success["deposited"]..cv(amount)..Loc[Config.Lan].success["into"]..Gangs[Player.gang].label..Loc[Config.Lan].success["account"], "success", src) triggerNotify(nil, locale("success" ,"deposited")..cv(amount)..locale("success" ,"into")..Gangs[Player.gang].label..locale("success" ,"account"), "success", src)
end end
end end
-- Transfer from gang account to players -- -- Transfer from gang account to players --
@@ -217,14 +215,14 @@ RegisterServerEvent(getScript()..":server:ATM:use", function(amount, billtype, b
elseif Config.Banking == "fd" then exports.fd_banking:RemoveGangMoney(tostring(Player.PlayerData.gang.name), amount) end elseif Config.Banking == "fd" then exports.fd_banking:RemoveGangMoney(tostring(Player.PlayerData.gang.name), amount) end
if not Reciever then if not Reciever then
Reciever.Functions.AddMoney('bank', amount) Reciever.Functions.AddMoney('bank', amount)
triggerNotify(nil, Loc[Config.Lan].success["sent"]..amount..Loc[Config.Lan].success["to"]..Reciever.PlayerData.charinfo.firstname.." "..Reciever.PlayerData.charinfo.lastname, "success", src) triggerNotify(nil, locale("success" ,"sent")..amount..locale("success" ,"to")..Reciever.PlayerData.charinfo.firstname.." "..Reciever.PlayerData.charinfo.lastname, "success", src)
triggerNotify(nil, Reciever.PlayerData.source, Loc[Config.Lan].success["recieved"]..cv(amount)..Loc[Config.Lan].success["from"]..tostring(Player.PlayerData.gang.label)..Loc[Config.Lan].success["account"], "success", Reciever.PlayerData.source) triggerNotify(nil, Reciever.PlayerData.source, locale("success" ,"recieved")..cv(amount)..locale("success" ,"from")..tostring(Player.PlayerData.gang.label)..locale("success" ,"account"), "success", Reciever.PlayerData.source)
else else
local RecieverMoney = json.decode(result[1].money) local RecieverMoney = json.decode(result[1].money)
RecieverMoney.bank += amount RecieverMoney.bank += amount
MySQL.Async.execute('UPDATE players SET money = ? WHERE citizenid = ?', {json.encode(RecieverMoney), result[1].citizenid}) MySQL.Async.execute('UPDATE players SET money = ? WHERE citizenid = ?', {json.encode(RecieverMoney), result[1].citizenid})
end end
elseif not result[1] then triggerNotify(nil, Loc[Config.Lan].error["error_start"]..baccount..Loc[Config.Lan].error["error_end"], "error", src) elseif not result[1] then triggerNotify(nil, locale("error" ,"error_start")..baccount..locale("error" ,"error_end"), "error", src)
end end
end end
@@ -249,15 +247,15 @@ RegisterServerEvent(getScript()..":server:ATM:use", function(amount, billtype, b
Player.Functions.RemoveMoney('bank', amount) Player.Functions.RemoveMoney('bank', amount)
if Reciever then if Reciever then
Reciever.Functions.AddMoney('bank', amount) Reciever.Functions.AddMoney('bank', amount)
triggerNotify(nil, Loc[Config.Lan].success["sent"]..cv(amount)..Loc[Config.Lan].success["to"]..Reciever.PlayerData.charinfo.firstname.." "..Reciever.PlayerData.charinfo.lastname, "success", src) triggerNotify(nil, locale("success" ,"sent")..cv(amount)..locale("success" ,"to")..Reciever.PlayerData.charinfo.firstname.." "..Reciever.PlayerData.charinfo.lastname, "success", src)
triggerNotify(nil, Loc[Config.Lan].success["recieved"]..cv(amount)..Loc[Config.Lan].success["from"]..Player.PlayerData.charinfo.firstname.." "..Player.PlayerData.charinfo.lastname, "success", Reciever.PlayerData.source) triggerNotify(nil, locale("success" ,"recieved")..cv(amount)..locale("success" ,"from")..Player.PlayerData.charinfo.firstname.." "..Player.PlayerData.charinfo.lastname, "success", Reciever.PlayerData.source)
else else
local RecieverMoney = json.decode(result[1].money) local RecieverMoney = json.decode(result[1].money)
RecieverMoney.bank += amount RecieverMoney.bank += amount
MySQL.Async.execute('UPDATE players SET money = ? WHERE citizenid = ?', {json.encode(RecieverMoney), result[1].citizenid}) MySQL.Async.execute('UPDATE players SET money = ? WHERE citizenid = ?', {json.encode(RecieverMoney), result[1].citizenid})
end end
elseif not result[1] then elseif not result[1] then
triggerNotify(nil, Loc[Config.Lan].error["error_start"]..baccount..Loc[Config.Lan].error["error_end"], "error", src) triggerNotify(nil, locale("error" ,"error_start")..baccount..locale("error" ,"error_end"), "error", src)
end end
end end
end end
@@ -299,17 +297,20 @@ createCallback(getScript()..":GetInfo", function(source)
end end
end end
-- Savings account is only QBCore for now
if isStarted(QBExport) then
-- Grab Savings account info -- Grab Savings account info
local result = MySQL.Sync.fetchAll('SELECT * FROM bank_accounts WHERE citizenid = ? AND account_name = ?', { Player.citizenId, 'Savings_'..Player.citizenId, })
if result[1] then
accountID = result[1].citizenid
savingBalance = result[1].account_balance
else
MySQL.Async.insert('INSERT INTO bank_accounts (citizenid, account_name, account_balance) VALUES (?, ?, ?)', { Player.citizenId, 'Savings_'..Player.citizenId, 0}, function() completed = true end) repeat Wait(0) until completed == true
local result = MySQL.Sync.fetchAll('SELECT * FROM bank_accounts WHERE citizenid = ? AND account_name = ?', { Player.citizenId, 'Savings_'..Player.citizenId, }) local result = MySQL.Sync.fetchAll('SELECT * FROM bank_accounts WHERE citizenid = ? AND account_name = ?', { Player.citizenId, 'Savings_'..Player.citizenId, })
accountID = result[1].citizenid if result[1] then
savingBalance = result[1].account_balance accountID = result[1].citizenid
end savingBalance = result[1].account_balance
else
MySQL.Async.insert('INSERT INTO bank_accounts (citizenid, account_name, account_balance) VALUES (?, ?, ?)', { Player.citizenId, 'Savings_'..Player.citizenId, 0}, function() completed = true end) repeat Wait(0) until completed == true
local result = MySQL.Sync.fetchAll('SELECT * FROM bank_accounts WHERE citizenid = ? AND account_name = ?', { Player.citizenId, 'Savings_'..Player.citizenId, })
accountID = result[1].citizenid
savingBalance = result[1].account_balance
end
end
local retTable = { local retTable = {
name = Player.firstname..' '..Player.lastname, name = Player.firstname..' '..Player.lastname,
cash = Player.cash, cash = Player.cash,
@@ -326,20 +327,20 @@ createCallback(getScript()..":GetInfo", function(source)
end) end)
RegisterServerEvent(getScript()..":server:ATM:give", function(citizen, price) RegisterServerEvent(getScript()..":server:ATM:give", function(citizen, price)
local Player = Core.Functions.GetPlayer(source) local Player = getPlayer(source)
local Reciever = Core.Functions.GetPlayer(tonumber(citizen)) local Reciever = getPlayer(tonumber(citizen))
local amount = tonumber(price) local amount = tonumber(price)
local balance = Player.Functions.GetMoney("cash") local balance = Player.cash
if amount and amount > 0 then if amount and amount > 0 then
if balance >= amount then if balance >= amount then
Player.Functions.RemoveMoney('cash', amount) chargePlayer(amount, "cash", source)
triggerNotify(nil, Loc[Config.Lan].success["you_gave"]..Reciever.PlayerData.charinfo.firstname.." $"..cv(amount), "success", source) triggerNotify(nil, locale("success" ,"you_gave")..Reciever.name.." $"..cv(amount), "success", source)
Reciever.Functions.AddMoney('cash', amount) fundPlayer(amount, "cash", Reciever.source)
triggerNotify(nil, Loc[Config.Lan].success["you_got"]..cv(amount)..Loc[Config.Lan].success["from"]..Player.PlayerData.charinfo.firstname, "success", tonumber(citizen)) triggerNotify(nil, locale("success" ,"you_got")..cv(amount)..locale("success" ,"from")..Player.name, "success", tonumber(citizen))
elseif balance < amount then elseif balance < amount then
triggerNotify(nil, Loc[Config.Lan].error["not_enough"], "error", source) triggerNotify(nil, locale("error" ,"not_enough"), "error", source)
end end
else triggerNotify(nil, Loc[Config.Lan].error["zero"], 'error', source) end else triggerNotify(nil, locale("error" ,"zero"), 'error', source) end
end) end)

View File

@@ -12,7 +12,7 @@ onResourceStart(function()
end, true) end, true)
registerCommand("cashregister", { registerCommand("cashregister", {
Loc[Config.Lan].command["cash_reg"], {}, false, locale("command", "cash_reg"), {}, false,
function(source) function(source)
TriggerClientEvent(getScript()..":client:Charge", source, {}, true) TriggerClientEvent(getScript()..":client:Charge", source, {}, true)
end end
@@ -22,10 +22,7 @@ createCallback(getScript()..":MakePlayerList", function(source)
local onlineList = {} local onlineList = {}
for _, v in pairs(GetPlayers()) do for _, v in pairs(GetPlayers()) do
local Player = getPlayer(v) local Player = getPlayer(v)
onlineList[#onlineList+1] = { onlineList[#onlineList+1] = { value = tonumber(v), text = "["..v.."] - "..Player.name }
value = tonumber(v),
text = "["..v.."] - "..Player.name
}
end end
return onlineList return onlineList
end) end)
@@ -38,8 +35,8 @@ RegisterServerEvent(getScript()..":server:Charge", function(citizen, price, bill
local balance = billed[billtype] local balance = billed[billtype]
if amount and amount > 0 then if amount and amount > 0 then
if balance < amount then if balance < amount then
triggerNotify(nil, Loc[Config.Lan].error["customer_nocash"], "error", src) triggerNotify(nil, locale("error", "customer_nocash"), "error", src)
triggerNotify(nil, Loc[Config.Lan].error["you_nocash"], "error", tonumber(citizen)) triggerNotify(nil, locale("error", "you_nocash"), "error", tonumber(citizen))
return return
end end
local label = gang == true and Gangs[biller.gang].label or Jobs[biller.job].label local label = gang == true and Gangs[biller.gang].label or Jobs[biller.job].label
@@ -64,13 +61,13 @@ RegisterServerEvent(getScript()..":server:Charge", function(citizen, price, bill
['@sendercitizenid'] = biller.citizenid, ['@sendercitizenid'] = biller.citizenid,
['@label'] = label, ['@label'] = label,
}) })
TriggerClientEvent('gksphone:notifi', src, {title = 'Billing', message = Loc[Config.Lan].success["inv_succ"], img= '/html/static/img/icons/logo.png' }) TriggerClientEvent('gksphone:notifi', src, {title = 'Billing', message = locale("success", "inv_succ"), img= '/html/static/img/icons/logo.png' })
TriggerClientEvent('gksphone:notifi', billed.source, {title = 'Billing', message = Loc[Config.Lan].success["inv_recieved"], img= '/html/static/img/icons/logo.png' }) TriggerClientEvent('gksphone:notifi', billed.source, {title = 'Billing', message = locale("success", "inv_recieved"), img= '/html/static/img/icons/logo.png' })
end end
triggerNotify(nil, Loc[Config.Lan].success["inv_succ"], 'success', src) triggerNotify(nil, locale("success", "inv_succ"), 'success', src)
triggerNotify(nil, Loc[Config.Lan].success["inv_recieved"], nil, billed.source) triggerNotify(nil, locale("success", "inv_recieved"), nil, billed.source)
end end
else triggerNotify(nil, Loc[Config.Lan].error["charge_zero"], 'error', source) return end else triggerNotify(nil, locale("error", "charge_zero"), 'error', source) return end
end) end)
RegisterServerEvent(getScript()..":server:PayPopup", function(data) RegisterServerEvent(getScript()..":server:PayPopup", function(data)
@@ -88,10 +85,10 @@ RegisterServerEvent(getScript()..":server:PayPopup", function(data)
exports['ap-government']:chargeCityTax(billed.source, "Item", data.amount) exports['ap-government']:chargeCityTax(billed.source, "Item", data.amount)
end end
TriggerEvent(getScript()..":Tickets:Give", newdata, biller, data.gang) TriggerEvent(getScript()..":Tickets:Give", newdata, biller, data.gang)
triggerNotify(nil, billed.firstname..Loc[Config.Lan].success["accepted_pay"]..data.amount..Loc[Config.Lan].success["payment"], "success", data.biller) triggerNotify(nil, billed.firstname..locale("success", "accepted_pay")..data.amount..locale("success", "payment"), "success", data.biller)
elseif not data.accept then elseif not data.accept then
triggerNotify(nil, Loc[Config.Lan].success["declined"], "error", src) triggerNotify(nil, locale("success", "declined"), "error", src)
triggerNotify(nil, billed.firstname..Loc[Config.Lan].error["decline_pay"]..data.amount..Loc[Config.Lan].success["payment"], "error", data.biller) triggerNotify(nil, billed.firstname..locale("error", "decline_pay")..data.amount..locale("success", "payment"), "error", data.biller)
end end
end) end)

View File

@@ -1,5 +1,5 @@
registerCommand("polcharge", { registerCommand("polcharge", {
Loc[Config.Lan].command["charge"], {}, false, locale("command", "charge"), {}, false,
function(source) function(source)
TriggerClientEvent(getScript()..":client:PolCharge", source) TriggerClientEvent(getScript()..":client:PolCharge", source)
end end
@@ -31,12 +31,12 @@ RegisterServerEvent(getScript()..":server:PolCharge", function(citizen, price)
amountChange = (price - commission) amountChange = (price - commission)
}) })
triggerNotify(nil, billed.firstname..Loc[Config.Lan].success["charged"]..(price - commission), "success", src) triggerNotify(nil, billed.firstname..locale("success", "charged")..(price - commission), "success", src)
triggerNotify(nil, Loc[Config.Lan].success["you_charged"]..(price - commission), nil, billed.source) triggerNotify(nil, locale("success", "you_charged")..(price - commission), nil, billed.source)
else else
TriggerClientEvent(getScript()..":client:PolPopup", billed.source, price, src, biller.job, commPercent) TriggerClientEvent(getScript()..":client:PolPopup", billed.source, price, src, biller.job, commPercent)
end end
else triggerNotify(nil, Loc[Config.Lan].error["charge_zero"], 'error', source) return end else triggerNotify(nil, locale("error", "charge_zero"), 'error', source) return end
end) end)
RegisterServerEvent(getScript()..":server:PolPopup", function(data) RegisterServerEvent(getScript()..":server:PolPopup", function(data)
@@ -55,8 +55,8 @@ RegisterServerEvent(getScript()..":server:PolPopup", function(data)
amountChange = (price - commission) amountChange = (price - commission)
}) })
elseif not data.accept then elseif not data.accept then
triggerNotify(nil, Loc[Config.Lan].error["declined_payment"], nil, src) triggerNotify(nil, locale("error", "declined_payment"), nil, src)
triggerNotify(nil, billed.PlayerData.charinfo.firstname.." declined the $"..data.amount..Loc[Config.Lan].success["charge_end"], "error", data.biller) triggerNotify(nil, billed.PlayerData.charinfo.firstname.." declined the $"..data.amount..locale("success", "charge_end"), "error", data.biller)
end end
end) end)

View File

@@ -1,120 +1,120 @@
RegisterServerEvent(getScript()..":Tickets:Give", function(data, biller, gang) RegisterServerEvent(getScript()..":Tickets:Give", function(data, biller, gang)
local src = source local src = source
local activePlayers = GetPlayers() local activePlayers = GetPlayers()
local commPercent = 0 local commPercent = 0
jsonPrint(data) jsonPrint(data)
if Config.Receipts.Jobs[data.society] then if Config.Receipts.Jobs[data.society] then
commPercent = Config.Receipts.Jobs[data.society].Commission commPercent = Config.Receipts.Jobs[data.society].Commission
else commPercent = 0.25 else commPercent = 0.25
print("^1Error^7: ^2Can't find job in ^7'^3Config^7.^3Receipts^7.^3Jobs^7', ^2defaulting to 0.25 (25% commission)^7") print("^1Error^7: ^2Can't find job in ^7'^3Config^7.^3Receipts^7.^3Jobs^7', ^2defaulting to 0.25 (25% commission)^7")
end end
local takecomm = math.floor(data.amount * commPercent) local takecomm = math.floor(data.amount * commPercent)
if biller ~= nil then -- If this is found, it ISN'T a phone payment, so add money to society here if biller ~= nil then -- If this is found, it ISN'T a phone payment, so add money to society here
local amountChange, newAmount = (data.amount - takecomm), 0 local amountChange, newAmount = (data.amount - takecomm), 0
local society = gang and tostring(biller.gang) or tostring(biller.job) local society = gang and tostring(biller.gang) or tostring(biller.job)
local bankScript = nil local bankScript = nil
if isStarted("Renewed-Banking") then if isStarted("Renewed-Banking") then
bankScript = "Renewed-Banking" bankScript = "Renewed-Banking"
exports["Renewed-Banking"]:addAccountMoney(society, amountChange) exports["Renewed-Banking"]:addAccountMoney(society, amountChange)
newAmount = exports["Renewed-Banking"]:getAccountMoney(society) newAmount = exports["Renewed-Banking"]:getAccountMoney(society)
elseif isStarted("qb-banking") then elseif isStarted("qb-banking") then
bankScript = "qb-banking" bankScript = "qb-banking"
exports["qb-banking"]:AddMoney(society, amountChange, "Cash Register Payment") exports["qb-banking"]:AddMoney(society, amountChange, "Cash Register Payment")
newAmount = exports["qb-banking"]:GetAccountBalance(society) newAmount = exports["qb-banking"]:GetAccountBalance(society)
elseif isStarted("fd_banking") then elseif isStarted("fd_banking") then
bankScript = "fd_banking" bankScript = "fd_banking"
if gang then if gang then
exports["fd_banking"]:AddGangMoney(society, amountChange) exports["fd_banking"]:AddGangMoney(society, amountChange)
newAmount = exports["fd_banking"]:GetGangAccount(society) newAmount = exports["fd_banking"]:GetGangAccount(society)
else else
exports["fd_banking"]:AddMoney(society, amountChange) exports["fd_banking"]:AddMoney(society, amountChange)
newAmount = exports["fd_banking"]:GetAccount(society) newAmount = exports["fd_banking"]:GetAccount(society)
end end
elseif isStarted("okokBanking") then elseif isStarted("okokBanking") then
bankScript = "okokBanking" bankScript = "okokBanking"
exports['okokBanking']:AddMoney(society, amountChange) exports['okokBanking']:AddMoney(society, amountChange)
newAmount = exports['okokBanking']:GetAccount(society) newAmount = exports['okokBanking']:GetAccount(society)
end end
debugPrint("^5Debug^7: ^3"..bankScript.."^7(^3"..(gang and "Gang" or "Job").."^7): ^2Adding ^7$"..amountChange.." ^2to account ^7'^6"..society.."^7' ($"..newAmount..")") debugPrint("^5Debug^7: ^3"..bankScript.."^7(^3"..(gang and "Gang" or "Job").."^7): ^2Adding ^7$"..amountChange.." ^2to account ^7'^6"..society.."^7' ($"..newAmount..")")
elseif not biller then --Find the biller from their citizenid elseif not biller then --Find the biller from their citizenid
for _, v in pairs(activePlayers) do for _, v in pairs(activePlayers) do
local Player = getPlayer(v) local Player = getPlayer(v)
if Player.citizenid == data.senderCitizenId then if Player.citizenid == data.senderCitizenId then
biller = Player biller = Player
end end
end end
triggerNotify(nil, data.sender..Loc[Config.Lan].success["invoice_start"]..data.amount..Loc[Config.Lan].success["invoice_end"], "success", biller.source) triggerNotify(nil, data.sender..locale("success", "invoice_start")..data.amount..locale("success", "invoice_end"), "success", biller.source)
end end
-- If ticket system enabled, do this -- If ticket system enabled, do this
if (biller.onDuty or gang) and Config.Receipts.TicketSystem then if (biller.onDuty or gang) and Config.Receipts.TicketSystem then
if data.amount >= Config.Receipts.Jobs[data.society].MinAmountforTicket then if data.amount >= Config.Receipts.Jobs[data.society].MinAmountforTicket then
if Config.Receipts.TicketSystemAll then if Config.Receipts.TicketSystemAll then
for _, v in pairs(activePlayers) do for _, v in pairs(activePlayers) do
local Player = getPlayer(v) local Player = getPlayer(v)
if v ~= src then if v ~= src then
if gang then if gang then
if Player.gang == data.society then if Player.gang == data.society then
addItem("payticket", 1, nil, Player.source) addItem("payticket", 1, nil, Player.source)
triggerNotify(nil, Loc[Config.Lan].success["rec_rec"], 'success', Player.source) triggerNotify(nil, locale("success", "rec_rec"), 'success', Player.source)
end end
else else
print("player found") print("player found")
if Player.job == data.society and Player.onDuty then if Player.job == data.society and Player.onDuty then
print("player on duty, giving tickets") print("player on duty, giving tickets")
addItem("payticket", 1, nil, Player.source) addItem("payticket", 1, nil, Player.source)
triggerNotify(nil, Loc[Config.Lan].success["rec_rec"], 'success', Player.source) triggerNotify(nil, locale("success", "rec_rec"), 'success', Player.source)
end end
end end
end end
end end
else else
addItem("payticket", 1, nil, biller.source) addItem("payticket", 1, nil, biller.source)
triggerNotify(nil, Loc[Config.Lan].success["rec_rec"], 'success', biller.source) triggerNotify(nil, locale("success", "rec_rec"), 'success', biller.source)
end end
end end
end end
-- Commission section, does each config option separately -- Commission section, does each config option separately
local comm = tonumber(Config.Receipts.Jobs[data.society].Commission) local comm = tonumber(Config.Receipts.Jobs[data.society].Commission)
if Config.Receipts.Commission and comm ~= 0 then if Config.Receipts.Commission and comm ~= 0 then
if Config.Receipts.CommissionLimit and data.amount < Config.Receipts.Jobs[data.society].MinAmountforTicket then return end if Config.Receipts.CommissionLimit and data.amount < Config.Receipts.Jobs[data.society].MinAmountforTicket then return end
if Config.Receipts.CommissionDouble then if Config.Receipts.CommissionDouble then
fundPlayer(math.floor(tonumber(data.amount) * (comm *2)), "bank", biller.source) fundPlayer(math.floor(tonumber(data.amount) * (comm *2)), "bank", biller.source)
triggerNotify(nil, Loc[Config.Lan].success["recieved"]..math.floor(tonumber(data.amount) * (comm *2))..Loc[Config.Lan].success["commission"], "success", biller.source) triggerNotify(nil, locale("success", "recieved")..math.floor(tonumber(data.amount) * (comm *2))..locale("success", "commission"), "success", biller.source)
else else
fundPlayer(math.floor(tonumber(data.amount) *comm), "bank", biller.source) fundPlayer(math.floor(tonumber(data.amount) *comm), "bank", biller.source)
triggerNotify(nil, Loc[Config.Lan].success["recieved"]..math.floor(tonumber(data.amount) * comm)..Loc[Config.Lan].success["commission"], "success", biller.source) triggerNotify(nil, locale("success", "recieved")..math.floor(tonumber(data.amount) * comm)..locale("success", "commission"), "success", biller.source)
end end
if Config.Receipts.CommissionAll then if Config.Receipts.CommissionAll then
for _, v in pairs(activePlayers) do for _, v in pairs(activePlayers) do
local Player = getPlayer(v) local Player = getPlayer(v)
if v ~= biller.source then if v ~= biller.source then
if Player.job == data.society and Player.onDuty then if Player.job == data.society and Player.onDuty then
fundPlayer(math.floor(tonumber(data.amount) * comm), "bank", Player.source) fundPlayer(math.floor(tonumber(data.amount) * comm), "bank", Player.source)
triggerNotify(nil, Loc[Config.Lan].success["recieved"]..math.floor(tonumber(data.amount) * comm)..Loc[Config.Lan].success["commission"], "success", Player.source) triggerNotify(nil, locale("success", "recieved")..math.floor(tonumber(data.amount) * comm)..locale("success", "commission"), "success", Player.source)
end end
end end
end end
end end
end end
end) end)
RegisterServerEvent(getScript()..":Tickets:Sell", function() local src = source RegisterServerEvent(getScript()..":Tickets:Sell", function() local src = source
local Player = getPlayer(src) local Player = getPlayer(src)
local hasItem, hasTable = hasItem("payticket", 1, src) local hasItem, hasTable = hasItem("payticket", 1, src)
if not hasItem then if not hasItem then
triggerNotify(nil, Loc[Config.Lan].error["no_ticket_to"], 'error', src) triggerNotify(nil, locale("error", "no_ticket_to"), 'error', src)
return return
else else
local tickets = hasTable["payticket"].count local tickets = hasTable["payticket"].count
removeItem("payticket", tickets, src) removeItem("payticket", tickets, src)
local pay = (tickets * Config.Receipts.Jobs[Player.job].PayPerTicket) local pay = (tickets * Config.Receipts.Jobs[Player.job].PayPerTicket)
fundPlayer(pay, "bank", src) fundPlayer(pay, "bank", src)
triggerNotify(nil, Loc[Config.Lan].success["trade_ticket_start"]..tickets..Loc[Config.Lan].success["trade_ticket_end"]..cv(pay), 'success', src) triggerNotify(nil, locale("success", "trade_ticket_start")..tickets..locale("success", "trade_ticket_end")..cv(pay), 'success', src)
end end
end) end)