71 Commits
v2.8.7 ... main

Author SHA1 Message Date
Jim Shield
d05d8626c4 Update locale function 2025-10-29 03:04:02 +00:00
Jim Shield
35c95f500d Merge pull request #49 from Dude495/patch-2 2025-10-22 16:38:26 +01:00
Jim Shield
0da4cfb191 Merge pull request #48 from Dude495/patch-1 2025-10-22 16:37:33 +01:00
Dude495
f723d6f444 Update charge.lua
fixed spacing
2025-10-17 17:59:10 -05:00
Dude495
26cf5f4cc9 Update charge.lua
updated function spawnCustomRegisters() to include custom images from Config.CustomCashRegisters
2025-10-17 17:45:40 -05:00
Dude495
f90161b82d Update config.lua
added img field to CustomCashRegisters to fix broken image display when using them
2025-10-17 17:42:26 -05:00
Jim Shield
c6ef0897fc Release Notifier Push 2025-09-24 18:18:57 +01:00
Jim Shield
afe79273d5 Update notify-discord.yml 2025-09-04 17:00:39 +01:00
Jim Shield
bc694fa850 Create release.yml
Automate release zips and make them generate the folder name correctly

This helps users download a correctly named script so they dont end up with a script with a version number in the title
2025-09-01 10:23:35 +01:00
Jim Shield
8cf3257da9 Set Usebzzz to false in default config
Left this on when testing, sorry :(
2025-07-28 12:40:53 +01:00
Jim Shield
4e80be9b30 Update notify-discord.yml 2025-07-27 18:48:55 +01:00
Jim Shield
c657beb323 Update README.md 2025-07-24 22:52:34 +01:00
Jim Shield
be43ade5fb Version Bump
`3.0.04` - `3.0.05`
2025-06-10 00:43:45 +01:00
Jim Shield
5a3556ad2c swap phone charging to jim_bridge function 2025-06-08 22:38:07 +01:00
Jim Shield
597e8d9336 Add new feature "lookAtCharge"
New feature added, and set to default

Allows for simply looking at a player to get their server id and start charging them instead of creating a list or asking their user id.
2025-06-08 22:37:46 +01:00
Jim Shield
874eee530c add extra check for if playerdata exists or not 2025-06-03 02:22:25 +01:00
Jim Shield
ee11d79fa6 Version Bump
`3.0.03` - `3.0.04`
2025-06-01 21:48:25 +01:00
Jim Shield
784d13914f Separate and fix ped loading for tickets/banks
I unified the bank locations and ticket cash in locations and forgot that people disable the banking part of the script

Now, if Banks and `CashInAnywhere` is disabled, it creates a separate ped for tickets only (default location is pacific bank)

If Banks are enabled, but `CashInAnywhere` is disabled, it creates the separate ped also

If Banks are enabled AND `CashInAnywhere` is enabled, the separate ped won't be used and the bank peds will share the target options
2025-06-01 21:44:29 +01:00
Jim Shield
10f14f846e Fix typo for Gabz default cash in location 2025-06-01 21:38:56 +01:00
Jim Shield
1ca2e45a37 add workaround for if onlineList is nil 2025-05-26 18:59:10 +01:00
Jim Shield
2e3fef8846 fix job/gang lock of custom cash registers 2025-05-26 18:58:17 +01:00
Jim Shield
1b69b44f5c fix custom cash registers spawn offset location 2025-05-26 18:51:18 +01:00
Jim Shield
d252ce6a02 Version Bump
`3.0.02` - `3.0.03`
2025-05-21 11:00:23 +01:00
Jim Shield
4bc2aaa95f Re-add terminal item and info 2025-05-21 10:59:07 +01:00
Jim Shield
fdf92fde64 fix custom cash register function 2025-05-21 10:49:14 +01:00
Jim Shield
954b208016 add if statement to prop removal, just incase 2025-05-19 15:20:26 +01:00
Jim Shield
51265681c1 Update README.md 2025-05-19 15:16:53 +01:00
Jim Shield
6ab839e2a3 Unify cashregister and terminal commands
This makes `/cashregister` and `/terminal` the same, since they were already.

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

`/terminal` originally was added to make use of the `bzzz_terminal` prop and anim, but now it works with both commands if enabled in the config
2025-05-19 15:04:28 +01:00
Jim Shield
9eb2e987d4 Version Bump
`3.0.01` - `3.0.02`
2025-05-14 20:25:05 +01:00
Jim Shield
e73520a10c Tidy up the double check for commPercent
Left in the old code for commission calculation

I don't think it was making a difference but it wasn't needed
2025-05-14 20:24:47 +01:00
Jim Shield
f869c682c1 fix missing variable for polcharge
Fixes missing variable when using /polcharge and the confirmation option
2025-05-14 20:23:41 +01:00
Jim Shield
ca625c50e2 fix duplicate text entry for charging users
Apparently missed this completely, removed the duplicate text entry when not using the list option

this should fix any issues with this
2025-05-14 20:23:03 +01:00
Jim Shield
49f4d404e3 place start functions behind onResourceStart()
ESX helper
2025-05-12 22:49:28 +01:00
Jim Shield
2b92f749b5 Refactor a couple files for readability 2025-05-12 10:49:00 +01:00
Jim Shield
5e80192cef Update fxmanifest.lua to new format
Removes core loading in `fxmanifest.lua` in favour of more "verbose" file loader in jim_bridge v`2.0.08+`
2025-05-10 20:08:03 +01:00
Jim Shield
2eff1996c2 Version bump
`3.0` - `3.0.01`
2025-05-07 23:33:10 +01:00
Jim Shield
29b3b2ffb9 Hopefully fix the error when charging
I think if you had alot of players, it would overload itself and slip in a nil value when checking for player info

This checks if it is a real source number being sent and also adds a slightly delay to help load easier
2025-05-07 15:58:03 +01:00
Jim Shield
5cc7b60a1f fix discord bot yml 2025-05-01 13:37:46 +01:00
Jim Shield
41e146e35a add gitbot yml 2025-05-01 00:19:37 +01:00
Jim Shield
70fefa2a74 Merge pull request #47 from jimathy/v3.0 2025-04-28 18:20:00 +01:00
Jim Shield
f2b82e0b8c Create FUNDING.yml 2025-04-13 13:23:37 +01:00
Jim Shield
cbc202f101 Create FUNDING.yml + delay loading 2025-04-13 13:14:20 +01:00
Jim Shield
ecebdc801e adjust what can and cant be done on other frameworks for now 2025-03-08 21:05:07 +00:00
Jim Shield
10f477982d make use of jim_bridge new banking functions 2025-03-07 13:36:24 +00:00
Jim Shield
62e8242d9e (Beta) Fixes for multiframework features 2025-03-01 12:57:11 +00:00
Jim Shield
ef6b664890 Add files via upload 2025-02-22 13:23:43 +00:00
Jim Shield
2ebfeff554 Update 3.0 beta 2025-02-21 13:54:49 +00:00
Jim Shield
38f360fc26 Check for job commission info 2024-01-28 12:29:14 +00:00
Jim Shield
a21ea9f1db Add /polcharge support 2024-01-28 12:27:47 +00:00
Jim Shield
0905c7489c v3.0 Beta Push 2024-01-27 21:57:05 +00:00
Jim Shield
84a7f0611e Fix notification error in client.lua 2024-01-17 17:19:10 +00:00
Jim Shield
7b275735f6 Merge pull request #43 from County-Line-Roleplay-server/main 2024-01-10 02:00:16 +00:00
Chris McWilliams
00698be6c0 Update atmserver.lua
Corrected a SQL Duplication for account_name column on insertion into DB. Instead of Savings for account_name Savings_CitizenID will be used this is fully tested.
2024-01-09 20:57:23 -05:00
Jim Shield
e27f5eef3a Merge pull request #42 from RazerGhost/main 2024-01-10 00:50:35 +00:00
RazerGhost
0a953bc5db Added missing comma 2024-01-10 01:42:26 +01:00
Jim Shield
01f9d1a255 Merge pull request #41 from County-Line-Roleplay-server/main
Corrects Error QB-Banking
2024-01-09 23:58:26 +00:00
Jim Shield
0656afd7f1 Merge pull request #40 from taylorrenee1/main
added ox lib compat to input - may have ended up breaking some things sorry jim :^)
2024-01-09 23:58:10 +00:00
Jim Shield
813c25ad93 Merge pull request #37 from MystrGee/main
Add okokBanking support
2024-01-09 23:57:57 +00:00
Chris McWilliams
278c72193e Update client.lua 2024-01-07 02:40:56 -05:00
Chris McWilliams
ae738606d2 Update atms.lua 2024-01-07 02:39:42 -05:00
Chris McWilliams
f973050dfd Update server.lua 2024-01-07 02:38:59 -05:00
Chris McWilliams
53a65bd4a3 Update atmserver.lua 2024-01-07 02:37:55 -05:00
taylorrenee1
d8ab207dc7 Update client.lua 2024-01-06 22:14:08 -08:00
taylorrenee1
e1870b92b9 Update fxmanifest.lua 2024-01-06 21:36:38 -08:00
taylorrenee1
4a28bea810 Update config.lua 2024-01-06 21:36:23 -08:00
taylorrenee1
72ecfea64b Update client.lua 2024-01-06 21:36:09 -08:00
taylorrenee1
1b3878596e Update client.lua 2024-01-06 21:28:23 -08:00
Gaines
4ce9a753aa readme update 2023-12-23 02:51:42 -08:00
Gaines
79c357aa65 Revert config options to default 2023-12-23 02:47:42 -08:00
Gaines
0acfc606b7 add okokBanking support
Added support for okokBanking
2023-12-23 02:45:35 -08:00
Jim Shield
ac309a6a07 Merge pull request #36 from McKlean/main
v2.8.7 - QB-Banking support
2023-12-20 01:35:08 +00:00
26 changed files with 2514 additions and 1881 deletions

12
.gitattributes vendored Normal file
View File

@@ -0,0 +1,12 @@
# VCS / CI noise
.gitattributes export-ignore
.gitignore export-ignore
.github/** export-ignore
.gitmodules export-ignore
# Dev tooling/config
.vscode/** export-ignore
*.code-workspace export-ignore
.editorconfig export-ignore
.eslintrc* export-ignore
.prettier* export-ignore

12
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1,12 @@
# These are supported funding model platforms
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: jixelpatterns
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: ['https://jimathy666.tebex.io/']

18
.github/workflows/notify-discord.yml vendored Normal file
View File

@@ -0,0 +1,18 @@
name: Discord Commit Notifier
on:
push:
branches:
- '*'
jobs:
notify:
runs-on: ubuntu-latest
steps:
- name: Send commit payload to Discord Bot
env:
URL: http://${{ secrets.DISCORDBOT }}:3000/github-commits
run: |
curl -sS -X POST "$URL" \
-H 'Content-Type: application/json' \
--data-binary "@$GITHUB_EVENT_PATH"

71
.github/workflows/notify-release.yml vendored Normal file
View File

@@ -0,0 +1,71 @@
name: Discord Release Notifier
on:
# Manual or UI-published releases
release:
types: [published]
# Releases created by your tag-driven workflow
workflow_run:
workflows: ["Package & Release"] # must match the 'name:' in release.yml
types: [completed]
permissions:
contents: read
jobs:
# 1) Handle manual / UI / non-workflow-created releases
notify-from-release:
if: github.event_name == 'release' && github.event.action == 'published'
runs-on: ubuntu-latest
steps:
- name: Send release payload to Discord Bot
env:
URL: http://${{ secrets.DISCORDBOT }}:3000/github-releases
run: |
curl -sS -X POST "$URL" \
-H 'Content-Type: application/json' \
--data-binary "@$GITHUB_EVENT_PATH"
# 2) Handle releases created by your 'Package & Release' workflow
# (which wont trigger `on: release` when using GITHUB_TOKEN)
notify-from-workflow-run:
if: >
github.event_name == 'workflow_run' &&
github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
steps:
- name: Install jq
run: sudo apt-get update && sudo apt-get install -y jq
- name: Fetch release JSON by tag
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail
OWNER="${GITHUB_REPOSITORY%/*}"
REPO="${GITHUB_REPOSITORY#*/}"
TAG="${{ github.event.workflow_run.head_branch }}"
# head_branch is the tag name for a tag push workflow_run
curl -fsSL -H "Authorization: Bearer $GH_TOKEN" \
-H "Accept: application/vnd.github+json" \
"https://api.github.com/repos/$OWNER/$REPO/releases/tags/$TAG" \
> release.json
- name: Wrap as 'release' event payload & notify bot
env:
URL: http://${{ secrets.DISCORDBOT }}:3000/github-releases
run: |
set -euo pipefail
jq -n --slurpfile rel release.json \
--arg repo "$GITHUB_REPOSITORY" \
--arg repo_url "https://github.com/$GITHUB_REPOSITORY" \
--arg action "published" '
{ action: $action,
repository: { full_name: $repo, html_url: $repo_url },
release: $rel[0],
sender: { login: "github-actions[bot]" } }' > payload.json
curl -sS -X POST "$URL" \
-H 'Content-Type: application/json' \
--data-binary "@payload.json"

88
.github/workflows/release.yml vendored Normal file
View File

@@ -0,0 +1,88 @@
name: Package & Release
on:
push:
tags:
- "v*"
- "*.*.*"
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout (full history)
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Derive vars
id: vars
shell: bash
run: |
echo "name=${GITHUB_REPOSITORY##*/}" >> $GITHUB_OUTPUT # e.g. jim_bridge
echo "version=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT # strip leading v
- name: Build zip with folder prefix
shell: bash
run: |
NAME='${{ steps.vars.outputs.name }}'
VER='${{ steps.vars.outputs.version }}'
git archive --format=zip --prefix="${NAME}/" -o "${NAME}-${VER}.zip" "$GITHUB_REF_NAME"
ls -lh "${NAME}-${VER}.zip"
# --- Patch notes generation (commit titles + links) -------------------
- name: Find previous tag (SemVer aware)
id: prev
shell: bash
run: |
CUR="${GITHUB_REF_NAME}"
# Sort tags by version desc, drop the current, take the next newest
PREV=$(git tag --sort=-v:refname | grep -v -x "$CUR" | head -n 1 || true)
echo "prev=$PREV" >> $GITHUB_OUTPUT
echo "Previous tag: ${PREV:-<none>}"
- name: Generate RELEASE_NOTES.md from commits
shell: bash
run: |
REPO="${{ github.repository }}"
CUR="${GITHUB_REF_NAME}"
PREV='${{ steps.prev.outputs.prev }}'
if [ -n "$PREV" ]; then
RANGE="$PREV..$CUR"
HEADER="## Changes in $CUR"
else
# First release: include all commits
ROOT=$(git rev-list --max-parents=0 HEAD | tail -n 1)
RANGE="$ROOT..$CUR"
HEADER="## Changes"
fi
{
echo "$HEADER"
echo
# Oldest → newest, subject only, skip merge commits
# Escape '[' and ']' so markdown doesn't break on rare titles
git log --reverse --no-merges --pretty=format:'- ['%h'] - %s' "$RANGE" \
| perl -pe 's/([\[\]])/\\$1/g'
} > RELEASE_NOTES.md
echo "--- RELEASE_NOTES.md ---"
cat RELEASE_NOTES.md
echo "------------------------"
- name: Create / Update GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
name: ${{ github.ref_name }}
files: |
*.zip
body_path: RELEASE_NOTES.md # attach our generated notes
# If you wanted GitHub's auto notes instead, set:
# generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

240
README.md
View File

@@ -1,212 +1,28 @@
# jim-payments # jim-payments
- QBCore based payment system
- Enchanced QB-Input payment system from my other scripts now free on its own ## FiveM MuliFramework based payment system
### If you need support I have a discord server available, it helps me keep track of issues and give better support. - Highly customisable via config.lua
## https://discord.gg/xKgQZ6wZvS - Locations are easily changeable/removable
### We also have Documentation over on Gitbook, feel free to check it out - Features:
## https://jixelpatterns.gitbook.io/jixelpatterns-script-guide/overview/who-we-are - Payment Tickets for successful payments over a specific amount player can cash in for extra bonus
- ATM's become usable, with options to show them on your map when nearby
### If you think I did a good job here, consider donating as it keeps by lights on and my cat fat/floofy: - Adds Ped bank targets where players can manage their bank account balances
## https://ko-fi.com/jixelpatterns - Supports police charges
- Supports
--- - QB-Core
- ESX
- If you use a different phone/invoice system let me know and I will add support for it as best I can! - QBOX
- Currently supported are: - OX_Core
- qb-phone
- gks-phone ---
- qs-smartphone - Leave the setting as "qb"
# Installation and Usage:
--- ## [JixelPatterns GitBook Documentation](https://jixelpatterns.gitbook.io/docs)
# Installation
--- ### If you need support I have a discord server available, it helps me keep track of issues and give better support.
- I always recommend starting my scripts AFTER `[qb]` not inside it as it can mess with any dependancies on server load ## [JixelPatterns Discord](https://discord.gg/9pCDHmjYwd)
- 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 ### If you think I did a good job here, consider donating as it keeps by lights on and my cat round:
- Example of my load order: ## [JixelPatterns Kofi](https://ko-fi.com/jixelpatterns)
```CSS
# QBCore & Extra stuff
ensure qb-core
ensure [qb]
ensure [standalone]
ensure [voice]
ensure [defaultmaps]
ensure [vehicles]
#Extra Jim Stuff
ensure [jim]
```
---
## BZZ Terminal Instructions
Free Package https://bzzz.tebex.io/package/5551076
Stream the prop and add the emote that is provided to rpemotes or dpemotes
```lua
['terminal'] = {['name'] = 'terminal', ['label'] = 'Wireless Terminal', ['weight'] = 5000, ["type"] = "item", ["image"] = 'terminal.png', ['unique'] = true, ['useable'] = true, ["shouldClose"] = true, ["combinable"] = nil, ['description'] = ''},
```
---
## Item installation
- To make use of the ticket reward system for workers you need to add the ticket item to your shared items lua
- Naviage to `[qb] > qb-core / shared / items.lua` and add this line
```lua
["payticket"] = {["name"] = "payticket", ["label"] = "Receipt", ["weight"] = 150, ["type"] = "item", ["image"] = "ticket.png", ["unique"] = false, ["useable"] = false, ["shouldClose"] = false, ["combinable"] = nil, ["description"] = "Cash these in at the bank!"},
```
- Add the ticket image to your inventory script:
- Naviage to `[qb] > qb-inventory > html > images` and add this line
![](https://github.com/jimathy/jim-payments/blob/main/images/ticket.png?raw=true)
---
## Phone Setup
- 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.
- 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.
#### QB-Phone:
- Go to `[qb] > qb-phone > client > main.lua`
- Search for the event `RegisterNUICallback('PayInvoice', function(data, cb)` and look for the line:
```lua
TriggerServerEvent('qb-phone:server:BillingEmail', data, true)
```
- Directly *above* this line add:
```lua
TriggerServerEvent('jim-payments:Tickets:Give', data)
```
- The phone should now be integrated with jim-payments
#### GKS-Phone:
- Go to `gks-phone > server > serverapi.lua`
- Search for the event: `gksphone:faturapayBill` and search for this line:
```lua
Ply.Functions.RemoveMoney('bank', data[1].amount, "paid-invoice")
```
- Directly under this line add this event:
```lua
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
#### Renewed QB-Phone:
- Go to `qb-phone > server > invoices.lua`
- Search for the event: `qb-phone:server:PayMyInvoice` and search for this line:
```lua
TriggerEvent("qb-phone:server:InvoiceHandler", true, amount, src, resource)
```
- Directly under this line add this event:
```lua
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
# Setup/Config
## Custom Locations
- 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
- For example:
```lua
CustomCashRegisters = { -- Located in the config.lua
["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(-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
---
## PayTickets
![](https://i.imgur.com/ICbQyeQ.jpeg)
- This script has a built in ticket reward system
- 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
- Works as a reward and incentive for turning up to do work
- The values are set per job in `Config.Jobs`
- `TicketSystem` Enable this if you want to use the ticket system false
- `TicketSystemAll` Enable this to give tickets to all workers clocked in
---
## Commission System
- Support for commission to be paid as a reward for each successful payment
- Very customisable with the config.lua
- `Commission` Choose wether people get commission from every sale
- `CommissionAll` Choose if **EVERY** worker gets Commission that is on duty
- `CommissionDouble` Choose if Commission is limited by `MinAmountForTicket`
- `CommissionLimit` Choose if the worker charging the customer gets double commission
---
## Multiple Job and Gang Role support
- 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
- Examples of adding jobs / gangs to config.lua:
```lua
Jobs = {
['mechanic'] = { MinAmountforTicket = 1000, PayPerTicket = 500, Commission = 0.10, },
['lostmc'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, gang = true, },
},
```
- `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
- 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%)
- `gang = true` add this if the added role is a gang role
---
## /cashgive
![](https://i.imgur.com/AIdXzxX.jpeg)
- Alternative to /givecash
- 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
- Better experience than trying to figure out their ID and entering it manually
---
## /cashregister
![](https://i.imgur.com/37d2mE3.jpeg)
- This command is mean't as a portable cash register alternative
- For example:
- 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
---
## /polcharge
- This script supports a customisable "police billing"
- 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
- This is by default enabled for `police` and `ambulance`
- This also supports giving the player a cut of the payment as `commission`
- Default Config:
```lua
FineJobs = {
['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
```
---
## Banking
![](https://i.imgur.com/RYADcI2.jpeg)
- This script has simple banking systems built in
- Works as a basic replacement for qb-banking and qb-atms
- Adjust the options in config.lua:
- `useATM` Choose wether to make atm's usable
- `useBanks` Choose wether to make bank desks/teller's usable
- `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
- `Gabz` Enable to change to Gabz Bank locations, this corrects the ATM/Bank Cashier + Ticket Cash in
---
## Support for other scripts
### Renewed-Banking
- Support for renewed banking added
- Toggle `RenewedBanking` in the config.lua to enable this
### Renewed's qb-phone
- Simply leave the Config.PhoneType as `"qb"`
### AP-Goverment
- Support for AP-Goverment Tax on payments
- Toggle `ApGov` in the config.lua to enable this

View File

@@ -1,246 +1,171 @@
-- This script is a simple replacement for QB-Banking and QB-ATMs
-- It uses QB-Input and server callbacks to retreive info about accounts and cash
-- This requires QB-Target and has the location of every ATM, ATM prop and bank window
local Targets = {} local Targets = {}
local Peds = {}
local BankLoc = Config.VanBankLocations if Config.ATMs.enable then
local ATMLoc = Config.VanATMLocations onPlayerLoaded(function() -- Automatic detection of models and make targets and blips
Wait(2000)
while true do
local pedCoords = GetEntityCoords(PlayerPedId())
for _, v in pairs(GetGamePool('CObject')) do
for _, model in pairs(Config.ATMs.ATMModels) do
if GetEntityModel(v) == model then
local name, entCoords = getScript()..":ATMLocation:"..v, GetEntityCoords(v)
if #(pedCoords - entCoords) <= 150 then
if not Targets[name] then
Targets[name] =
createCircleTarget({name, vec3(entCoords.x, entCoords.y, entCoords.z+1.03), 0.5, { name=name, debugPoly = debugMode, useZ=true, },},
{ { action = function() lookEnt(v) TriggerEvent(getScript()..":Client:ATM") end,
icon = "fas fa-money-check-alt", label = locale("target", "atm"),
}, }, 1.5)
end
if Config.ATMs.showBlips then
if not DoesBlipExist(GetBlipFromEntity(v)) then
makeEntityBlip({entity = v, sprite = 434, col = 3, name = "ATM" })
end
end
else
removeZoneTarget(name)
Targets[name] = nil
if DoesBlipExist(GetBlipFromEntity(v)) then RemoveBlip(GetBlipFromEntity(v)) end
end
end
end
end
Wait(5000)
end
end, true)
end
local bossroles = {} RegisterNetEvent(getScript()..":Client:ATM", function() local setheader = nil
local gangroles = {}
CreateThread(function()
if Config.useATM then
if Config.ATMBlips then
for _, v in pairs(Config.WallATMLocations) do
makeBlip({coords = v, sprite = 108, col = 3, scale = 0.55, disp = 6, name = Loc[Config.Lan].blip["blip_atm"] })
end
for _, v in pairs(Config.ATMLocations) do
makeBlip({coords = v, sprite = 108, col = 3, scale = 0.55, disp = 6, name = Loc[Config.Lan].blip["blip_atm"] })
end
end
end
if Config.useBanks then
if Config.BankBlips then
for _, v in pairs(Config.BankLocations) do
for _, b in pairs(v) do
makeBlip({coords = b, sprite = 108, col = 2, scale = 0.55, disp = 6, name = Loc[Config.Lan].blip["blip_bank"] })
break
end
end
end
end
if Config.useATM or Config.useBanks then
for k in pairs(QBCore.Shared.Jobs) do ---Grabs the list of jobs
if QBCore.Shared.Jobs[tostring(k)] then
for l in pairs(QBCore.Shared.Jobs[tostring(k)].grades) do -- Grabs the list of grades
if QBCore.Shared.Jobs[tostring(k)].grades[l].isboss == true then -- Checks the grade if is boss
if bossroles[tostring(k)] then -- checks if the line exists
if bossroles[tostring(k)] > tonumber(l) then bossroles[tostring(k)] = tonumber(l) end -- the
else bossroles[tostring(k)] = tonumber(l)
end
end
end
end
end
for k in pairs(QBCore.Shared.Gangs) do
if QBCore.Shared.Gangs[tostring(k)] then
for l in pairs(QBCore.Shared.Gangs[tostring(k)].grades) do
if tostring(k) ~= "none" then
if QBCore.Shared.Gangs[tostring(k)].grades[l].isboss == true then
if gangroles[tostring(k)] then
if gangroles[tostring(k)] > tonumber(l) then gangroles[tostring(k)] = tonumber(l) end
else gangroles[tostring(k)] = tonumber(l)
end
end
end
end
end
end
end
if Config.useATM then
exports['qb-target']:AddTargetModel(Config.ATMModels, { options = { { event = "jim-payments:Client:ATM:use", icon = "fas fa-money-check-alt", label = Loc[Config.Lan].target["atm"], id = "atm" },}, distance = 1.5, })
for k,v in pairs(Config.WallATMLocations) do
Targets["jimwallatm"..k] =
exports['qb-target']:AddCircleZone("jimwallatm"..k, vector3(v.x, v.y, v.z+0.2), 0.5, { name="jimwallatm"..k, debugPoly=Config.Debug, useZ=true, },
{ options = { { event = "jim-payments:Client:ATM:use", icon = "fas fa-money-check-alt", label = Loc[Config.Lan].target["atm"], id = "atm" },
--{ event = "jim-payments:Client:ATM:use", icon = "fas fa-arrow-right-arrow-left", label = Loc[Config.Lan].target["transfer_money"], id = "transfer" },
}, distance = 1.5 })
end
for k,v in pairs(Config.ATMLocations) do
Targets["jimatm"..k] =
exports['qb-target']:AddCircleZone("jimatm"..k, vector3(v.x, v.y, v.z+0.2), 0.5, { name="jimatm"..k, debugPoly=Config.Debug, useZ=true, },
{ options = { { event = "jim-payments:Client:ATM:use", icon = "fas fa-money-check-alt", label = Loc[Config.Lan].target["atm"], id = "atm" },
--{ event = "jim-payments:Client:ATM:use", icon = "fas fa-arrow-right-arrow-left", label = Loc[Config.Lan].target["transfer_money"], id = "transfer" },
}, distance = 1.5 })
end
end
if Config.useBanks then
for k,v in pairs(Config.BankLocations) do
for l, b in pairs(v) do
Targets["jimbank"..k..l] =
exports['qb-target']:AddCircleZone("jimbank"..k..l, vector3(b.x, b.y, b.z+0.2), 2.0, { name="jimbank"..k..l, debugPoly=Config.Debug, useZ=true, },
{ options = { { event = "jim-payments:Client:ATM:use", icon = "fas fa-piggy-bank", label = Loc[Config.Lan].target["bank"], id = "bank" },
{ event = "jim-payments:Client:ATM:use", icon = "fas fa-arrow-right-arrow-left", label = Loc[Config.Lan].target["transfer"], id = "transfer" },
{ event = "jim-payments:Client:ATM:use", icon = "fas fa-money-check-dollar", label = Loc[Config.Lan].target["saving"], id = "savings" },
{ event = "jim-payments:Client:ATM:use", icon = "fas fa-building", label = Loc[Config.Lan].target["soc_saving"], id = "society", job = bossroles },
{ event = "jim-payments:Client:ATM:use", icon = "fas fa-arrow-right-arrow-left", label = Loc[Config.Lan].target["soc_trans"], id = "societytransfer", job = bossroles },
{ event = "jim-payments:Client:ATM:use", icon = "fas fa-building", label = Loc[Config.Lan].target["gang_acct"], id = "gang", gang = gangroles },
{ event = "jim-payments:Client:ATM:use", icon = "fas fa-arrow-right-arrow-left", label = Loc[Config.Lan].target["gang_trans"], id = "gangtransfer", gang = gangroles }, },
distance = 2.5 })
if Config.Peds then
local i = math.random(1, #Config.PedPool)
if not Config.Gabz then CreateModelHide(b.xyz, 1.0, `v_corp_bk_chair3`, true) end
if not Peds["jimbank"..k..l] then Peds["jimbank"..k..l] = makePed(Config.PedPool[i], b, false, false) end
end
end
end
end
end)
RegisterNetEvent('jim-payments:Client:ATM:use', function(data)
--this grabs all the info from names to savings account numbers in the databases --this grabs all the info from names to savings account numbers in the databases
local p = promise.new() local info = triggerCallback(getScript()..":GetInfo")
QBCore.Functions.TriggerCallback('jim-payments:ATM:Find', function(cb) p:resolve(cb) end) local info = Citizen.Await(p)
if Config.Banking == "qb" then
local p = promise.new()
QBCore.Functions.TriggerCallback('qb-bossmenu:server:GetAccount', function(cb) p:resolve(cb) end, PlayerJob.name) info.society = Citizen.Await(p)
local p2 = promise.new()
QBCore.Functions.TriggerCallback('qb-gangmenu:server:GetAccount', function(cb) p2:resolve(cb) end, PlayerGang.name) info.gsociety = Citizen.Await(p2)
end
local atmbartime = 2500
local bartext = ""
local setoptions = {}
if data.id == "atm" then playAnim("amb@prop_human_atm@male@enter", "enter", 2000, 1)
setoptions = { { value = "withdraw", text = Loc[Config.Lan].menu["withdraw"] }, }
setview = "<center><img src=https://static.wikia.nocookie.net/gtawiki/images/b/bd/Fleeca-GTAV-Logo.png width=200px></center><br>"..Loc[Config.Lan].menu["welcome"]..info.name..Loc[Config.Lan].menu["citizenid"]..info.cid..Loc[Config.Lan].menu["header_balance_bank"]..cv(info.bank)..Loc[Config.Lan].menu["cash_balance"]..cv(info.cash)..Loc[Config.Lan].menu["header_option"]
setheader = Loc[Config.Lan].menu["header_atm"]
setinputs = { { type = 'radio', name = 'billtype', text = setview, options = setoptions },
{ type = 'number', isRequired = true, name = 'amount', text = Loc[Config.Lan].menu["header_trans_amount"] }, }
for k, v in pairs(Config.ATMModels) do
if IsObjectNearPoint(v, GetEntityCoords(PlayerPedId()), 1.6) then
local obj = GetClosestObjectOfType(GetEntityCoords(PlayerPedId()), 1.6, v, false, false, false)
local atmCoords = GetEntityCoords(obj)
lookEnt(obj)
bartext = Loc[Config.Lan].menu["acc_atm"]
end
end
elseif data.id == "bank" then if progressBar({ label = locale("menu", "acc_atm"), time = 3000 }) then
setoptions = { { value = "withdraw", text = Loc[Config.Lan].menu["withdraw"] }, { value = "deposit", text = Loc[Config.Lan].menu["deposit"] } } local Menu = {}
setview = Loc[Config.Lan].menu["welcome"]..info.name..Loc[Config.Lan].menu["header_acc"]..info.account.."<br>"..info.cid..Loc[Config.Lan].menu["header_balance_bank"]..cv(info.bank)..Loc[Config.Lan].menu["cash_balance"]..cv(info.cash)..Loc[Config.Lan].menu["header_option"]
setheader = Loc[Config.Lan].menu["header_bank"]
setinputs = { { type = 'radio', name = 'billtype', text = setview, options = setoptions },
{ type = 'number', isRequired = true, name = 'amount', text = Loc[Config.Lan].menu["header_trans_amount"] }, }
bartext = Loc[Config.Lan].menu["acc_bank"]
elseif data.id == "transfer" then Menu[#Menu+1] = {
setoptions = { { value = "transfer", text = Loc[Config.Lan].menu["transfer"] } } isMenuHeader = true,
setview = Loc[Config.Lan].menu["welcome"]..info.name..Loc[Config.Lan].menu["header_acc"]..info.account.."<br>"..info.cid..Loc[Config.Lan].menu["header_balance_bank"]..cv(info.bank)..Loc[Config.Lan].menu["header_option"] header = locale("menu", "welcome")..info.name,
setheader = Loc[Config.Lan].menu["header_trans"] txt = info.cid,
setinputs = { { type = 'radio', name = 'billtype', text = setview, options = setoptions }, }
{ type = 'text', isRequired = true, name = 'account', text = Loc[Config.Lan].menu["header_account_no"] }, Menu[#Menu+1] = {
{ type = 'number', isRequired = true, name = 'amount', text = Loc[Config.Lan].menu["header_trans_amount"] }, } isMenuHeader = true,
header = locale("menu", "header_balance"),
txt = locale("menu", "bank_balance")..cv(info.bank)..br..locale("menu", "cash_balance")..cv(info.cash)
}
Menu[#Menu+1] = {
header = locale("menu", "withdraw"),
onSelect = function()
atmWithdrawl(info)
end,
}
local header = locale("menu", "header_atm")
if Config.System.Menu == "qb" then
header = "<center><img src="..Config.General.menuLogo.." width=200px></center>"
elseif Config.System.Menu == "ox" then
header = '!['..''.. ']('..Config.General.menuLogo..')'
end
openMenu(Menu, { header = header, canClose = true, onExit = function() playAnim("amb@prop_human_atm@male@exit", "exit", 3000, 1) end, })
else
triggerNotify(nil, locale("error", "cancel"), "error")
end
end)
bartext = Loc[Config.Lan].menu["acc_trans"] function atmWithdrawl(info)
local setimage = locale("menu", "header_atm")
if Config.System.Menu == "qb" then setimage = "<center><img src="..Config.General.menuLogo.." width=200px></center>"
elseif Config.System.Menu == "ox" then setimage = '!['..''.. ']('..Config.General.menuLogo..')'
end
local dialog = createInput(locale("menu", "header_atm"), {
{ type = 'radio',
name = 'billtype',
text = Config.System.Menu == "ox" and locale("menu", "bank_balance")..cv(info.bank)..locale("menu", "cash_balance")..cv(info.cash)
or
setimage..
locale("menu", "header_balance")..br..
locale("menu", "bank_balance")..cv(info.bank)..br..
locale("menu", "cash_balance")..cv(info.cash)..br..br..
locale("menu", "header_option"),
options = {
{ value = "withdraw", text = locale("menu", "withdraw") },
} },
{ type = 'number',
isRequired = true,
name = 'amount',
text = locale("menu", "header_trans_amount"),
min = 0,
max = info.bank,
},
})
if dialog then
if dialog[1] then
dialog.billtype = dialog[1]
dialog.amount = dialog[2] or 1
end
if not dialog.amount then return end
playAnim("amb@prop_human_atm@male@exit", "exit", 3000, 1)
Wait(1000)
TriggerServerEvent(getScript()..":server:ATM:use", dialog.amount, dialog.billtype, dialog.account, "atm", info.society, info.gsociety)
end
end
elseif data.id == "savings" then RegisterNetEvent(getScript()..":client:ATM:give", function()
setoptions = { { value = "withdraw", text = Loc[Config.Lan].menu["withdraw"] }, { value = "deposit", text = Loc[Config.Lan].menu["deposit"] } }
setview = Loc[Config.Lan].menu["welcome"]..info.name..Loc[Config.Lan].menu["header_info"]..info.aid.."<br>"..info.cid..Loc[Config.Lan].menu["saving_balance"]..cv(info.savbal)..Loc[Config.Lan].menu["bank_balance"]..cv(info.bank)..Loc[Config.Lan].menu["header_option"]
setheader = Loc[Config.Lan].menu["header_saving"]
setinputs = { { type = 'radio', name = 'billtype', text = setview, options = setoptions },
{ type = 'number', isRequired = true, name = 'amount', text = Loc[Config.Lan].menu["header_trans_amount"] }, }
bartext = Loc[Config.Lan].menu["acc_saving"]
elseif data.id == "society" then local newinputs = {} -- Begin qb-input creation here.
setoptions = { { value = "withdraw", text = Loc[Config.Lan].menu["withdraw"] }, { value = "deposit", text = Loc[Config.Lan].menu["deposit"] } } local nearbyList = {}
setview = Loc[Config.Lan].menu["welcome"]..info.name..Loc[Config.Lan].menu["header_soc"]..PlayerJob.label..Loc[Config.Lan].menu["header_balance"]..PlayerJob.label.." - $"..cv(info.society)..Loc[Config.Lan].menu["bank_balance"]..cv(info.bank) if Config.General.List then -- If nearby player list is wanted:
setheader = Loc[Config.Lan].menu["header_soc_bank"] --Retrieve a list of nearby players from server
setinputs = { { type = 'radio', name = 'billtype', text = setview, options = setoptions }, local onlineList = triggerCallback(getScript()..":MakePlayerList")
{ type = 'number', isRequired = true, name = 'amount', text = Loc[Config.Lan].menu["header_trans_amount"] }, } --Convert list of players nearby into one qb-input understands + add distance info
bartext = Loc[Config.Lan].menu["acc_boss"] local playerCoords = GetEntityCoords(PlayerPedId())
elseif data.id == "societytransfer" then
setoptions = { { value = "transfer", text = Loc[Config.Lan].menu["transfer"] } }
setview = Loc[Config.Lan].menu["welcome"]..info.name..Loc[Config.Lan].menu["header_soc"]..PlayerJob.label..Loc[Config.Lan].menu["header_balance"]..PlayerJob.label.." - $"..cv(info.society)..Loc[Config.Lan].menu["header_option"]
setheader = Loc[Config.Lan].menu["header_trans"]
setinputs = { { type = 'radio', name = 'billtype', text = setview, options = setoptions },
{ type = 'text', isRequired = true, name = 'account', text = Loc[Config.Lan].menu["header_account_no"] },
{ type = 'number', isRequired = true, name = 'amount', text = Loc[Config.Lan].menu["header_trans_amount"] }, }
bartext = Loc[Config.Lan].menu["acc_boss_trans"]
elseif data.id == "gang" then
setheader = Loc[Config.Lan].menu["header_soc_bank"]
setview = Loc[Config.Lan].menu["welcome"]..info.name..Loc[Config.Lan].menu["header_soc"]..PlayerGang.label..Loc[Config.Lan].menu["header_balance"]..PlayerGang.label.." - $"..cv(info.gsociety)..Loc[Config.Lan].menu["bank_balance"]..cv(info.bank)..Loc[Config.Lan].menu["header_option"]
setoptions = { { value = "withdraw", text = Loc[Config.Lan].menu["withdraw"] }, { value = "deposit", text = Loc[Config.Lan].menu["deposit"] } }
setinputs = { { type = 'radio', name = 'billtype', text = setview, options = setoptions },
{ type = 'number', isRequired = true, name = 'amount', text = Loc[Config.Lan].menu["header_trans_amount"] }, }
bartext = Loc[Config.Lan].menu["acc_gang"]
elseif data.id == "gangtransfer" then
setoptions = { { value = "transfer", text = Loc[Config.Lan].menu["transfer"] } }
setview = Loc[Config.Lan].menu["welcome"]..info.name..Loc[Config.Lan].menu["header_soc"]..PlayerGang.label..Loc[Config.Lan].menu["header_balance"]..PlayerGang.label.." - $"..cv(info.gsociety)..Loc[Config.Lan].menu["header_option"]
setheader = Loc[Config.Lan].menu["header_trans"]
setinputs = { { type = 'radio', name = 'billtype', text = setview, options = setoptions },
{ type = 'text', isRequired = true, name = 'account', text = Loc[Config.Lan].menu["header_account_no"] },
{ type = 'number', isRequired = true, name = 'amount', text = Loc[Config.Lan].menu["header_trans_amount"] }, }
bartext = Loc[Config.Lan].menu["acc_gang_trans"]
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 end
loadAnimDict('amb@prop_human_atm@male@enter') if Config.General.List then
TaskPlayAnim(PlayerPedId(), 'amb@prop_human_atm@male@enter', "enter", 1.0,-1.0, 1500, 1, 1, true, true, true) newinputs[#newinputs+1] = { type = "select", text = locale("menu" ,"cus_id"), name = "citizen", label = locale("menu" ,"cus_id"), default = 1, options = nearbyList }
unloadAnimDict('amb@prop_human_atm@male@enter') else
QBCore.Functions.Progressbar("accessing_atm", bartext, atmbartime, false, true, { disableMovement = false, disableCarMovement = false, disableMouse = false, disableCombat = false, }, {}, {}, {}, function() newinputs[#newinputs+1] = { type = 'text', isRequired = true, name = 'citizen', text = locale("menu" ,"cus_id") }
local dialog = exports['qb-input']:ShowInput({ header = setheader, txt = "test", submitText = Loc[Config.Lan].menu["transfer"], inputs = setinputs }) end
if dialog then newinputs[#newinputs+1] = {
if not dialog.amount then return end type = 'select',
loadAnimDict('amb@prop_human_atm@male@exit') name = 'billtype',
TaskPlayAnim(PlayerPedId(), 'amb@prop_human_atm@male@exit', "exit", 1.0,-1.0, 3000, 1, 1, true, true, true) text = locale("menu" ,"type"),
unloadAnimDict('amb@prop_human_atm@male@enter') default = billPrev,
Wait(1000) options = {
TriggerServerEvent('jim-payments:server:ATM:use', dialog.amount, dialog.billtype, dialog.account, data.id, info.society, info.gsociety) { value = "cash", text = locale("menu" ,"cash"), label = locale("menu" ,"cash") },
end }
end, function() triggerNotify(nil, Loc[Config.Lan].error["cancel"], "error") }
end, data.icon) newinputs[#newinputs+1] = { type = 'number', isRequired = true, name = 'price', text = locale("menu" ,"amount_charge") }
end)
RegisterNetEvent('jim-payments:client:ATM:give', function() local dialog = createInput(locale("menu", "give_cash"), newinputs)
local onlineList = {}
local nearbyList = {}
QBCore.Functions.TriggerCallback('jim-payments:MakePlayerList', function(cb) onlineList = cb if onlineList[1] == nil then Wait(200) end
for _, id in pairs(QBCore.Functions.GetPlayersFromCoords(GetEntityCoords(PlayerPedId()), Config.PaymentRadius)) do
local dist = #(GetEntityCoords(GetPlayerPed(id)) - GetEntityCoords(PlayerPedId()))
for i = 1, #onlineList do
if onlineList[i].value == GetPlayerServerId(id) then
if id ~= PlayerId() or Config.Debug then
nearbyList[#nearbyList+1] = { value = onlineList[i].value, text = onlineList[i].text..' ('..math.floor(dist+0.05)..'m)' }
end
end
end
dist = nil
end
if not nearbyList[1] then triggerNotify(nil, Loc[Config.Lan].error["no_one"], "error") return end
local dialog = exports['qb-input']:ShowInput({ header = Loc[Config.Lan].menu["give_cash"], submitText = Loc[Config.Lan].menu["give"],
inputs = {
{ text = " ", name = "citizen", type = "select", options = nearbyList },
{ type = 'number', isRequired = true, name = 'price', text = Loc[Config.Lan].menu["amount_pay"] }, }
})
if dialog then
if not dialog.citizen or not dialog.price then return end
TriggerServerEvent('jim-payments:server:ATM:give', dialog.citizen, dialog.price)
end
end)
end)
AddEventHandler('onResourceStop', function(r) if r ~= GetCurrentResourceName() then return end if dialog then
for k in pairs(Targets) do exports['qb-target']:RemoveZone(k) end if dialog[1] then
for k in pairs(Peds) do unloadModel(GetEntityModel(Peds[k])) DeletePed(Peds[k]) end dialog.citizen = dialog[1]
end) dialog.billtype = dialog[2]
dialog.price = dialog[3]
end
billPrev = dialog.billtype
TriggerServerEvent('jim-payments:server:ATM:give', dialog.citizen, dialog.price)
end
end)

372
client/banks.lua Normal file
View File

@@ -0,0 +1,372 @@
Peds = {}
RegisterNetEvent('QBCore:Client:SetDuty', function(duty) onDuty = duty end)
if Config.Banks.enable then
onPlayerLoaded(function()
for k, v in pairs(BankLocations) do
for i = 1, #v do
local name = getScript()..":BankLocation:"..k..i
if Config.General.Peds then
if not Config.Gabz then CreateModelHide(v[i].xyz, 1.0, `v_corp_bk_chair3`, true) end
if not Peds[name] then
Peds[name] = makePed(Config.General.PedPool[math.random(1, #Config.General.PedPool)], v[i], false, false)
if isStarted("jim-talktonpc") then
exports["jim-talktonpc"]:createDistanceMessage("hi", Peds[name], 3.0, false)
end
end
end
local jobroles = {} local gangroles = {}
for k, v in pairs(Config.Receipts.Jobs) do
if v.gang then
gangroles[k] = 0
else
jobroles[k] = 0
end
end
local options = {
{ action = function()
if Config.General.Peds and isStarted("jim-talktonpc") then
exports["jim-talktonpc"]:createCam(Peds[name], true, "generic", true)
end
TriggerEvent(getScript()..":Client:Bank", { ped = Config.General.Peds and Peds[name] })
end,
icon = "fas fa-piggy-bank", label = locale("target", "bank")
},
}
if Config.Receipts.CashInAnywhere then
options[#options+1] =
{ action = function() TriggerEvent(getScript()..":Tickets:Menu", { gang = false }) end,
icon = "fas fa-receipt", label = locale("target", "cashin_boss"), job = jobroles,
}
options[#options+1] =
{ action = function() TriggerEvent(getScript()..":Tickets:Menu", { gang = true }) end,
icon = "fas fa-receipt", label = locale("target", "cashin_gang"), gang = gangroles,
}
end
createCircleTarget(
{ name, vec3(v[i].x, v[i].y, v[i].z+0.2), 2.0, { name = name, debugPoly = debugMode, useZ = true, }, }, options, 2.5)
if Config.Banks.showBlips then
makeBlip({coords = v[i], sprite = 814, col = 2, scale = 0.7, disp = 6, name = locale("blip", "blip_bank") })
end
end
end
end, true)
end
RegisterNetEvent(getScript()..":Client:Bank", function(data) local setheader = nil
--this grabs all the info from names to savings account numbers in the databases
local bankinfo = triggerCallback(getScript()..":GetInfo")
local info = getPlayer()
info.ped = data.ped or nil
playAnim("amb@prop_human_atm@male@enter", "enter", 2000, 1)
if progressBar({ label = locale("menu", "acc_bank"), time = 3000 }) then
local Menu = {}
Menu[#Menu+1] = {
isMenuHeader = true,
header = locale("menu", "welcome")..info.name,
txt = locale("menu", "header_acc").." "..info.account..br..locale("menu", "citizenid").." "..info.citizenId,
}
Menu[#Menu+1] = {
isMenuHeader = true,
header = locale("menu", "header_acc")..locale("menu", "header_balance"),
txt = locale("menu", "bank_balance")..cv(info.bank)..br..locale("menu", "cash_balance")..cv(info.cash)
}
Menu[#Menu+1] = {
header = locale("menu", "deposit").."/"..locale("menu", "withdraw"),
icon = "fas fa-piggy-bank",
onSelect = function()
info.id = "bank"
bankTransaction(info, bankinfo)
end,
}
if isStarted(QBExport) and not isStarted(QBXExport) then -- only supports qbcore account transfers
Menu[#Menu+1] = {
header = locale("target", "transfer"),
icon = "fas fa-arrow-right-arrow-left",
onSelect = function()
info.id = "transfer"
bankTransaction(info, bankinfo)
end,
}
Menu[#Menu+1] = {
header = locale("target", "saving"),
icon = "fas fa-money-check-dollar",
onSelect = function()
info.id = "savings"
bankTransaction(info, bankinfo)
end,
}
end
if info.jobBoss then
Menu[#Menu+1] = {
header = locale("target", "soc_saving"),
txt = Jobs[info.job].label..br.." 🏦 $"..bankinfo.society or "Error",
icon = "fas fa-building",
onSelect = function()
info.id = "society"
bankTransaction(info, bankinfo)
end,
}
if isStarted(QBExport) and not isStarted(QBXExport) then -- only supports qbcore account transfers
Menu[#Menu+1] = {
header = locale("target", "soc_trans"),
txt = Jobs[info.job].label or "Error",
icon = "fas fa-arrow-right-arrow-left",
onSelect = function()
info.id = "societytransfer"
bankTransaction(info, bankinfo)
end,
}
end
end
if info.gangBoss then
Menu[#Menu+1] = {
header = locale("target", "gang_acct"),
txt = Gangs[info.gang].label or "Error",
icon = "fas fa-building",
onSelect = function()
info.id = "gang"
bankTransaction(info, bankinfo)
end,
}
if isStarted(QBExport) then
Menu[#Menu+1] = {
header = locale("target", "gang_trans"),
txt = Gangs[info.gang].label or "Error",
icon = "fas fa-arrow-right-arrow-left",
onSelect = function()
info.id = "gangtransfer"
bankTransaction(info, bankinfo)
end,
}
end
end
local header = locale("menu", "header_atm")
if Config.System.Menu == "qb" then header = "<center><img src="..Config.General.menuLogo.." width=200px></center>"
elseif Config.System.Menu == "ox" then header = '!['..''.. ']('..Config.General.menuLogo..')'
end
openMenu(Menu, { header = header, canClose = true, onExit = function()
if Config.General.Peds and isStarted("jim-talktonpc") then
exports["jim-talktonpc"]:stopCam()
end
playAnim("amb@prop_human_atm@male@exit", "exit", 3000, 1)
end, })
else
triggerNotify(nil, locale("error", "cancel"), "error")
end
end)
function bankTransaction(info, bankinfo)
local setimage = locale("menu", "header_atm")
if Config.System.Menu == "qb" then setimage = "<center><img src="..Config.General.menuLogo.." width=200px></center>"
elseif Config.System.Menu == "ox" then setimage = '!['..''.. ']('..Config.General.menuLogo..')'
end
playAnim("amb@prop_human_atm@male@idle_a", "idle_a", nil, 1)
if isStarted("jim-talktonpc") then exports["jim-talktonpc"]:injectEmotion("thanks", info.ped) end
local setinputs, setheader = {}, ""
if info.id == "bank" then
setheader = locale("menu", "header_bank")
setinputs = {
{ type = 'radio',
name = 'billtype',
text = Config.System.Menu == "ox" and locale("menu", "bank_balance")..cv(info.bank)..locale("menu", "cash_balance")..cv(info.cash)
or
setimage..
locale("menu", "header_balance")..br..
locale("menu", "bank_balance")..cv(info.bank)..br..
locale("menu", "cash_balance")..cv(info.cash)..br..br..
locale("menu", "header_option"),
options = {
{ value = "withdraw", text = locale("menu", "withdraw") },
{ value = "deposit", text = locale("menu", "deposit") }
},
},
{ type = 'number',
isRequired = true,
name = 'amount',
text = locale("menu", "header_trans_amount")
},
}
elseif info.id == "transfer" then
setheader = locale("menu", "header_trans")
setinputs = {
{ type = 'radio',
name = 'billtype',
text = Config.System.Menu == "ox" and locale("menu", "bank_balance")..cv(info.bank)
or
setimage..
locale("menu", "header_balance")..br..
locale("menu", "bank_balance")..cv(info.bank)..br..
locale("menu", "header_option"),
options = {
{ value = "transfer", text = locale("menu", "transfer") }
},
},
{ type = 'text',
isRequired = true,
name = 'account',
text = locale("menu", "header_account_no")
},
{ type = 'number',
isRequired = true,
name = 'amount',
text = locale("menu", "header_trans_amount"),
min = 0,
max = info.bank,
},
}
elseif info.id == "savings" then
setheader = locale("menu", "header_saving")
setinputs = {
{ type = 'radio',
name = 'billtype',
text = Config.System.Menu == "ox" and locale("menu", "saving_balance")..cv(bankinfo.savbal)..locale("menu", "bank_balance")..cv(info.bank)
or
setimage..
locale("menu", "header_balance")..br..
locale("menu", "saving_balance")..cv(bankinfo.savbal)..br..
locale("menu", "bank_balance")..cv(info.bank)..br..br..
locale("menu", "header_option"),
options = {
{ value = "withdraw", text = locale("menu", "withdraw") },
{ value = "deposit", text = locale("menu", "deposit") }
}
},
{ type = 'number',
isRequired = true,
name = 'amount',
text = locale("menu", "header_trans_amount")
},
}
elseif info.id == "society" then
setheader = Jobs[info.job].label.." - "..locale("menu", "header_soc_bank")
setinputs = {
{ type = 'radio',
name = 'billtype',
text = Config.System.Menu == "ox" and Jobs[info.job].label.." - $"..cv(bankinfo.society)..locale("menu", "bank_balance")..cv(info.bank)
or
setimage..
locale("menu", "header_balance")..br..
Jobs[info.job].label.." - $"..cv(bankinfo.society)..br..
locale("menu", "bank_balance")..cv(info.bank)..br..br..
locale("menu", "header_option"),
options = {
{ value = "withdraw", text = locale("menu", "withdraw") },
{ value = "deposit", text = locale("menu", "deposit") }
}
},
{ type = 'number',
isRequired = true,
name = 'amount',
text = locale("menu", "header_trans_amount")
},
}
elseif info.id == "societytransfer" then
setheader =Jobs[info.job].label.." - "..locale("menu", "header_trans")
setinputs = {
{ type = 'radio',
name = 'billtype',
text = Config.System.Menu == "ox" and Jobs[info.job].label.." - $"..cv(bankinfo.society)..locale("menu", "bank_balance")..cv(info.bank)
or
setimage..
locale("menu", "header_balance")..br..
Jobs[info.job].label.." - $"..cv(bankinfo.society)..br..
locale("menu", "bank_balance")..cv(info.bank)..br..br..
locale("menu", "header_option"),
options = { { value = "transfer", text = locale("menu", "transfer") } }
},
{ type = 'text',
isRequired = true,
name = 'account',
text = locale("menu", "header_account_no")
},
{ type = 'number',
isRequired = true,
name = 'amount',
text = locale("menu", "header_trans_amount")
},
}
elseif info.id == "gang" then
setheader = Gangs[info.gang].label.." - "..locale("menu", "header_soc_bank")
setinputs = {
{ type = 'radio',
name = 'billtype',
text = Config.System.Menu == "ox" and Gangs[info.gang].label.." - $"..cv(bankinfo.gsociety)..locale("menu", "bank_balance")..cv(info.bank)
or
setimage..
locale("menu", "header_balance")..br..
Gangs[info.gang].label.." - $"..cv(bankinfo.gsociety)..br..
locale("menu", "bank_balance")..cv(info.bank)..br..br..
locale("menu", "header_option"),
options = {
{ value = "withdraw", text = locale("menu", "withdraw") },
{ value = "deposit", text = locale("menu", "deposit") }
}
},
{ type = 'number',
isRequired = true,
name = 'amount',
text = locale("menu", "header_trans_amount")
},
}
elseif info.id == "gangtransfer" then
setheader = Gangs[info.gang].label.." - "..locale("menu", "header_soc_bank")
setinputs = {
{ type = 'radio',
name = 'billtype',
text = Config.System.Menu == "ox" and Gangs[info.gang].label.." - $"..cv(bankinfo.gsociety)..locale("menu", "bank_balance")..cv(info.bank)
or
setimage..
locale("menu", "header_balance")..br..
Gangs[info.gang].label.." - $"..cv(bankinfo.gsociety)..br..
locale("menu", "bank_balance")..cv(info.bank)..br..br..
locale("menu", "header_option"),
options = {
{ value = "transfer", text = locale("menu", "transfer") }
}
},
{ type = 'text',
isRequired = true,
name = 'account',
text = locale("menu", "header_account_no")
},
{ type = 'number',
isRequired = true,
name = 'amount',
text = locale("menu", "header_trans_amount")
},
}
end
local dialog = createInput(setheader, setinputs)
if dialog then
if dialog[1] then
dialog.billtype = dialog[1]
dialog.amount = dialog[2] or 1
end
if not dialog.amount then
TriggerEvent(getScript()..":Client:Bank", { ped = info.ped })
return
end
if Config.General.Peds and isStarted("jim-talktonpc") then
exports["jim-talktonpc"]:stopCam()
end
playAnim("amb@prop_human_atm@male@exit", "exit", 3000, 1)
Wait(1000)
TriggerServerEvent(getScript()..":server:ATM:use", dialog.amount, dialog.billtype, dialog.account, info.id, bankinfo.society, bankinfo.gsociety)
end
end

315
client/charge.lua Normal file
View File

@@ -0,0 +1,315 @@
local BankPed = nil
local Till = {}
function spawnCustomRegisters()
Wait(1000)
for k, v in pairs(Config.CustomCashRegisters) do
for i = 1, #v do
local job, gang = v[i].gang and nil or k, v[i].gang and k or nil
local img = v.img or v[i].img
createBoxTarget({"CustomRegister: "..k..i, v[i].coords.xyz, 0.47, 0.34, {name="CustomRegister: "..k..i, heading = v[i].coords[4], debugPoly = debugMode, minZ = v[i].coords.z-0.1, maxZ = v[i].coords.z+0.4}}, {
{
action = function() TriggerEvent(getScript()..":client:Charge", {job = job, gang = gang, img = img}) end,
icon = "fas fa-credit-card",
label = locale("target","charge"),
job = job,
gang = gang
}
}, 2.0)
if v[i].prop then makeProp({prop = "prop_till_03", coords = v[i].coords+vec4(0,0,1.0, 0.0)}, 1, false) end
end
end
end
onPlayerLoaded(function() spawnCustomRegisters() end, true)
RegisterNetEvent(getScript()..":client:Charge", function(data, outside)
local billPrev = "cash"
--if not outside and not onDuty and data.gang == nil then triggerNotify(nil, locale("error", "not_onduty") return end
local newinputs = {} -- Begin qb-input creation here.
local nearbyList = {}
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())
if onlineList == nil or #onlineList == 0 then
goto failed
end
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
::failed::
--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
newinputs[#newinputs+1] = {
type = "select",
text = locale("menu", "cus_id"),
name = "citizen",
label = locale("menu", "cus_id"),
default = 1,
options = nearbyList
}
elseif Config.General.lookAtCharge then
local selectedPed = nil
local highlightedPed = nil
local running = true
CreateThread(function()
while running do
Wait(0)
-- Raycast to get entity being looked at
local camCoord = GetGameplayCamCoord()
local direction = RotationToDirection(GetGameplayCamRot(2))
local targetCoord = camCoord + direction * 6.0
local hit, _ , hitCoords, _, entityHit = PerformRaycast(camCoord, targetCoord, PlayerPedId(), 4)
if hit then
DrawSphere(hitCoords.x, hitCoords.y, hitCoords.z, 0.05, 255, 255, 255, 0.5)
end
if entityHit and IsEntityAPed(entityHit) and entityHit ~= PlayerPedId() then
if highlightedPed ~= entityHit then
if highlightedPed and DoesEntityExist(highlightedPed) then
SetEntityAlpha(highlightedPed, 255, false)
ResetEntityAlpha(highlightedPed)
end
highlightedPed = entityHit
SetEntityAlpha(highlightedPed, 200, false)
end
elseif highlightedPed then
SetEntityAlpha(highlightedPed, 255, false)
ResetEntityAlpha(highlightedPed)
highlightedPed = nil
end
local loc = vec2(0.89+0.037, 0.9)
DrawSprite("timerbars", "all_black_bg", loc.x, loc.y, 0.12, 0.05, 0.0, 255, 255, 255, 255)
SetTextScale(0.80, 0.80)
SetTextWrap(0.75, 0.985)
SetTextJustification(2)
SetTextFont(4)
SetTextColour(255, 255, 255, 255)
BeginTextCommandDisplayText("STRING")
AddTextComponentSubstringKeyboardDisplay(highlightedPed and "~s~Selected ID: ~g~"..GetPlayerServerId(NetworkGetPlayerIndexFromPed(highlightedPed)) or "~s~No Selection")
EndTextCommandDisplayText(loc.x+0.06, loc.y - 0.026)
-- Show instructional UI
local buttons = {
{ keys = { 194 }, text = "Cancel" }
}
if highlightedPed then
table.insert(buttons, { keys = { 86, 191 }, text = "Confirm" })
end
makeInstructionalButtons(buttons)
-- Handle controls
if IsControlJustPressed(0, 194) then -- Backspace
if highlightedPed then
SetEntityAlpha(highlightedPed, 255, false)
ResetEntityAlpha(highlightedPed)
end
running = false
return
end
if highlightedPed and (IsControlJustPressed(0, 191) or IsControlJustPressed(0, 86)) then
local serverId = GetPlayerServerId(NetworkGetPlayerIndexFromPed(highlightedPed))
if serverId then
running = false
SetEntityAlpha(highlightedPed, 255, false)
ResetEntityAlpha(highlightedPed)
--Grab Player Job name or Gang Name if needed
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
local newinputs = {
{
type = 'select',
name = 'billtype',
text = locale("menu", "type"),
default = billPrev,
options = {
{ value = "cash", text = locale("menu", "cash"), label = locale("menu", "cash") },
{ value = "bank", text = locale("menu", "card"), label = locale("menu", "card") }
}
},
{
type = 'number',
isRequired = true,
name = 'price',
text = locale("menu", "amount_charge")
}
}
local dialog = createInput(img, newinputs)
if dialog then
-- If ox_menu style input, fix indexes
if dialog[1] then
dialog.billtype = dialog[1]
dialog.price = dialog[2]
end
billPrev = dialog.billtype
TriggerServerEvent(getScript()..":server:Charge", serverId, dialog.price, dialog.billtype, data.img, outside, gang)
if Config.General.Usebzzz then
destroyProp(prop)
stopAnim('cellphone@', 'cellphone_text_read_base')
end
end
end
end
end
end)
return -- Skip continuing function until selection is made
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", "cus_id"),
text = locale("menu", "cus_id")
}
end
local prop = nil
if Config.General.Usebzzz then
local Ped = PlayerPedId()
prop = makeProp({ prop = 'bzzz_prop_payment_terminal', coords = vec4(0,0,0,0)}, false, true)
AttachEntityToEntity(prop, Ped, GetPedBoneIndex(Ped, 57005), 0.17, 0.04, 0.01, 340.0, 200.0, 50.0, true, true, false, false, 1, true)
playAnim('cellphone@', 'cellphone_text_read_base', -1, 49)
end
--Grab Player Job name or Gang Name if needed
local getInfo = getPlayer()
--Check if image was given when opening the regsiter
local img = data.img ~= nil and (Config.System.Menu == "qb" and "<center><img src="..(data.img).." width=200px></center>") or Jobs[getInfo.job].label
newinputs[#newinputs+1] = {
type = 'select',
name = 'billtype',
text = locale("menu" ,"type"),
default = billPrev,
options = {
{ value = "cash", text = locale("menu" ,"cash"), label = locale("menu" ,"cash") },
{ value = "bank", text = locale("menu" ,"card"), label = locale("menu" ,"card") }
}
}
newinputs[#newinputs+1] = { type = 'number', isRequired = true, name = 'price', text = locale("menu" ,"amount_charge") }
local dialog = createInput(img, newinputs)
if dialog then
if dialog[1] then -- if ox menu, auto adjust values
if dialog[1] == "" then
TriggerEvent(getScript()..":client:Charge", data, outside)
return
end
dialog.citizen = dialog[1]
dialog.billtype = dialog[2]
dialog.price = dialog[3]
end
billPrev = dialog.billtype
TriggerServerEvent(getScript()..":server:Charge", dialog.citizen, dialog.price, dialog.billtype, data.img, outside, gang)
end
if Config.General.Usebzzz then
destroyProp(prop)
stopAnim('cellphone@', 'cellphone_text_read_base')
end
end)
RegisterNetEvent(getScript()..":client:PayPopup", function(amount, biller, billtype, img, billerjob, gang, outside)
local setimage = ""
if not img then
setimage = billerjob
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
local Menu = {}
Menu[#Menu+1] = {
isMenuHeader = true,
header = "🧾 "..locale("menu" ,"payment"),
txt = locale("menu" ,"accept_payment")
}
Menu[#Menu+1] = {
isMenuHeader = true,
header = "",
txt = billtype:gsub("^%l", string.upper)..locale("menu" ,"payment_amount")..amount
}
Menu[#Menu+1] = {
icon = "fas fa-circle-check",
header = locale("menu" ,"yes"),
txt = "",
onSelect = function()
TriggerServerEvent(getScript()..":server:PayPopup", {
accept = true,
amount = amount,
biller = biller,
billtype = billtype,
outside = outside
})
end,
}
Menu[#Menu+1] = {
icon = "fas fa-circle-xmark",
header = locale("menu" ,"no"),
onSelect = function()
TriggerServerEvent(getScript()..":server:PayPopup", {
accept = false,
amount = amount,
biller = biller,
billtype = billtype,
outside = outside
})
end,
}
openMenu(Menu, {
header = setimage,
onExit = function()
TriggerServerEvent(getScript()..":server:PayPopup", {
accept = false,
amount = amount,
biller = biller,
billtype = billtype,
outside = outside
})
end,
})
end)

View File

@@ -1,194 +0,0 @@
PlayerJob = {}
PlayerGang = {}
local onDuty = false
local BankPed = nil
local Targets = {}
local Till = {}
RegisterNetEvent('QBCore:Client:OnPlayerLoaded', function() QBCore.Functions.GetPlayerData(function(PlayerData) PlayerJob = PlayerData.job PlayerGang = PlayerData.gang end) end)
RegisterNetEvent('QBCore:Client:OnJobUpdate', function(JobInfo) PlayerJob = JobInfo onDuty = PlayerJob.onduty end)
RegisterNetEvent('QBCore:Client:SetDuty', function(duty) onDuty = duty end)
RegisterNetEvent('QBCore:Client:OnGangUpdate', function(GangInfo) PlayerGang = GangInfo end)
--Keeps track of duty on script restarts
AddEventHandler('onResourceStart', function(resource) if GetCurrentResourceName() ~= resource then return end
QBCore.Functions.GetPlayerData(function(PlayerData)
PlayerJob = PlayerData.job
PlayerGang = PlayerData.gang
onDuty = PlayerJob.onduty
end)
end)
CreateThread(function()
local jobroles = {} local gangroles = {}
--Build Job/Gang Checks for cashin location
for k, v in pairs(Config.Jobs) do if v.gang then gangroles[tostring(k)] = 0 else jobroles[tostring(k)] = 0 end end
--Create Target at location
Targets["JimBank"] =
exports['qb-target']:AddCircleZone("JimBank", vector3(Config.CashInLocation.x, Config.CashInLocation.y, Config.CashInLocation.z), 2.0, { name="JimBank", debugPoly=Config.Debug, useZ=true, },
{ options = {
{ event = "jim-payments:Tickets:Menu", icon = "fas fa-receipt", label = Loc[Config.Lan].target["cashin_boss"], job = jobroles, },
{ event = "jim-payments:Tickets:Menu", icon = "fas fa-receipt", label = Loc[Config.Lan].target["cashin_gang"], gang = gangroles, } },
distance = 2.0 })
--Crete Ped at the location
if Config.Peds then
if not Config.Gabz then CreateModelHide(vector3(Config.CashInLocation.x, Config.CashInLocation.y, Config.CashInLocation.z), 1.0, `v_corp_bk_chair3`, true) end
BankPed = makePed(Config.PedPool[math.random(1, #Config.PedPool)], Config.CashInLocation, false, false)
end
--Spawn Custom Cash Register Targets
for k, v in pairs(Config.CustomCashRegisters) do
for i = 1, #v do
local job = k
local gang = nil
if v[i].gang then job = nil gang = k end
Targets["CustomRegister: "..k..i] =
exports['qb-target']:AddBoxZone("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 },
{ options = { { event = "jim-payments:client:Charge", icon = "fas fa-credit-card", label = Loc[Config.Lan].target["charge"], job = job, gang = gang, img = "" }, },
distance = 2.0 })
if v[i].prop then
Till[#Till+1] = makeProp({prop = `prop_till_03`, coords = v[i].coords}, 1, false)
end
end
end
end)
RegisterNetEvent('jim-payments: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, Loc[Config.Lan].error["not_onduty"], "error") return end
local newinputs = {} -- Begin qb-input creation here.
if Config.Usebzzz then
TriggerEvent('animations:client:EmoteCommandStart', {'terminal'})
end
if Config.List then -- If nearby player list is wanted:
--Retrieve a list of nearby players from server
local p = promise.new() QBCore.Functions.TriggerCallback('jim-payments:MakePlayerList', function(cb) p:resolve(cb) end)
local onlineList = Citizen.Await(p)
local nearbyList = {}
--Convert list of players nearby into one qb-input understands + add distance info
for _, v in pairs(QBCore.Functions.GetPlayersFromCoords(GetEntityCoords(PlayerPedId()), Config.PaymentRadius)) do
local dist = #(GetEntityCoords(GetPlayerPed(v)) - GetEntityCoords(PlayerPedId()))
for i = 1, #onlineList do
if onlineList[i].value == GetPlayerServerId(v) then
if v ~= PlayerId() or Config.Debug then
nearbyList[#nearbyList+1] = { value = onlineList[i].value, 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, Loc[Config.Lan].error["no_one"], "error") return end
newinputs[#newinputs+1] = { text = " ", name = "citizen", type = "select", options = nearbyList }
else -- If Config.List is false, create input text box for ID's
newinputs[#newinputs+1] = { type = 'text', isRequired = true, name = 'citizen', text = Loc[Config.Lan].menu["cus_id"] }
end
--Check if image was given when opening the regsiter
local img = data.img or ""
if not string.find(img, "<") then img = "<center><p><img src="..img.." width=100px></p>" end
--Continue adding payment options to qb-input
newinputs[#newinputs+1] = { type = 'radio', name = 'billtype', text = Loc[Config.Lan].menu["type"], options = { { value = "cash", text = Loc[Config.Lan].menu["cash"] }, { value = "bank", text = Loc[Config.Lan].menu["card"] } } }
newinputs[#newinputs+1] = { type = 'number', isRequired = true, name = 'price', text = Loc[Config.Lan].menu["amount_charge"] }
--Grab Player Job name or Gang Name if needed
local label = PlayerJob.label
local gang = false
if data.gang then label = PlayerGang.label gang = true end
local dialog = exports['qb-input']:ShowInput({ header = img..label..Loc[Config.Lan].menu["cash_reg"], submitText = Loc[Config.Lan].menu["send"], inputs = newinputs})
if dialog then
if not dialog.citizen or not dialog.price then return end
TriggerServerEvent('jim-payments:server:Charge', dialog.citizen, dialog.price, dialog.billtype, data.img, outside, gang)
end
if Config.Usebzzz then
ExecuteCommand("e c")
end
end)
RegisterNetEvent('jim-payments:client:PolCharge', function()
--Check if player is allowed to use /cashregister command
local allowed = false
for k in pairs(Config.FineJobs) do if k == PlayerJob.name then allowed = true end end
if not allowed then triggerNotify(nil, Loc[Config.Lan].error["no_job"], "error") return end
local newinputs = {} -- Begin qb-input creation here.
if Config.FineJobList then -- If nearby player list is wanted:
--Retrieve a list of nearby players from server
local p = promise.new() QBCore.Functions.TriggerCallback('jim-payments:MakePlayerList', function(cb) p:resolve(cb) end)
local onlineList = Citizen.Await(p)
local nearbyList = {}
--Convert list of players nearby into one qb-input understands + add distance info
for _, v in pairs(QBCore.Functions.GetPlayersFromCoords(GetEntityCoords(PlayerPedId()), Config.PaymentRadius)) do
local dist = #(GetEntityCoords(GetPlayerPed(v)) - GetEntityCoords(PlayerPedId()))
for i = 1, #onlineList do
if onlineList[i].value == GetPlayerServerId(v) then
if v ~= PlayerId() or Config.Debug then
nearbyList[#nearbyList+1] = { value = onlineList[i].value, 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, Loc[Config.Lan].error["no_one"], "error") return end
newinputs[#newinputs+1] = { text = " ", name = "citizen", type = "select", options = nearbyList }
else -- If Config.List is false, create input text box for ID's
newinputs[#newinputs+1] = { type = 'text', isRequired = true, name = 'citizen', text = Loc[Config.Lan].menu["person_id"] }
end
--Continue adding payment options to qb-input
newinputs[#newinputs+1] = { type = 'number', isRequired = true, name = 'price', text = Loc[Config.Lan].menu["amount_charge"] }
--Grab Player Job name or Gang Name if needed
local label = PlayerJob.label
local gang = false
local dialog = exports['qb-input']:ShowInput({ header = label..Loc[Config.Lan].menu["charge"], submitText = Loc[Config.Lan].menu["send"], inputs = newinputs})
if dialog then
if not dialog.citizen or not dialog.price then return end
TriggerServerEvent('jim-payments:server:PolCharge', dialog.citizen, dialog.price)
end
end)
RegisterNetEvent('jim-payments:Tickets:Menu', function(data)
--Get ticket info
local p = promise.new() QBCore.Functions.TriggerCallback('jim-payments:Ticket:Count', function(cb) p:resolve(cb) end)
local amount = Citizen.Await(p)
if not amount then triggerNotify(nil, Loc[Config.Lan].error["no_ticket"], "error") amount = 0 return else amount = amount.amount end
local sellable = false
local name = "" local label = ""
--Check/adjust for job/gang names
for k, v in pairs(Config.Jobs) do
if data.gang then if v.gang and k == PlayerGang.name then name = k label = PlayerGang.label sellable = true end
else if not v.gang and k == PlayerJob.name then name = k label = PlayerJob.label sellable = true end
end
if sellable then -- if info is found then:
exports['qb-menu']:openMenu({
{ isMenuHeader = true, header = "🧾 "..label..Loc[Config.Lan].menu["receipt"], txt = Loc[Config.Lan].menu["trade_confirm"] },
{ isMenuHeader = true, header = "", txt = Loc[Config.Lan].menu["ticket_amount"]..amount..Loc[Config.Lan].menu["total_pay"]..(Config.Jobs[name].PayPerTicket * amount) },
{ icon = "fas fa-circle-check", header = Loc[Config.Lan].menu["yes"], txt = "", params = { event = "jim-payments:Tickets:Sell:yes" } },
{ icon = "fas fa-circle-xmark", header = Loc[Config.Lan].menu["no"], txt = "", params = { event = "jim-payments:Tickets:Sell:no" } },
})
end
end
end)
RegisterNetEvent("jim-payments:client:PayPopup", function(amount, biller, billtype, img, billerjob, gang, outside)
local img = img or ""
exports['qb-menu']:openMenu({
{ isMenuHeader = true, header = img.."🧾 "..billerjob..Loc[Config.Lan].menu["payment"], txt = Loc[Config.Lan].menu["accept_payment"] },
{ isMenuHeader = true, header = "", txt = billtype:gsub("^%l", string.upper)..Loc[Config.Lan].menu["payment_amount"]..amount },
{ icon = "fas fa-circle-check", header = Loc[Config.Lan].menu["yes"], txt = "", params = { isServer = true, event = "jim-payments:server:PayPopup", args = { accept = true, amount = amount, biller = biller, billtype = billtype, gang = gang, outside = outside } } },
{ icon = "fas fa-circle-xmark", header = Loc[Config.Lan].menu["no"], txt = "", params = { isServer = true, event = "jim-payments:server:PayPopup", args = { accept = false, amount = amount, biller = biller, billtype = billtype, outside = outside } } }, })
end)
RegisterNetEvent("jim-payments:client:PolPopup", function(amount, biller, billerjob)
exports['qb-menu']:openMenu({
{ isMenuHeader = true, header = "🧾 "..billerjob..Loc[Config.Lan].menu["payment"], txt = Loc[Config.Lan].menu["accept_charge"] },
{ isMenuHeader = true, header = "", txt = Loc[Config.Lan].menu["bank_charge"]..amount },
{ icon = "fas fa-circle-check", header = Loc[Config.Lan].menu["yes"], txt = "", params = { isServer = true, event = "jim-payments:server:PolPopup", args = { accept = true, amount = amount, biller = biller } } },
{ icon = "fas fa-circle-xmark", header = Loc[Config.Lan].menu["no"], txt = "", params = { isServer = true, event = "jim-payments:server:PolPopup", args = { accept = false, amount = amount, biller = biller } } }, })
end)
RegisterNetEvent('jim-payments:Tickets:Sell:yes', function() TriggerServerEvent('jim-payments:Tickets:Sell') end)
RegisterNetEvent('jim-payments:Tickets:Sell:no', function() exports['qb-menu']:closeMenu() end)
AddEventHandler('onResourceStop', function(r) if r ~= GetCurrentResourceName() then return end
for k in pairs(Targets) do exports['qb-target']:RemoveZone(k) end
for i = 1, #Till do DeleteEntity(Till[i]) end
unloadModel(GetEntityModel(BankPed)) DeletePed(BankPed)
end)

228
client/polcharge.lua Normal file
View File

@@ -0,0 +1,228 @@
RegisterNetEvent(getScript()..":client:PolCharge", function()
local Playerinfo = getPlayer()
--Check if player is allowed to use /cashregister command
local allowed = false
for k in pairs(Config.PolCharge.FineJobs) do
if k == Playerinfo.job then
allowed = true
break
end
end
if not allowed then
triggerNotify(nil, locale("error", "no_job"), "error")
return
end
local newinputs = {} -- Begin qb-input creation here.
local nearbyList = {}
if Config.PolCharge.FineJobList 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 an input script understands + add distance info
for _, v in pairs(Core.Functions.GetPlayersFromCoords(GetEntityCoords(PlayerPedId()), Config.General.PaymentRadius)) do
local dist = #(GetEntityCoords(GetPlayerPed(v)) - GetEntityCoords(PlayerPedId()))
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
newinputs[#newinputs+1] = {
type = "select",
text = locale("menu" ,"cus_id"),
name = "citizen",
label = locale("menu" ,"cus_id"),
default = 1,
options = nearbyList
}
elseif Config.General.lookAtCharge then
local selectedPed = nil
local highlightedPed = nil
local running = true
CreateThread(function()
while running do
Wait(0)
-- Raycast to get entity being looked at
local camCoord = GetGameplayCamCoord()
local direction = RotationToDirection(GetGameplayCamRot(2))
local targetCoord = camCoord + direction * 6.0
local hit, _ , hitCoords, _, entityHit = PerformRaycast(camCoord, targetCoord, PlayerPedId(), 4)
if hit then
DrawSphere(hitCoords.x, hitCoords.y, hitCoords.z, 0.05, 0, 0, 255, 0.5)
end
if entityHit and IsEntityAPed(entityHit) and entityHit ~= PlayerPedId() then
if highlightedPed ~= entityHit then
if highlightedPed and DoesEntityExist(highlightedPed) then
SetEntityAlpha(highlightedPed, 255, false)
ResetEntityAlpha(highlightedPed)
end
highlightedPed = entityHit
SetEntityAlpha(highlightedPed, 200, false)
end
elseif highlightedPed then
SetEntityAlpha(highlightedPed, 255, false)
ResetEntityAlpha(highlightedPed)
highlightedPed = nil
end
local loc = vec2(0.89+0.037, 0.9)
DrawSprite("timerbars", "all_black_bg", loc.x, loc.y, 0.12, 0.05, 0.0, 255, 255, 255, 255)
SetTextScale(0.80, 0.80)
SetTextWrap(0.75, 0.985)
SetTextJustification(2)
SetTextFont(4)
SetTextColour(255, 255, 255, 255)
BeginTextCommandDisplayText("STRING")
AddTextComponentSubstringKeyboardDisplay(highlightedPed and "~s~Selected ID: ~b~"..GetPlayerServerId(NetworkGetPlayerIndexFromPed(highlightedPed)) or "~s~No Selection")
EndTextCommandDisplayText(loc.x+0.06, loc.y - 0.026)
-- Show instructional UI
local buttons = {
{ keys = { 194 }, text = "Cancel" }
}
if highlightedPed then
table.insert(buttons, { keys = { 86, 191 }, text = "Confirm" })
end
makeInstructionalButtons(buttons)
-- Handle controls
if IsControlJustPressed(0, 194) then -- Backspace
if highlightedPed then
SetEntityAlpha(highlightedPed, 255, false)
ResetEntityAlpha(highlightedPed)
end
running = false
return
end
if highlightedPed and (IsControlJustPressed(0, 191) or IsControlJustPressed(0, 86)) then
local serverId = GetPlayerServerId(NetworkGetPlayerIndexFromPed(highlightedPed))
if serverId then
running = false
SetEntityAlpha(highlightedPed, 255, false)
ResetEntityAlpha(highlightedPed)
local newinputs = {
{
type = 'select',
name = 'billtype',
text = locale("menu", "type"),
default = billPrev,
options = {
{ value = "cash", text = locale("menu", "cash"), label = locale("menu", "cash") },
{ value = "bank", text = locale("menu", "card"), label = locale("menu", "card") }
}
},
{
type = 'number',
isRequired = true,
name = 'price',
text = locale("menu", "amount_charge")
}
}
local dialog = createInput(Jobs[getPlayer().job].label, newinputs)
if dialog then
-- If ox_menu style input, fix indexes
if dialog[1] then
dialog.billtype = dialog[1]
dialog.price = dialog[2]
end
billPrev = dialog.billtype
TriggerServerEvent(getScript()..":server:PolCharge", serverId, dialog.price)
end
end
end
end
end)
return -- Skip continuing function until selection is made
else
newinputs[#newinputs+1] = {
type = 'text',
isRequired = true,
name = 'citizen',
text = locale("menu" ,"cus_id")
}
end
newinputs[#newinputs+1] = {
type = 'number',
isRequired = true,
name = 'price',
text = locale("menu" ,"amount_charge")
}
local dialog = createInput(Jobs[Playerinfo.job].label, newinputs)
if dialog then
jsonPrint(dialog)
if dialog[1] then
dialog.citizen = dialog[1]
dialog.price = dialog[2]
end
TriggerServerEvent(getScript()..":server:PolCharge", dialog.citizen, dialog.price)
end
end)
RegisterNetEvent(getScript()..":client:PolPopup", function(amount, biller, billerjob, commPercent)
local Menu = {}
Menu[#Menu+1] = {
isMenuHeader = true,
header = "",
txt = locale("menu" ,"bank_charge")..amount
}
Menu[#Menu+1] = {
icon = "fas fa-circle-check",
header = locale("menu" ,"yes"),
txt = "",
onSelect = function()
TriggerServerEvent(getScript()..":server:PolPopup", {
accept = true,
amount = amount,
biller = biller,
commPercent = commPercent,
})
end,
}
Menu[#Menu+1] = {
icon = "fas fa-circle-xmark",
header = locale("menu" ,"no"),
onSelect = function()
TriggerServerEvent(getScript()..":server:PolPopup", {
accept = false,
amount = amount,
biller = biller,
})
end,
}
openMenu(Menu, {
header = "🧾 "..billerjob..locale("menu" ,"payment"),
headertxt = locale("menu" ,"accept_payment"),
onExit = function()
TriggerServerEvent(getScript()..":server:PolPopup", {
accept = false,
amount = amount,
biller = biller,
})
end,
})
end)

70
client/tickets.lua Normal file
View File

@@ -0,0 +1,70 @@
if not Config.Banks.enable or not Config.Receipts.CashInAnywhere then
onPlayerLoaded(function()
local locations = BankLocations
if not Config.Receipts.CashInAnywhere then
locations = {
["receipts"] = Config.Receipts.CashInLocations
}
end
for k, v in pairs(locations) do
for i = 1, #v do
local name = getScript()..":BankLocation:"..k..i
if Config.General.Peds then
if not Config.Gabz then CreateModelHide(v[i].xyz, 1.0, `v_corp_bk_chair3`, true) end
if not Peds[name] then
Peds[name] = makePed(Config.General.PedPool[math.random(1, #Config.General.PedPool)], v[i], false, false)
if isStarted("jim-talktonpc") then
exports["jim-talktonpc"]:createDistanceMessage("hi", Peds[name], 3.0, false)
end
end
end
local jobroles = {}
local gangroles = {}
for k, v in pairs(Config.Receipts.Jobs) do
if v.gang then
gangroles[k] = 0
else
jobroles[k] = 0
end
end
createCircleTarget(
{ name, vec3(v[i].x, v[i].y, v[i].z+0.2), 2.0, { name = name, debugPoly = debugMode, useZ = true, }, }, {
{ action = function() TriggerEvent(getScript()..":Tickets:Menu", { gang = false }) end,
icon = "fas fa-receipt", label = locale("target", "cashin_boss"), job = jobroles,
},
{ action = function() TriggerEvent(getScript()..":Tickets:Menu", { gang = true }) end,
icon = "fas fa-receipt", label = locale("target", "cashin_gang"), gang = gangroles,
},
}, 2.5)
end
end
end, true)
end
RegisterNetEvent(getScript()..":Tickets:Menu", function(data)
local PlayerInfo = getPlayer()
local hasItem, hasTable = hasItem("payticket", 1)
if not hasItem then
triggerNotify(nil, locale("error" ,"no_ticket"), "error")
return
end
local amount, sellable, name, label = hasTable["payticket"].count, false, "", ""
for k, v in pairs(Config.Receipts.Jobs) do
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 Gangs[PlayerInfo.gang].label) or (not data.gang and Jobs[PlayerInfo.job].label) break end
end
if sellable then local Menu = {}
Menu[#Menu+1] = {
isMenuHeader = true,
txt = locale("menu" ,"ticket_amount")..amount..locale("menu" ,"total_pay")..(Config.Receipts.Jobs[name].PayPerTicket * amount)
}
Menu[#Menu+1] = {
icon = "fas fa-circle-check", header = locale("menu" ,"yes"),
onSelect = function()
TriggerServerEvent(getScript()..":Tickets:Sell")
playAnim("pickup_object", "putdown_low", 2000, 1)
end,
}
openMenu(Menu, { header = "🧾 "..label..locale("menu" ,"receipt"), headertxt = locale("menu" ,"trade_confirm"), canClose = true, })
end
end)

View File

@@ -1,285 +1,193 @@
print("^2Jim^7-^2Payments ^7v^42^7.^48^7.^45 ^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/9pCDHmjYwd
-- https://discord.gg/xKgQZ6wZvS Config = {
Lan = "en",
Config = { System = {
Lan = "en", Debug = false,
Debug = false, EventDebug = false,
Notify = "qb", -- "qb" | "okok" | "t" | "infinity" | "rr"
Menu = "qb", -- "qb", "ox", "gta"
--------------------------------- Notify = "gta", -- "qb", "ox", "gta", "esx"
-- Default Job Payment Systems -- ProgressBar = "gta", -- "qb", "ox", "gta", "esx"
---------------------------------
Banking = "qb-banking",
-- "qb-management" - This is for the older version of QBCore DontUseTarget = false, -- uses drawtext targets instead of alt targets
-- "qb-banking" - This is for the latest QBCore updates },
-- "renewed"
-- "fd" - currently default supported Crafting = {
MultiCraft = true,
ApGov = false, -- Toggle support for AP-Goverment Tax showItemBox = true,
},
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) General = {
ApGov = false, -- Toggle support for AP-Goverment Tax
Peds = true, -- "true" to enable peds spawning in banks
PedPool = { lookAtCharge = false, -- "true" to use the "look at charge" feature
`IG_Bankman`, List = true, -- "true" to use nearby player list feature in the cash registers, "false" for manual id entry
`U_M_M_BankMan`,
`S_F_M_Shop_HIGH`, PaymentRadius = 15, -- This is how far the playerlist will check for nearby players (based on the person charging)
`S_M_M_HighSec_02`,
`S_M_M_HighSec_03`, Usebzzz = false, -- enable if you're using the prop from bzzz
`S_M_M_HighSec_04`,
`A_F_Y_Business_01`, Enablecommand = true, -- Enables the /cashregister command
`A_F_Y_Business_02`,
`A_F_Y_Business_03`, PhoneBank = false, -- Set this to false to use the popup payment system FOR CARD/BANK PAYMENTS instead of using phone invoices
`A_F_Y_Business_04`, -- This doesn't affect Cash payments as they by default use a confirmation window
`A_M_M_Business_01`, -- This is helpful for phones that don't support invoices well
`A_M_Y_Business_02`,
`A_M_Y_Business_03`, Peds = true, -- "true" to enable peds spawning in banks
`U_F_M_CasinoShop_01`, PedPool = { -- If Peds is true, use this pool of ped models to pick from
}, "IG_Bankman",
"U_M_M_BankMan",
Usebzzz = false, -- enable if you're using the prop from bzzz "S_F_M_Shop_HIGH",
Enablecommand = true, -- Enables the cashregister command "S_M_M_HighSec_02",
"S_M_M_HighSec_03",
PhoneBank = false, -- Set this to false to use the popup payment system FOR CARD/BANK PAYMENTS instead of using phone invoices "S_M_M_HighSec_04",
-- This doesn't affect Cash payments as they by default use confirmation now "A_F_Y_Business_01",
-- This is helpful for phones that don't support invoices well "A_F_Y_Business_02",
"A_F_Y_Business_03",
PhoneType = "qb", -- Change this setting to make invoices work with your phone script [still testing this currently] "A_F_Y_Business_04",
-- "qb" for qb-phone "A_M_M_Business_01",
-- "gks"" for GKSPhone "A_M_Y_Business_02",
"A_M_Y_Business_03",
CashInLocation = vector4(252.23, 223.11, 106.29, 159.2), -- Default Third Window along in Pacific Bank "U_F_M_CasinoShop_01",
},
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 PhoneType = "qb", -- Change this setting to make invoices work with your phone script [still testing this currently]
-- "qb" for qb-phone
Commission = true, -- Set this to true to enable Commissions and give the person charging a percentage of the total -- "gks" for GKSPhone
CommissionAll = false, -- Set this to true to give commission to workers clocked in
CommissionDouble = false, -- Set this to true if you want the person charging to get double Commission
CommissionLimit = false, -- If true, this limits the Commission to only be given if over the "MinAmountForTicket". Gabz = false, -- "true" to enable Gabz Bank locations
-- If false, Commission will be given for any amount -- this corrects the ATM/Bank Cashier + Ticket Cash in locations
-- MinAmountforTicket should be your cheapest item menuLogo = "https://static.wikia.nocookie.net/gtawiki/images/b/bd/Fleeca-GTAV-Logo.png",
-- PayPerTicket should never be higher than MinAmountforTicket
-- Commission is a percentage eg "0.10" becomes 10% },
Jobs = {
-- Jim Businesses | https://jimathy666.tebex.io/ ATMs = {
['bakery'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, }, enable = true, -- Enable this if wanting to use jim-payments atm systems
['beanmachine'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, }, showBlips = true,
['burgershot'] = { MinAmountforTicket = 50, PayPerTicket = 50 , Commission = 0.10, },
['catcafe'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, }, ATMModels = { `prop_atm_01`, `prop_atm_02`, `prop_atm_03`, `prop_fleeca_atm`, `gabz_sm_pb_atmframe` },
['henhouse'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, },
['pizzathis'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, }, },
['popsdiner'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, },
['tequilala'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, }, Banks = {
['vanilla'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, }, enable = true, -- Enable this if wanting to use jim-payments banking systems
['upnatom'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, }, showBlips = true,
['hornys'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, },
},
-- JixelTay Businesses | https://jixeltay.tebex.io/
['cigarbar'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, }, CustomCashRegisters = {
['cluckinbell'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, }, -- ["jobname"] = { -- Player job role restriction
['smokeshop'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, }, -- img = "https://i.ibb.co/HfVy87fW/image.png", -- url to image file
['pearls'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, }, -- { coords = vector4(0, 0, 0, 0), }, -- vector4 to place the till and the way it faces
['kois'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, }, -- { coords = vector4(0, 0, 0, 0), prop = true, }, -- "prop = true" spawns a prop at the coords
['whitewidow'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, }, -- },
['bestbuds'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, }, },
-- Jim Mechanic | https://jimathy666.tebex.io/ Receipts = {
['mechanic'] = { MinAmountforTicket = 1000, PayPerTicket = 500, Commission = 0.10, }, TicketSystem = true, -- Enable this if you want to use the ticket system false
['tuners'] = { MinAmountforTicket = 1000, PayPerTicket = 500, Commission = 0.10, }, TicketSystemAll = true, -- Enable this to give tickets to all workers clocked in
['ottos'] = { MinAmountforTicket = 1000, PayPerTicket = 500, Commission = 0.10, },
['lscustoms'] = { MinAmountforTicket = 1000, PayPerTicket = 500, Commission = 0.10, }, Commission = true, -- Set this to true to enable Commissions and give the person charging a percentage of the total
['bennys'] = { MinAmountforTicket = 1000, PayPerTicket = 500, Commission = 0.10, }, CommissionAll = false, -- Set this to true to give commission to workers clocked in
CommissionDouble = false, -- Set this to true if you want the person charging to get double Commission
-- Gangs | Example of a gang being supported CommissionLimit = false, -- If true, this limits the Commission to only be given if over the "MinAmountForTicket".
['lostmc'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, gang = true, }, -- 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
-- Custom Job Cash Register -- },
------------------------------
-- This adds the ability to add multiple locations for each job CashInAnywhere = true, -- enable this to add cash ticket option to any banking location
-- Basically adding ready made locations, all you need to a vector4 and to confrim if you need a new prop in that location
CustomCashRegisters = { -- MinAmountforTicket should be your cheapest item
-- ["jobname"] = { -- Player job role restriction -- PayPerTicket should never be higher than MinAmountforTicket
-- { coords = vector4(0, 0, 0, 0), prop = true, }, -- vector4 to place the till and the way it faces -- Commission is a percentage eg "0.10" becomes 10%
-- { coords = vector4(0, 0, 0, 0), prop = true, }, -- "prop = true" spawns a prop at the coords Jobs = {
-- }, -- Jim Businesses | https://jimathy666.tebex.io/
}, ['bakery'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, },
['beanmachine'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, },
-- The /polcharge command requires specific jobs to be set ['burgershot'] = { MinAmountforTicket = 50, PayPerTicket = 50 , Commission = 0.10, },
-- No tickets for these, it's just commission (0.25 = 25%) ['catcafe'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, },
FineJobs = { ['henhouse'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, },
['police'] = { Commission = 0.25, }, ['pizzathis'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, },
['ambulance'] = { Commission = 0.25, }, ['popsdiner'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, },
}, ['tequilala'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, },
FineJobConfirmation = false, --"true" makes it so fines need confirmation, "false" skips this ands just removes the money ['vanilla'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, },
FineJobList = true, -- "true" to use nearby player list feature in the cash registers, "false" for manual id entry ['upnatom'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, },
['hornys'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, },
---------------------
-- Banking Systems -- -- JixelTay Businesses | https://jixeltay.tebex.io/
--------------------- ['cigarbar'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, },
useATM = false, -- Enable this to use the scripts ATM's and controls ['cluckinbell'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, },
useBanks = false, -- Enable this to use my banking stuff ['smokeshop'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, },
BankBlips = false, -- Enable this if you disabled qb-banking and need bank locations ['pearls'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, },
ATMBlips = false, -- Enable this if you are a pyscho and need every ATM to be on the map too ['kois'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, },
['whitewidow'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, },
Gabz = false, -- "true" to enable Gabz Bank locations ['bestbuds'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, },
-- this corrects the ATM/Bank Cashier + Ticket Cash in location
-- Jim Mechanic | https://jimathy666.tebex.io/
ATMModels = { `prop_atm_01`, `prop_atm_02`, `prop_atm_03`, `prop_fleeca_atm` }, ['mechanic'] = { MinAmountforTicket = 1000, PayPerTicket = 500, Commission = 0.10, },
ATMLocations = { ['tuners'] = { MinAmountforTicket = 1000, PayPerTicket = 500, Commission = 0.10, },
--PACIFIC BANK 10 ATMS ['ottos'] = { MinAmountforTicket = 1000, PayPerTicket = 500, Commission = 0.10, },
vector3(265.9, 213.86, 106.28), ['lscustoms'] = { MinAmountforTicket = 1000, PayPerTicket = 500, Commission = 0.10, },
vector3(265.56, 212.98, 106.28), ['bennys'] = { MinAmountforTicket = 1000, PayPerTicket = 500, Commission = 0.10, },
vector3(265.19, 211.91, 106.28),
vector3(264.86, 211.03, 106.28), -- Gangs | Example of a gang being supported
vector3(264.52, 210.06, 106.28), ['lostmc'] = { MinAmountforTicket = 50, PayPerTicket = 50, Commission = 0.10, gang = true, },
vector3(236.64, 219.72, 106.29), },
vector3(237.04, 218.72, 106.29),
vector3(237.5, 217.87, 106.29), },
vector3(237.93, 216.94, 106.29), PolCharge = {
vector3(238.36, 216.03, 106.29), -- The /polcharge command requires specific jobs to be set
}, -- No tickets for these, it's just commission (0.25 = 25%)
--QB-Target doesn't seem to like ALL ATM Props so need to manually add locations FineJobs = {
WallATMLocations = { ['police'] = { Commission = 0.25, },
vector3(-386.54, 6046.29, 31.5), ['ambulance'] = { Commission = 0.25, },
vector3(-282.82, 6226.24, 31.49), },
vector3(-132.74, 6366.79, 31.48), FineJobConfirmation = false, --"true" makes it so fines need confirmation, "false" skips this ands just removes the money
vector3(-95.76, 6457.41, 31.46), FineJobList = false, -- "true" to use nearby player list feature in the cash registers, "false" for manual id entry
vector3(-97.52, 6455.65, 31.47), lookAtCharge = true, -- "true" to use the "look at charge" feature
vector3(155.95, 6642.99, 31.6), },
vector3(173.92, 6638.16, 31.57), }
vector3(2558.65, 350.92, 108.62),
vector3(1077.78, -776.64, 58.35), PlayerGang, PlayerJob, onDuty = {}, {}, nil
vector3(1138.14, -468.88, 66.73),
vector3(1166.93, -455.96, 66.81), -- Function for locales
vector3(285.37, 143.07, 104.17), -- Don't touch unless you know what you're doing
vector3(-165.43, 234.81, 94.92), -- This needs to be here because it loads before everything else
vector3(-165.4, 232.73, 94.92), function locale(section, string)
vector3(-1410.41, -98.76, 52.43), if not Config.Lan or Config.Lan == "" then
vector3(-1409.85, -100.51, 52.38), print("^1Error^7: ^3Config^7.^3Lan ^1not set^7, ^2falling back to Config.Lan = 'en'")
vector3(-1206.0, -324.94, 37.86), Config = Config or {}
vector3(-1205.23, -326.55, 37.86), Config.Lan = "en"
vector3(-2072.28, -317.27, 13.32), end
vector3(-2974.7, 380.15, 15.0),
vector3(-2959.01, 487.45, 15.46), local localTable = Loc[Config.Lan]
vector3(-2956.87, 487.36, 15.46), -- If Loc[..] doesn't exist, warn user
vector3(-3043.98, 594.32, 7.74), if not localTable then
vector3(-3241.35, 997.74, 12.55), print("Locale Table '"..Config.Lan.."' Not Found")
vector3(-1305.59, -706.64, 25.32), return "Locale Table '"..Config.Lan.."' Not Found"
vector3(-537.85, -854.69, 29.28), end
vector3(-709.98, -818.71, 23.73),
vector3(-712.87, -818.71, 23.73), -- If Loc[..].section doesn't exist, warn user
vector3(-526.71, -1223.18, 18.45), if not localTable[section] then
vector3(-256.47, -715.94, 33.55), print("^1Error^7: Locale Section: ['"..section.."'] Invalid")
vector3(-259.13, -723.29, 33.54), return "Locale Section: ['"..section.."'] Invalid"
vector3(-203.82, -861.3, 30.27), end
vector3(111.38, -774.96, 31.44),
vector3(114.56, -776.13, 31.42), -- If Loc[..].section.string doesn't exist, warn user
vector3(112.46, -819.65, 31.34), if not localTable[section][string] then
vector3(118.93, -883.68, 31.12), print("^1Error^7: Locale String: ['"..section.."']['"..string.."'] Invalid")
vector3(-846.97, -340.29, 38.68), return "Locale String: ['"..string.."'] Invalid"
vector3(-846.41, -341.41, 38.68), end
vector3(-262.21, -2012.17, 30.15),
vector3(-273.23, -2024.32, 30.15), -- If no issues, return the string
vector3(24.46, -945.94, 29.36), return localTable[section][string]
vector3(-254.48, -692.74, 33.61), end
vector3(-1569.95, -546.94, 34.96),
vector3(-1570.91, -547.63, 34.96),
vector3(289.14, -1282.29, 29.6),
vector3(289.18, -1256.84, 29.44),
vector3(296.04, -896.22, 29.24),
vector3(296.74, -894.26, 29.24),
vector3(-301.63, -829.73, 32.43),
vector3(-303.23, -829.44, 32.43),
vector3(5.27, -919.87, 29.56),
vector3(-1200.61, -885.62, 13.26),
},
BankLocations = {
["legion"] = {
vector4(149.5, -1042.08, 29.37, 342.74), -- Legion Fleeca
},
["hawick"] = {
vector4(313.81, -280.43, 54.16, 342.29), -- Hawick Fleeca
},
["vinewood"] = {
vector4(-351.4, -51.24, 49.04, 338.4), -- Vinewood Fleeca
},
["delperro"] = {
vector4(-1212.11, -332.01, 37.78, 25.33), -- Del Perro Fleeca
},
["route1"] = {
vector4(-2961.17, 482.9, 15.7, 84.68), -- Route 1 Fleeca
},
["route68"] = {
vector4(1175.03, 2708.2, 38.09, 180.0), -- Route 68 Fleeca
},
["paleto"] = {
vector4(-111.22, 6470.03, 31.63, 133.86), -- Paleto Bank
},
["pacific"] = {
vector4(243.58, 226.25, 106.29, 169.06), -- Pacific Bank Window 1
vector4(247.08, 224.98, 106.29, 157.75), -- Pacific Bank Window 2
},
},
}
-- If Gabz banks enabled, load these locations instead
if Config.Gabz then
Config.CashInLocation = vector4(269.28, 217.24, 106.28, 69.0)
Config.BankLocations = {
["legion"] = {
vector4(149.5, -1042.08, 29.37, 342.74), -- Legion Fleeca
},
["hawick"] = {
vector4(313.81, -280.43, 54.16, 342.29), -- Hawick Fleeca
},
["vinewood"] = {
vector4(-351.4, -51.24, 49.04, 338.4), -- Vinewood Fleeca
},
["delperro"] = {
vector4(-1212.11, -332.01, 37.78, 25.33), -- Del Perro Fleeca
},
["route1"] = {
vector4(-2961.17, 482.9, 15.7, 84.68), -- Route 1 Fleeca
},
["route68"] = {
vector4(1175.03, 2708.2, 38.09, 180.0), -- Route 68 Fleeca
},
["paleto"] = {
vector4(-110.72, 6469.82, 31.63, 222.94), -- Paleto Bank (GABZ) - 1
vector4(-108.98, 6471.56, 31.63, 222.92), -- Paleto Bank (GABZ) - 2
},
["pacific"] = {
vector4(258.55, 227.63, 106.28, 160.96), -- Pacficic Gabz 1+2
vector4(263.21, 225.93, 106.28, 158.25), -- Pacficic Gabz 3+4
vector4(267.95, 224.24, 106.28, 158.5), -- Pacficic Gabz 5+6
vector4(263.71, 212.63, 106.28, 337.53), -- Pacficic Gabz 7+8
vector4(259.02, 214.32, 106.28, 337.82), -- Pacficic Gabz 9+10
vector4(254.27, 216.06, 106.28, 336.37), -- Pacficic Gabz 11+12
},
}
Config.ATMLocations = {
vector3(239.02, 212.37, 106.28),
vector3(239.46, 213.6, 106.28),
vector3(239.9, 214.82, 106.28),
vector3(240.35, 216.03, 106.28),
vector3(241.42, 218.96, 106.28),
vector3(241.86, 220.16, 106.28),
vector3(242.3, 221.41, 106.28),
vector3(242.76, 222.63, 106.28),
vector3(263.46, 203.86, 106.28),
vector3(263.96, 205.03, 106.28),
vector3(264.37, 206.28, 106.28),
vector3(264.77, 207.51, 106.28),
}
end
Loc = {}

View File

@@ -1,11 +1,26 @@
name "Jim-Payments" name "Jim-Payments"
author "Jimathy" author "Jimathy"
version "v2.8.7" version "3.0.05"
description "Payment Script By Jimathy" description "Payment Script"
fx_version "cerulean" fx_version "cerulean"
game "gta5" game "gta5"
lua54 'yes' lua54 'yes'
shared_scripts { 'config.lua', 'shared/*.lua', 'locales/*.lua' } server_script '@oxmysql/lib/MySQL.lua'
client_scripts { 'client/*.lua', }
server_scripts { '@oxmysql/lib/MySQL.lua', 'server/*.lua' } shared_scripts {
'locales/*.lua',
'config.lua',
--Jim Bridge - https://github.com/jimathy/jim_bridge
'@jim_bridge/starter.lua',
'shared/*.lua',
}
client_scripts {
'client/*.lua',
}
server_script 'server/*.lua'
dependency 'jim_bridge'

BIN
images/terminal.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

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

View File

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

View File

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

View File

@@ -1,89 +1,124 @@
local function cv(amount) onResourceStart(function()
local formatted = amount registerCommand("cashgive", {
while true do locale("command" , "pay_user"), {}, false,
formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1,%2') function(source)
if (k==0) then TriggerClientEvent(getScript()..":client:ATM:give", source)
break end
end })
end
return formatted
end
RegisterServerEvent('jim-payments:server:ATM:use', function(amount, billtype, baccount, account, society, gsociety) createCallback(getScript()..":GetInfo", function(source)
local Player = getPlayer(source)
local society, gsociety = 0, 0
society = getSocietyAccount(Player.job)
if Player.gang ~= "none" then
gsociety = getSocietyAccount(Player.gang)
end
-- Savings account is only QBCore for now
if isStarted(QBExport) and not isStarted(QBXExport) then
-- 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, })
accountID = result[1].citizenid
savingBalance = result[1].account_balance
end
end
local retTable = {
name = Player.firstname..' '..Player.lastname,
cash = Player.cash,
bank = Player.bank,
account = Player.account,
cid = Player.citizenId.." ["..source.."]",
savbal = savingBalance,
aid = accountID,
society = society,
gsociety = gsociety
}
return retTable
end)
end, true)
RegisterServerEvent(getScript()..":server:ATM:use", function(amount, billtype, baccount, account, society, gsociety)
local src = source local src = source
local Player = QBCore.Functions.GetPlayer(src) local Player = getPlayer(src)
local cashB = Player.Functions.GetMoney("cash")
local bankB = Player.Functions.GetMoney("bank")
local amount = tonumber(amount) local amount = tonumber(amount)
local bankScript, newAmount = "", 0
--Simple transfers from bank to wallet -- --Simple transfers from bank to wallet --
if account == "bank" or account == "atm" then if account == "bank" or account == "atm" then
if billtype == "withdraw" then if billtype == "withdraw" then
if bankB < amount then triggerNotify(nil, Loc[Config.Lan].error["bank_low"], "error", src) if Player.bank < amount then
elseif bankB >= tonumber(amount) then triggerNotify(nil, locale("error" ,"bank_low"), "error", src)
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 elseif Player.bank >= tonumber(amount) then
Player.Functions.RemoveMoney('bank', amount) Wait(1500) 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
Player.Functions.AddMoney('cash', amount) chargePlayer(amount, "bank", src) Wait(1500)
fundPlayer(amount, "cash", src)
end end
elseif billtype == "deposit" then elseif billtype == "deposit" then
if cashB < amount then triggerNotify(nil, Loc[Config.Lan].error["no_cash"], "error", src) if Player.cash < amount then
elseif cashB >= amount then triggerNotify(nil, locale("error" ,"no_cash"), "error", src)
Player.Functions.RemoveMoney('cash', amount) Wait(1500) elseif Player.cash >= amount then
Player.Functions.AddMoney('bank', amount) chargePlayer(amount, "cash", src) Wait(1500)
triggerNotify(nil, Loc[Config.Lan].success["deposited"]..cv(amount)..Loc[Config.Lan].success["into_bank"], "success", src) fundPlayer(amount, "bank", 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 --
elseif account == "savings" then elseif account == "savings" then
local getSavingsAccount = MySQL.Sync.fetchAll('SELECT * FROM bank_accounts WHERE citizenid = ? AND account_type = ?', { Player.PlayerData.citizenid, 'Savings' }) local getSavingsAccount = MySQL.Sync.fetchAll('SELECT * FROM bank_accounts WHERE citizenid = ? AND account_name = ?', { Player.citizenId, 'Savings_'..Player.citizenId, })
if getSavingsAccount[1] ~= nil then savbal = tonumber(getSavingsAccount[1].amount) aid = getSavingsAccount[1].record_id end if getSavingsAccount[1] ~= nil then savbal = tonumber(getSavingsAccount[1].account_balance) aid = getSavingsAccount[1].citizenid end
if billtype == "withdraw" then if billtype == "withdraw" then
if savbal >= amount then if savbal >= amount then
savbal -= amount savbal -= amount
Player.Functions.AddMoney('bank', amount) 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 amount = ? WHERE citizenid = ? AND record_id = ?', { savbal, Player.PlayerData.citizenid, getSavingsAccount[1].record_id }, 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 < bankB then if amount < Player.bank then
savbal += amount savbal += amount
Player.Functions.RemoveMoney('bank', amount) 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 amount = ? WHERE citizenid = ? AND record_id = ?', { savbal, Player.PlayerData.citizenid, getSavingsAccount[1].record_id }, 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 triggerNotify(nil, Loc[Config.Lan].error["soc_low"], "error", src) if tonumber(society) < amount then
triggerNotify(nil, locale("error" ,"soc_low"), "error", src)
elseif tonumber(society) >= amount then elseif tonumber(society) >= amount then
triggerNotify(nil, Loc[Config.Lan].success["draw"]..cv(amount)..Loc[Config.Lan].success["fromthe"]..Player.PlayerData.job.label..Loc[Config.Lan].success["account"], "success", src)
Player.Functions.AddMoney('bank', amount) chargeSociety(Player.job, amount)
if Config.Banking == "renewed" then exports['Renewed-Banking']:removeAccountMoney(tostring(Player.PlayerData.job.name), amount) fundPlayer(amount, "bank", src)
elseif Config.Banking == "qb-management" then exports["qb-management"]:RemoveMoney(tostring(Player.PlayerData.job.name), amount)
elseif Config.Banking == "qb-banking" then exports["qb-banking"]:RemoveMoney(tostring(Player.PlayerData.job.name), amount) triggerNotify(nil, locale("success", "draw")..cv(amount)..locale("success", "fromthe")..Jobs[Player.job].label..locale("success" ,"account"), "success", src)
elseif Config.Banking == "fd" then exports.fd_banking:RemoveMoney(tostring(Player.PlayerData.job.name), amount) end
end end
elseif billtype == "deposit" then elseif billtype == "deposit" then
if bankB < 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 bankB >= amount then elseif Player.bank >= amount then
if Config.Banking == "renewed" then exports['Renewed-Banking']:addAccountMoney(tostring(Player.PlayerData.job.name), amount) fundSociety(Player.job, amount)
elseif Config.Banking == "qb-management" then exports["qb-management"]:AddMoney(tostring(Player.PlayerData.job.name), amount) chargePlayer(amount, "bank", src) Wait(1500)
elseif Config.Banking == "qb-banking" then exports["qb-banking"]:AddMoney(tostring(Player.PlayerData.job.name), amount) triggerNotify(nil, locale("success", "deposited")..cv(amount)..locale("success", "into")..Jobs[Player.job].label..locale("success", "account"), "success", src)
elseif Config.Banking == "fd" then exports.fd_banking:AddMoney(tostring(Player.PlayerData.job.name), amount) end
Player.Functions.RemoveMoney('bank', amount) Wait(1500)
triggerNotify(nil, Loc[Config.Lan].success["deposited"]..cv(amount)..Loc[Config.Lan].success["into"]..Player.PlayerData.job.label..Loc[Config.Lan].success["account"], "success", src)
end end
end end
-- Transfer from boss account to players -- -- Transfer from boss account to players --
--[[ disabled until i work out a system for other frameworks
elseif account == "societytransfer" then elseif account == "societytransfer" then
local bannedCharacters = {'%','$',';'} local bannedCharacters = {'%','$',';'}
local newAmount = tostring(amount) local newAmount = tostring(amount)
@@ -95,50 +130,53 @@ RegisterServerEvent('jim-payments:server:ATM:use', function(amount, billtype, ba
baccount = newiban baccount = newiban
amount = tonumber(newAmount) amount = tonumber(newAmount)
local Player = QBCore.Functions.GetPlayer(src) local Player = Core.Functions.GetPlayer(src)
if (society - amount) >= 0 then if (society - amount) >= 0 then
local query = '%"account":"' .. baccount .. '"%' local query = '%"account":"' .. baccount .. '"%'
local result = MySQL.Sync.fetchAll('SELECT * FROM players WHERE charinfo LIKE ?', {query}) local result = MySQL.Sync.fetchAll('SELECT * FROM players WHERE charinfo LIKE ?', {query})
if result[1] then if result[1] then
local Reciever = QBCore.Functions.GetPlayerByCitizenId(result[1].citizenid) local Reciever = Core.Functions.GetPlayerByCitizenId(result[1].citizenid)
if Config.Banking == "renewed" then exports['Renewed-Banking']:removeAccountMoney(tostring(Player.PlayerData.job.name), amount) if Config.Banking == "renewed" then
elseif Config.Banking == "qb-management" then exports["qb-management"]:RemoveMoney(tostring(Player.PlayerData.job.name), amount) exports['Renewed-Banking']:removeAccountMoney(tostring(Player.PlayerData.job.name), amount)
elseif Config.Banking == "qb-banking" then exports["qb-banking"]:RemoveMoney(tostring(Player.PlayerData.job.name), amount) elseif Config.Banking == "qb-management" then
elseif Config.Banking == "fd" then exports.fd_banking:RemoveMoney(tostring(Player.PlayerData.job.name), amount) end exports["qb-management"]:RemoveMoney(tostring(Player.PlayerData.job.name), amount)
elseif Config.Banking == "qb-banking" then
exports["qb-banking"]:RemoveMoney(tostring(Player.PlayerData.job.name), amount)
elseif Config.Banking == "fd" then
exports.fd_banking:RemoveMoney(tostring(Player.PlayerData.job.name), amount)
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]]
--Simple transfers from gang society account to bank -- --Simple transfers from gang society account to bank --
elseif account == "gang" then elseif account == "gang" then
if billtype == "withdraw" then if billtype == "withdraw" then
if tonumber(gsociety) < amount then triggerNotify(nil, Loc[Config.Lan].error["soc_low"], "error", src) if tonumber(gsociety) < amount then
triggerNotify(nil, locale("error" ,"soc_low"), "error", src)
elseif tonumber(gsociety) >= amount then elseif tonumber(gsociety) >= amount then
triggerNotify(nil, Loc[Config.Lan].success["draw"]..cv(amount)..Loc[Config.Lan].success["fromthe"]..Player.PlayerData.gang.label..Loc[Config.Lan].success["account"], "success", src) chargeSociety(Player.gang, amount)
Player.Functions.AddMoney('bank', amount)
if Config.Banking == "renewed" then exports['Renewed-Banking']:removeAccountMoney(tostring(Player.PlayerData.gang.name), amount)
elseif Config.Banking == "qb-management" then exports["qb-management"]:RemoveGangMoney(tostring(Player.PlayerData.gang.name), amount)
elseif Config.Banking == "qb-banking" then exports["qb-banking"]:RemoveGangMoney(tostring(Player.PlayerData.gang.name), amount)
elseif Config.Banking == "fd" then exports.fd_banking:RemoveGangMoney(tostring(Player.PlayerData.gang.name), amount) end
end end
fundPlayer(amount, "bank", 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 bankB < amount then triggerNotify(nil, Loc[Config.Lan].error["nomoney_bank"], "error", src) if Player.bank < amount then
elseif bankB >= amount then triggerNotify(nil, locale("error" ,"nomoney_bank"), "error", src)
if Config.Banking == "rewnewed" then exports['Renewed-Banking']:addAccountMoney(tostring(Player.PlayerData.gang.name), amount) elseif Player.bank >= amount then
elseif Config.Banking == "qb-management" then exports["qb-management"]:AddGangMoney(tostring(Player.PlayerData.gang.name), amount) fundSociety(Player.gang, amount)
elseif Config.Banking == "qb-banking" then exports["qb-banking"]:AddGangMoney(tostring(Player.PlayerData.gang.name), amount) chargePlayer(amount, "bank", Player.source) Wait(1500)
elseif Config.Banking == "fd" then exports.fd_banking:AddGangMoney(tostring(Player.PlayerData.gang.name), amount) end triggerNotify(nil, locale("success" ,"deposited")..cv(amount)..locale("success" ,"into")..Gangs[Player.gang].label..locale("success" ,"account"), "success", src)
Player.Functions.RemoveMoney('bank', amount) Wait(1500)
triggerNotify(nil, Loc[Config.Lan].success["deposited"]..cv(amount)..Loc[Config.Lan].success["into"]..Player.PlayerData.gang.label..Loc[Config.Lan].success["account"], "success", src)
end end
end end
-- Transfer from gang account to players -- -- Transfer from gang account to players --
@@ -153,26 +191,23 @@ RegisterServerEvent('jim-payments:server:ATM:use', function(amount, billtype, ba
baccount = newiban baccount = newiban
amount = tonumber(newAmount) amount = tonumber(newAmount)
local Player = QBCore.Functions.GetPlayer(src) local Player = Core.Functions.GetPlayer(src)
if (gsociety - amount) >= 0 then if (gsociety - amount) >= 0 then
local query = '%"account":"' .. baccount .. '"%' local query = '%"account":"' .. baccount .. '"%'
local result = MySQL.Sync.fetchAll('SELECT * FROM players WHERE charinfo LIKE ?', {query}) local result = MySQL.Sync.fetchAll('SELECT * FROM players WHERE charinfo LIKE ?', {query})
if result[1] then if result[1] then
local Reciever = QBCore.Functions.GetPlayerByCitizenId(result[1].citizenid) local Reciever = Core.Functions.GetPlayerByCitizenId(result[1].citizenid)
if Config.Banking == "renewed" then exports['Renewed-Banking']:removeAccountMoney(tostring(Player.PlayerData.gang.name), amount) chargeSociety(Player.PlayerData.gang.nameg, amount)
elseif Config.Banking == "qb-management" then exports["qb-management"]:RemoveGangMoney(tostring(Player.PlayerData.gang.name), amount)
elseif Config.Banking == "qb-banking" then exports["qb-banking"]:RemoveGangMoney(tostring(Player.PlayerData.gang.name), amount)
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
@@ -188,103 +223,44 @@ RegisterServerEvent('jim-payments:server:ATM:use', function(amount, billtype, ba
baccount = newiban baccount = newiban
amount = tonumber(newAmount) amount = tonumber(newAmount)
local Player = QBCore.Functions.GetPlayer(src) local Player = Core.Functions.GetPlayer(src)
if (Player.PlayerData.money.bank - amount) >= 0 then if (Player.PlayerData.money.bank - amount) >= 0 then
local query = '%"account":"' .. baccount .. '"%' local query = '%"account":"' .. baccount .. '"%'
local result = MySQL.Sync.fetchAll('SELECT * FROM players WHERE charinfo LIKE ?', {query}) local result = MySQL.Sync.fetchAll('SELECT * FROM players WHERE charinfo LIKE ?', {query})
if result[1] then if result[1] then
local Reciever = QBCore.Functions.GetPlayerByCitizenId(result[1].citizenid) local Reciever = Core.Functions.GetPlayerByCitizenId(result[1].citizenid)
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
end) end)
QBCore.Functions.CreateCallback('jim-payments:ATM:Find', function(source, cb) RegisterServerEvent(getScript()..":server:ATM:give", function(citizen, price)
local Player = QBCore.Functions.GetPlayer(source) local Player = getPlayer(source)
local name = Player.PlayerData.charinfo.firstname..' '..Player.PlayerData.charinfo.lastname local Reciever = getPlayer(tonumber(citizen))
local cid = Player.PlayerData.citizenid.." ["..source.."]"
local cash = Player.Functions.GetMoney("cash")
local bank = Player.Functions.GetMoney("bank")
local account = Player.PlayerData.charinfo.account
local society = 0
local gsociety = 0
if Config.Banking == "qb-banking" then
local result = MySQL.Sync.fetchAll('SELECT * FROM bank_accounts')
for _, v in pairs(result) do
if Player.PlayerData.job.name == v.job_name then society = v.amount end
end
if Player.PlayerData.gang.name ~= "none" then
for _, v in pairs(result) do
if Player.PlayerData.gang.name == v.job_name then gsociety = v.amount end
end
end
-- If qb-management, grab info directly from database
elseif not Config.Banking == "renewed" then
local result = MySQL.Sync.fetchAll('SELECT * FROM management_funds')
for _, v in pairs(result) do
if Player.PlayerData.job.name == v.job_name then society = v.amount end
end
if Player.PlayerData.gang.name ~= "none" then
for _, v in pairs(result) do
if Player.PlayerData.gang.name == v.job_name then gsociety = v.amount end
end
end
else
end
-- Grab Savings account info
local result = MySQL.Sync.fetchAll('SELECT * FROM bank_accounts WHERE citizenid = ? AND account_type = ?', { Player.PlayerData.citizenid, 'Savings' })
if result[1] then
accountID = result[1].record_id
savingBalance = result[1].amount
else
MySQL.Async.insert('INSERT INTO bank_accounts (citizenid, amount, account_type) VALUES (?, ?, ?)', { Player.PlayerData.citizenid, 0, 'Savings' }, function() completed = true end) repeat Wait(0) until completed == true
local result = MySQL.Sync.fetchAll('SELECT * FROM bank_accounts WHERE citizenid = ? AND account_type = ?', { Player.PlayerData.citizenid, 'Savings' })
aid = result[1].record_id
savingBalance = result[1].amount
end
cb({name = name,
cash = cash,
bank = bank,
account = account,
cid = cid,
savbal = savingBalance,
aid = accountID,
society = society,
gsociety = gsociety})
end)
QBCore.Commands.Add("cashgive", Loc[Config.Lan].command["pay_user"], {}, false, function(source) TriggerClientEvent("jim-payments:client:ATM:give", source) end)
RegisterServerEvent("jim-payments:server:ATM:give", function(citizen, price)
local Player = QBCore.Functions.GetPlayer(source)
local Reciever = QBCore.Functions.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)

99
server/chargerserver.lua Normal file
View File

@@ -0,0 +1,99 @@
onResourceStart(function()
for k in pairs(Config.Receipts.Jobs) do
while not Jobs do Wait(10) end
if not Jobs[k] and not Gangs[k] then
debugPrint("^1Error^7: ^5Config^7.^5Receipts^7.^5Jobs ^2searched for job/gang ^7'^3"..k.."^7' ^2and couldn't find it in the Shared^7")
end
end
if Items and not Items["payticket"] then
debugPrint("^1Error^7: ^2Unable to find ^7'^3payticket^7' ^2item it in the Shared^7")
end
for _, v in pairs({"cashregister", "terminal"}) do
registerCommand(v, {
locale("command", "cash_reg"), {}, false,
function(source)
TriggerClientEvent(getScript()..":client:Charge", source, {}, true)
end
})
end
if Items["terminal"] then
createUseableItem("terminal", function(source, item)
TriggerClientEvent(getScript()..":client:Charge", source, {}, true)
end)
end
createCallback(getScript()..":MakePlayerList", function(source)
local onlineList = {}
for _, v in pairs(GetPlayers()) do
if v ~= nil or type(v) ~= "number" then
local Player = getPlayer(v)
if Player.name then
onlineList[#onlineList+1] = { value = tonumber(v), text = "["..v.."] - "..Player.name }
end
Wait(10)
end
end
return onlineList
end)
end, true)
RegisterServerEvent(getScript()..":server:Charge", function(citizen, price, billtype, img, outside, gang)
local src = source
local biller = getPlayer(src)
local billed = getPlayer(tonumber(citizen))
local amount = tonumber(price)
local balance = billed[billtype]
if amount and amount > 0 then
if balance < amount then
triggerNotify(nil, locale("error", "customer_nocash"), "error", src)
triggerNotify(nil, locale("error", "you_nocash"), "error", tonumber(citizen))
return
end
local label = gang == true and Gangs[biller.gang].label or Jobs[biller.job].label
if Config.General.PhoneBank == false or gang == true or billtype == "cash" then
TriggerClientEvent(getScript()..":client:PayPopup", billed.source, amount, src, billtype, img, label, gang, outside)
else
if sendPhoneInvoice({
src = billed.source,
amount = amount,
billedCitizenid = billed.citizenId,
job = biller.job,
name = biller.firstname,
billerCitizenid = biller.citizenId,
label = label,
}) then
triggerNotify(nil, locale("success", "inv_succ"), 'success', src)
triggerNotify(nil, locale("success", "inv_recieved"), nil, billed.source)
else
end
end
else triggerNotify(nil, locale("error", "charge_zero"), 'error', source) return end
end)
RegisterServerEvent(getScript()..":server:PayPopup", function(data)
local src = source
local billed = getPlayer(src)
local biller = getPlayer(tonumber(data.biller))
local newdata = {
senderCitizenId = biller.citizenid,
society = data.gang and biller.gang or biller.job,
amount = data.amount
}
if data.accept then
chargePlayer(data.amount, data.billtype, src)
if Config.General.ApGov then
exports['ap-government']:chargeCityTax(billed.source, "Item", data.amount)
end
TriggerEvent(getScript()..":Tickets:Give", newdata, biller, data.gang)
triggerNotify(nil, billed.firstname..locale("success", "accepted_pay")..data.amount..locale("success", "payment"), "success", data.biller)
elseif not data.accept then
triggerNotify(nil, locale("success", "declined"), "error", src)
triggerNotify(nil, billed.firstname..locale("error", "decline_pay")..data.amount..locale("success", "payment"), "error", data.biller)
end
end)

100
server/polchargeserver.lua Normal file
View File

@@ -0,0 +1,100 @@
onResourceStart(function()
registerCommand("polcharge", {
locale("command", "charge"), {}, false,
function(source)
TriggerClientEvent(getScript()..":client:PolCharge", source)
end
})
end, true)
RegisterServerEvent(getScript()..":server:PolCharge", function(citizen, price)
local src = source
local biller = getPlayer(src)
local billed = getPlayer(tonumber(citizen))
local price = math.floor(tonumber(price))
local commPercent = Config.PolCharge.FineJobs[biller.job] and Config.PolCharge.FineJobs[biller.job].Commission or 0.25
local commission = math.floor(price * commPercent)
if price > 0 then
if not Config.PolCharge.FineJobConfirmation then
polCharge({
biller = biller,
billed = billed,
price = price,
commission = commission,
billerJob = tostring(biller.job),
amountChange = (price - commission)
})
triggerNotify(nil, billed.firstname..locale("success", "charged")..(price - commission), "success", src)
triggerNotify(nil, locale("success", "you_charged")..(price - commission), nil, billed.source)
else
TriggerClientEvent(getScript()..":client:PolPopup", billed.source, price, src, biller.job, commPercent)
end
else triggerNotify(nil, locale("error", "charge_zero"), 'error', source) return end
end)
RegisterServerEvent(getScript()..":server:PolPopup", function(data)
local src = source
local billed = getPlayer(src)
local biller = getPlayer(tonumber(data.biller))
local price = math.floor(data.amount)
local commission = math.floor(tonumber(data.amount) * data.commPercent)
if data.accept then
polCharge({
biller = biller,
billed = billed,
price = price,
commission = commission,
billerJob = tostring(biller.job),
amountChange = (price - commission)
})
elseif not data.accept then
triggerNotify(nil, locale("error", "declined_payment"), nil, src)
triggerNotify(nil, billed.PlayerData.charinfo.firstname.." declined the $"..data.amount..locale("success", "charge_end"), "error", data.biller)
end
end)
function polCharge(data)
local billedSource, billerSource, newAmount = data.billed.source, data.biller.source, 0
local bankScript = nil
chargePlayer(data.price, "bank", billedSource)
debugPrint("^5Debug^7: ^3PolCharge^7 - ^2Player^7(^6"..billedSource.."^7) ^2charged ^7$^6"..data.price.."^7")
if Config.ApGov then
exports['ap-government']:chargeCityTax(billedSource, "Item", data.price)
end
fundPlayer(data.commission, "bank", billerSource)
debugPrint("^5Debug^7: ^3PolCharge^7 - ^2Commission of ^7$^6"..data.commission.." ^2sent to Player^7(^6"..billerSource.."^7)")
if isStarted("Renewed-Banking") then
bankScript = "Renewed-Banking"
exports["Renewed-Banking"]:addAccountMoney(data.billerJob, data.amountChange)
newAmount = exports["Renewed-Banking"]:getAccountMoney(data.billerJob)
elseif isStarted("qb-banking") then
bankScript = "qb-banking"
exports["qb-banking"]:AddMoney(data.billerJob, data.amountChange, "Cash Register Payment")
newAmount = exports["qb-banking"]:GetAccountBalance(data.billerJob)
elseif isStarted("fd_banking") then
bankScript = "fd_banking"
if gang then
exports["fd_banking"]:AddGangMoney(data.billerJob, data.amountChange)
newAmount = exports["fd_banking"]:GetGangAccount(data.billerJob)
else
exports["fd_banking"]:AddMoney(data.billerJob, data.amountChange)
newAmount = exports["fd_banking"]:GetAccount(data.billerJob)
end
elseif isStarted("okokBanking") then
bankScript = "okokBanking"
exports['okokBanking']:AddMoney(data.billerJob, data.amountChange)
newAmount = exports['okokBanking']:GetAccount(data.billerJob)
end
debugPrint("^5Debug^7: ^3"..bankScript.."^7(^3Job^7): ^2Adding ^7$"..data.amountChange.." ^2to account ^7'^6"..data.billerJob.."^7' ($"..newAmount..")")
end

View File

@@ -1,276 +0,0 @@
local function cv(amount)
local formatted = amount
while true do formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1,%2') if (k==0) then break end Wait(0) end
return formatted
end
AddEventHandler('onResourceStart', function(resource) if GetCurrentResourceName() ~= resource then return end
for k in pairs(Config.Jobs) do
if not QBCore.Shared.Jobs[k] and not QBCore.Shared.Gangs[k] then
print("Jim-Payments: Config.Jobs searched for job/gang '"..k.."' and couldn't find it in the Shared")
end
end
end)
CreateThread(function()
if Config.Enablecommand then
QBCore.Commands.Add("cashregister", Loc[Config.Lan].command["cash_reg"], {}, false, function(source) TriggerClientEvent("jim-payments:client:Charge", source, {}, true) end)
end
end)
QBCore.Commands.Add("polcharge", Loc[Config.Lan].command["charge"], {}, false, function(source) TriggerClientEvent("jim-payments:client:PolCharge", source) end)
RegisterServerEvent('jim-payments:Tickets:Give', function(data, biller, gang)
local billed = QBCore.Functions.GetPlayer(source) -- This should always be from the person who accepted the payment
local takecomm = math.floor(tonumber(data.amount) * Config.Jobs[data.society].Commission)
if biller then -- If this is found, it ISN'T a phone payment, so add money to society here
if gang then
if Config.Banking == "renewed" then
exports['Renewed-Banking']:addAccountMoney(tostring(biller.PlayerData.gang.name), data.amount - takecomm)
if Config.Debug then
print("^5Debug^7: ^3Renewed-Banking^7(^3Gang^7): ^2Adding ^7$^6"..data.amount - takecomm.." ^2to account ^7'^6"..tostring(biller.PlayerData.gang.name).."^7' ($^6"..exports['Renewed-Banking']:getAccountMoney(biller.PlayerData.gang.name).."^7)") end
elseif Config.Banking == "qb-management" then
exports["qb-management"]:AddGangMoney(tostring(biller.PlayerData.gang.name), data.amount - takecomm)
if Config.Debug then print("^5Debug^7: ^3QB-Management^7(^3Gang^7): ^2Adding ^7$^6"..data.amount - takecomm.." ^2to account ^7'^6"..tostring(biller.PlayerData.gang.name).."^7' ($^6"..exports["qb-management"]:GetGangAccount(biller.PlayerData.gang.name).."^7)") end
elseif Config.Banking == "qb-banking" then
exports["qb-banking"]:AddGangMoney(tostring(biller.PlayerData.gang.name), data.amount - takecomm)
if Config.Debug then print("^5Debug^7: ^3QB-Banking^7(^3Gang^7): ^2Adding ^7$^6"..data.amount - takecomm.." ^2to account ^7'^6"..tostring(biller.PlayerData.gang.name).."^7' ($^6"..exports["qb-banking"]:GetGangAccount(biller.PlayerData.gang.name).."^7)") end
elseif Config.Banking == "fd" then
exports.fd_banking:AddGangMoney(tostring(biller.PlayerData.gang.name), data.amount - takecomm)
if Config.Debug then print("^5Debug^7: ^3FD-Banking^7(^3Gang^7): ^2Adding ^7$^6"..data.amount - takecomm.." ^2to account ^7'^6"..tostring(biller.PlayerData.gang.name).."^7' ($^6"..exports.fd_banking:GetGangAccount(biller.PlayerData.gang.name).."^7)") end
end
elseif not gang then
if Config.Banking == "renewed"
then exports['Renewed-Banking']:addAccountMoney(tostring(biller.PlayerData.job.name), data.amount - takecomm)
if Config.Debug then print("^5Debug^7: ^3Renewed-Banking^7(^3Job^7): ^2Adding ^7$^6"..data.amount - takecomm.." ^2to account ^7'^6"..tostring(biller.PlayerData.job.name).."^7' ($^6"..tostring(exports['Renewed-Banking']:getAccountMoney(biller.PlayerData.job.name)).."^7)") end
elseif Config.Banking == "qb-management" then
exports["qb-management"]:AddMoney(tostring(biller.PlayerData.job.name), data.amount - takecomm)
if Config.Debug then print("^5Debug^7: ^3QB-Management^7(^3Job^7): ^2Adding ^7$^6"..data.amount - takecomm.." ^2to account ^7'^6"..tostring(biller.PlayerData.job.name).."^7' ($^6"..exports["qb-management"]:GetAccount(biller.PlayerData.job.name).."^7)") end
elseif Config.Banking == "qb-banking" then
exports["qb-banking"]:AddMoney(tostring(biller.PlayerData.job.name), data.amount - takecomm)
if Config.Debug then print("^5Debug^7: ^3QB-Banking^7(^3Job^7): ^2Adding ^7$^6"..data.amount - takecomm.." ^2to account ^7'^6"..tostring(biller.PlayerData.job.name).."^7' ($^6^7)") end
elseif Config.Banking == "fd" then
exports.fd_banking:AddMoney(tostring(biller.PlayerData.job.name), data.amount - takecomm)
if Config.Debug then print("^5Debug^7: ^3FD-Banking^7(^3Job^7): ^2Adding ^7$^6"..data.amount - takecomm.." ^2to account ^7'^6"..tostring(biller.PlayerData.job.name).."^7' ($^6"..exports.fd_banking:GetAccount(biller.PlayerData.job.name).."^7)") end
end
end
elseif not biller then --Find the biller from their citizenid
for _, v in pairs(QBCore.Functions.GetPlayers()) do
local Player = QBCore.Functions.GetPlayer(v)
if Player.PlayerData.citizenid == data.senderCitizenId then biller = Player end
end
triggerNotify(nil, data.sender..Loc[Config.Lan].success["invoice_start"]..data.amount..Loc[Config.Lan].success["invoice_end"], "success", biller.PlayerData.source)
end
-- If ticket system enabled, do this
if (biller.PlayerData.job.onduty or gang) and Config.TicketSystem then
if data.amount >= Config.Jobs[data.society].MinAmountforTicket then
if Config.TicketSystemAll then
for _, v in pairs(QBCore.Functions.GetPlayers()) do
local Player = QBCore.Functions.GetPlayer(v)
if Player ~= nil or Player ~= billed then
if gang then
if Player.PlayerData.gang.name == data.society then
if Player.Functions.AddItem('payticket', 1) then TriggerClientEvent('inventory:client:ItemBox', Player.PlayerData.source, QBCore.Shared.Items['payticket'], "add", 1) end
triggerNotify(nil, Loc[Config.Lan].success["rec_rec"], 'success', Player.PlayerData.source)
end
else
if Player.PlayerData.job.name == data.society and Player.PlayerData.job.onduty then
if Player.Functions.AddItem('payticket', 1) then TriggerClientEvent('inventory:client:ItemBox', Player.PlayerData.source, QBCore.Shared.Items['payticket'], "add", 1) end
triggerNotify(nil, Loc[Config.Lan].success["rec_rec"], 'success', Player.PlayerData.source)
end
end
end
end
else
if biller.Functions.AddItem('payticket', 1) then TriggerClientEvent('inventory:client:ItemBox', biller.PlayerData.source, QBCore.Shared.Items['payticket'], "add", 1) end
triggerNotify(nil, Loc[Config.Lan].success["rec_rec"], 'success', biller.PlayerData.source)
end
end
end
-- Commission section, does each config option separately
local comm = tonumber(Config.Jobs[data.society].Commission)
if Config.Commission and comm ~= 0 then
if Config.CommissionLimit and data.amount < Config.Jobs[data.society].MinAmountforTicket then return end
if Config.CommissionDouble then
biller.Functions.AddMoney("bank", math.floor(tonumber(data.amount) * (comm *2)))
triggerNotify(nil, Loc[Config.Lan].success["recieved"]..math.floor(tonumber(data.amount) * (comm *2))..Loc[Config.Lan].success["commission"], "success", biller.PlayerData.source)
else biller.Functions.AddMoney("bank", math.floor(tonumber(data.amount) *comm))
triggerNotify(nil, Loc[Config.Lan].success["recieved"]..math.floor(tonumber(data.amount) * comm)..Loc[Config.Lan].success["commission"], "success", biller.PlayerData.source)
end
if Config.CommissionAll then
for _, v in pairs(QBCore.Functions.GetPlayers()) do
local Player = QBCore.Functions.GetPlayer(v)
if Player and Player ~= biller then
if Player.PlayerData.job.name == data.society and Player.PlayerData.job.onduty then
Player.Functions.AddMoney("bank", math.floor(tonumber(data.amount) * comm))
triggerNotify(nil, Loc[Config.Lan].success["recieved"]..math.floor(tonumber(data.amount) * comm)..Loc[Config.Lan].success["commission"], "success", Player.PlayerData.source)
end
end
end
end
end
end)
RegisterServerEvent('jim-payments:Tickets:Sell', function()
local Player = QBCore.Functions.GetPlayer(source)
if not Player.Functions.GetItemByName("payticket") then triggerNotify(nil, Loc[Config.Lan].error["no_ticket_to"], 'error', source) return
else
tickets = Player.Functions.GetItemByName("payticket").amount
Player.Functions.RemoveItem('payticket', tickets)
pay = (tickets * Config.Jobs[Player.PlayerData.job.name].PayPerTicket)
Player.Functions.AddMoney('bank', pay, 'ticket-payment')
TriggerClientEvent('inventory:client:ItemBox', source, QBCore.Shared.Items['payticket'], "remove", tickets)
triggerNotify(nil, Loc[Config.Lan].success["trade_ticket_start"]..tickets..Loc[Config.Lan].success["trade_ticket_end"]..cv(pay), 'success', source)
end
end)
QBCore.Functions.CreateCallback('jim-payments:Ticket:Count', function(source, cb)
cb(QBCore.Functions.GetPlayer(source).Functions.GetItemByName('payticket'))
end)
RegisterServerEvent("jim-payments:server:Charge", function(citizen, price, billtype, img, outside, gang)
local src = source
local biller = QBCore.Functions.GetPlayer(src)
local billed = QBCore.Functions.GetPlayer(tonumber(citizen))
local amount = tonumber(price)
local balance = billed.Functions.GetMoney(billtype)
if amount and amount > 0 then
if balance < amount then
triggerNotify(nil, Loc[Config.Lan].error["customer_nocash"], "error", src)
triggerNotify(nil, Loc[Config.Lan].error["you_nocash"], "error", tonumber(citizen))
return
end
local label = biller.PlayerData.job.label
if gang == true then label = biller.PlayerData.gang.label end
if Config.PhoneBank == false or gang == true or billtype == "cash" then
TriggerClientEvent("jim-payments:client:PayPopup", billed.PlayerData.source, amount, src, billtype, img, label, gang, outside)
else
if Config.PhoneType == "qb" then
MySQL.Async.insert(
'INSERT INTO phone_invoices (citizenid, amount, society, sender, sendercitizenid) VALUES (?, ?, ?, ?, ?)',
{billed.PlayerData.citizenid, amount, biller.PlayerData.job.name, biller.PlayerData.charinfo.firstname, biller.PlayerData.citizenid}, function(id)
if id then
TriggerClientEvent('qb-phone:client:AcceptorDenyInvoice', billed.PlayerData.source, id, biller.PlayerData.charinfo.firstname, biller.PlayerData.job.name, biller.PlayerData.citizenid, amount, GetInvokingResource())
end
end)
TriggerClientEvent('qb-phone:RefreshPhone', billed.PlayerData.source)
elseif Config.PhoneType == "gks" then
MySQL.Async.execute('INSERT INTO gksphone_invoices (citizenid, amount, society, sender, sendercitizenid, label) VALUES (@citizenid, @amount, @society, @sender, @sendercitizenid, @label)', {
['@citizenid'] = billed.PlayerData.citizenid,
['@amount'] = amount,
['@society'] = biller.PlayerData.job.name,
['@sender'] = biller.PlayerData.charinfo.firstname,
['@sendercitizenid'] = biller.PlayerData.citizenid,
['@label'] = biller.PlayerData.job.label,
})
TriggerClientEvent('gksphone:notifi', src, {title = 'Billing', message = Loc[Config.Lan].success["inv_succ"], img= '/html/static/img/icons/logo.png' })
TriggerClientEvent('gksphone:notifi', billed.PlayerData.source, {title = 'Billing', message = Loc[Config.Lan].success["inv_recieved"], img= '/html/static/img/icons/logo.png' })
end
triggerNotify(nil, Loc[Config.Lan].success["inv_succ"], 'success', src)
triggerNotify(nil, Loc[Config.Lan].success["inv_recieved"], nil, billed.PlayerData.source)
end
else triggerNotify(nil, Loc[Config.Lan].error["charge_zero"], 'error', source) return end
end)
RegisterServerEvent("jim-payments:server:PayPopup", function(data)
local src = source
local billed = QBCore.Functions.GetPlayer(src)
local biller = QBCore.Functions.GetPlayer(tonumber(data.biller))
local newdata = { senderCitizenId = biller.PlayerData.citizenid, society = biller.PlayerData.job.name, amount = data.amount }
if data.gang == true then newdata.society = biller.PlayerData.gang.name end
if data.accept == true then
billed.Functions.RemoveMoney(tostring(data.billtype), data.amount)
if Config.ApGov then exports['ap-government']:chargeCityTax(billed.PlayerData.source, "Item", data.amount) end
TriggerEvent('jim-payments:Tickets:Give', newdata, biller, data.gang)
triggerNotify(nil, billed.PlayerData.charinfo.firstname..Loc[Config.Lan].success["accepted_pay"]..data.amount..Loc[Config.Lan].success["payment"], "success", data.biller)
elseif data.accept == false then
triggerNotify(nil, Loc[Config.Lan].success["declined"], nil, src)
triggerNotify(nil, billed.PlayerData.charinfo.firstname..Loc[Config.Lan].error["decline_pay"]..data.amount..Loc[Config.Lan].success["payment"], "error", data.biller)
end
end)
RegisterServerEvent("jim-payments:server:PolCharge", function(citizen, price)
local src = source
local biller = QBCore.Functions.GetPlayer(src)
local billed = QBCore.Functions.GetPlayer(tonumber(citizen))
local price = math.floor(tonumber(price))
local commission = math.floor(price * Config.FineJobs[biller.PlayerData.job.name].Commission)
if price > 0 then
if not Config.FineJobConfirmation then
if billed.Functions.RemoveMoney("bank", price) then if Config.Debug then print("^5Debug^7: ^3PolCharge^7 - ^2Player^7(^6"..billed.PlayerData.source.."^7) ^2charged ^7$^6"..price.."^7") end end
if Config.ApGov then exports['ap-government']:chargeCityTax(billed.PlayerData.source, "Item", price) end
if biller.Functions.AddMoney("bank", commission) then if Config.Debug then print("^5Debug^7: ^3PolCharge^7 - ^2Commission of ^7$^6"..commission.." ^2sent to Player^7(^6"..biller.PlayerData.source.."^7)") end end
if Config.Banking == "renewed" then
exports['Renewed-Banking']:addAccountMoney(tostring(biller.PlayerData.job.name), (price - commission))
if Config.Debug then print("^5Debug^7: ^3Renewed-Banking^7(^3Job^7): ^2Adding ^7$^6"..(price - commission).." ^2to account ^7'^6"..tostring(biller.PlayerData.job.name).."^7' ($^6"..exports['Renewed-Banking']:getAccountMoney((biller.PlayerData.job.name).."^7)")) end
elseif Config.Banking == "qb-management" then
exports["qb-management"]:AddMoney(tostring(biller.PlayerData.job.name), (price - commission))
if Config.Debug then print("^5Debug^7: ^3QB-Management^7(^3Job^7): ^2Adding ^7$^6"..(price - takecomm).." ^2to account ^7'^6"..tostring(biller.PlayerData.job.name).."^7' ($^6"..exports["qb-management"]:GetAccount(biller.PlayerData.job.name).."^7)") end
elseif Config.Banking == "qb-banking" then
exports["qb-banking"]:AddMoney(tostring(biller.PlayerData.job.name), (price - commission))
if Config.Debug then print("^5Debug^7: ^3QB-Banking^7(^3Job^7): ^2Adding ^7$^6"..(price - takecomm).." ^2to account ^7'^6"..tostring(biller.PlayerData.job.name).."^7' ($^6"..exports["qb-banking"]:GetAccount(biller.PlayerData.job.name).."^7)") end
elseif Config.Banking == "fd" then
exports.fd_banking:AddMoney(tostring(biller.PlayerData.job.name), (price - commission))
if Config.Debug then print("^5Debug^7: ^3QB-Banking^7(^3Job^7): ^2Adding ^7$^6"..(price - takecomm).." ^2to account ^7'^6"..tostring(biller.PlayerData.job.name).."^7' ($^6"..exports.fd_banking:GetAccount(biller.PlayerData.job.name).."^7)") end
end
triggerNotify(nil, billed.PlayerData.charinfo.firstname..Loc[Config.Lan].success["charged"]..(price - commission), "success", src)
triggerNotify(nil, Loc[Config.Lan].success["you_charged"]..(price - commission), nil, billed.PlayerData.source)
else
TriggerClientEvent("jim-payments:client:PolPopup", billed.PlayerData.source, price, src, biller.PlayerData.job.label)
end
else triggerNotify(nil, Loc[Config.Lan].error["charge_zero"], 'error', source) return end
end)
RegisterServerEvent("jim-payments:server:PolPopup", function(data)
local src = source
local billed = QBCore.Functions.GetPlayer(src)
local biller = QBCore.Functions.GetPlayer(tonumber(data.biller))
data.amount = math.floor(data.amount)
local commission = math.floor(tonumber(data.amount) * Config.FineJobs[biller.PlayerData.job.name].Commission)
if data.accept == true then
if billed.Functions.RemoveMoney("bank", data.amount) then if Config.Debug then print("^5Debug^7: ^3PolCharge^7 - ^2Player^7(^6"..billed.PlayerData.source.."^7) ^2charged ^7$^6"..data.amount.."^7") end end
if Config.ApGov then exports['ap-government']:chargeCityTax(billed.PlayerData.source, "Item", data.amount) end
triggerNotify(nil, billed.PlayerData.charinfo.firstname..Loc[Config.Lan].success["accepted_pay"]..data.amount..Loc[Config.Lan].success["charge_end"], "success", data.biller)
if biller.Functions.AddMoney("bank", commission) then if Config.Debug then print("^5Debug^7: ^3PolCharge^7 - ^2Commission^2 of ^7$^6"..commission.." ^2sent to Player^7(^6"..biller.PlayerData.source.."^7)") end end
if Config.Banking == "renewed" then
exports['Renewed-Banking']:addAccountMoney(tostring(biller.PlayerData.job.name), data.amount - commission)
if Config.Debug then print("^5Debug^7: ^3Renewed-Banking^7(^3Job^7): ^2Adding ^7$^6"..(data.amount - commission).." ^2to account ^7'^6"..tostring(biller.PlayerData.job.name).."^7' ($^6"..exports['Renewed-Banking']:getAccountMoney((biller.PlayerData.job.name).."^7)")) end
elseif Config.Banking == "qb-management" then
exports["qb-management"]:AddMoney(tostring(biller.PlayerData.job.name), data.amount - commission)
if Config.Debug then print("^5Debug^7: ^3QB-Management^7(^3Job^7): ^2Adding ^7$^6"..data.amount - takecomm.." ^2to account ^7'^6"..tostring(biller.PlayerData.job.name).."^7' ($^6"..exports["qb-management"]:GetAccount(biller.PlayerData.job.name).."^7)") end
elseif Config.Banking == "qb-banking" then
exports["qb-banking"]:AddMoney(tostring(biller.PlayerData.job.name), data.amount - commission)
if Config.Debug then print("^5Debug^7: ^3QB-Banking^7(^3Job^7): ^2Adding ^7$^6"..data.amount - takecomm.." ^2to account ^7'^6"..tostring(biller.PlayerData.job.name).."^7' ($^6"..exports["qb-banking"]:GetAccount(biller.PlayerData.job.name).."^7)") end
elseif Config.Banking == "fd" then
exports.fd_banking:AddMoney(tostring(biller.PlayerData.job.name), data.amount - commission)
if Config.Debug then print("^5Debug^7: ^3FD-Banking^7(^3Job^7): ^2Adding ^7$^6"..data.amount - takecomm.." ^2to account ^7'^6"..tostring(biller.PlayerData.job.name).."^7' ($^6"..exports.fd_banking:GetAccount(biller.PlayerData.job.name).."^7)") end
end
else
triggerNotify(nil, Loc[Config.Lan].error["declined_payment"], nil, src)
triggerNotify(nil, billed.PlayerData.charinfo.firstname.." declined the $"..data.amount..Loc[Config.Lan].success["charge_end"], "error", data.biller)
end
end)
QBCore.Functions.CreateCallback('jim-payments:MakePlayerList', function(source, cb)
local onlineList = {}
for _, v in pairs(QBCore.Functions.GetPlayers()) do
local P = QBCore.Functions.GetPlayer(v)
onlineList[#onlineList+1] = { value = tonumber(v), text = "["..v.."] - "..P.PlayerData.charinfo.firstname..' '..P.PlayerData.charinfo.lastname }
end
cb(onlineList)
end)
CreateThread(function()
if Config.Usebzzz then
QBCore.Functions.CreateUseableItem('terminal', function(source, item)
TriggerClientEvent("jim-payments:client:Charge", source, {}, true)
end)
end
end)

121
server/ticketserver.lua Normal file
View File

@@ -0,0 +1,121 @@
RegisterServerEvent(getScript()..":Tickets:Give", function(data, biller, gang)
local src = source
local activePlayers = GetPlayers()
local commPercent = 0
jsonPrint(data)
local commPercent = Config.PolCharge.FineJobs[data.society] and Config.PolCharge.FineJobs[data.society].Commission or 0.25
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
local amountChange, newAmount = (data.amount - takecomm), 0
local society = gang and tostring(biller.gang) or tostring(biller.job)
local bankScript = nil
if isStarted("Renewed-Banking") then
bankScript = "Renewed-Banking"
exports["Renewed-Banking"]:addAccountMoney(society, amountChange)
newAmount = exports["Renewed-Banking"]:getAccountMoney(society)
elseif isStarted("qb-banking") then
bankScript = "qb-banking"
exports["qb-banking"]:AddMoney(society, amountChange, "Cash Register Payment")
newAmount = exports["qb-banking"]:GetAccountBalance(society)
elseif isStarted("fd_banking") then
bankScript = "fd_banking"
if gang then
exports["fd_banking"]:AddGangMoney(society, amountChange)
newAmount = exports["fd_banking"]:GetGangAccount(society)
else
exports["fd_banking"]:AddMoney(society, amountChange)
newAmount = exports["fd_banking"]:GetAccount(society)
end
elseif isStarted("okokBanking") then
bankScript = "okokBanking"
exports['okokBanking']:AddMoney(society, amountChange)
newAmount = exports['okokBanking']:GetAccount(society)
end
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
for _, v in pairs(activePlayers) do
local Player = getPlayer(v)
if Player.citizenid == data.senderCitizenId then
biller = Player
end
end
triggerNotify(nil, data.sender..locale("success", "invoice_start")..data.amount..locale("success", "invoice_end"), "success", biller.source)
end
-- If ticket system enabled, do this
if (biller.onDuty or gang) and Config.Receipts.TicketSystem then
if not Config.Receipts.Jobs[data.society] then
print("^1Error^7: Failed to find job "..data.society.." in ^2Config.Receipts.Jobs^7")
return
end
if data.amount >= Config.Receipts.Jobs[data.society].MinAmountforTicket then
if Config.Receipts.TicketSystemAll then
for _, v in pairs(activePlayers) do
local Player = getPlayer(v)
if v ~= src then
if gang then
if Player.gang == data.society then
addItem("payticket", 1, nil, Player.source)
triggerNotify(nil, locale("success", "rec_rec"), 'success', Player.source)
end
else
if Player.job == data.society and Player.onDuty then
print("player on duty, giving tickets")
addItem("payticket", 1, nil, Player.source)
triggerNotify(nil, locale("success", "rec_rec"), 'success', Player.source)
end
end
end
end
else
addItem("payticket", 1, nil, biller.source)
triggerNotify(nil, locale("success", "rec_rec"), 'success', biller.source)
end
end
end
-- Commission section, does each config option separately
local comm = tonumber(Config.Receipts.Jobs[data.society].Commission)
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.CommissionDouble then
fundPlayer(math.floor(tonumber(data.amount) * (comm *2)), "bank", biller.source)
triggerNotify(nil, locale("success", "recieved")..math.floor(tonumber(data.amount) * (comm *2))..locale("success", "commission"), "success", biller.source)
else
fundPlayer(math.floor(tonumber(data.amount) *comm), "bank", biller.source)
triggerNotify(nil, locale("success", "recieved")..math.floor(tonumber(data.amount) * comm)..locale("success", "commission"), "success", biller.source)
end
if Config.Receipts.CommissionAll then
for _, v in pairs(activePlayers) do
local Player = getPlayer(v)
if v ~= biller.source then
if Player.job == data.society and Player.onDuty then
fundPlayer(math.floor(tonumber(data.amount) * comm), "bank", 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)
RegisterServerEvent(getScript()..":Tickets:Sell", function() local src = source
local Player = getPlayer(src)
local hasItem, hasTable = hasItem("payticket", 1, src)
if not hasItem then
triggerNotify(nil, locale("error", "no_ticket_to"), 'error', src)
return
else
local tickets = hasTable["payticket"].count
removeItem("payticket", tickets, src)
local pay = (tickets * Config.Receipts.Jobs[Player.job].PayPerTicket)
fundPlayer(pay, "bank", src)
triggerNotify(nil, locale("success", "trade_ticket_start")..tickets..locale("success", "trade_ticket_end")..cv(pay), 'success', src)
end
end)

65
shared/banklocs.lua Normal file
View File

@@ -0,0 +1,65 @@
BankLocations = {
["legion"] = {
vec4(149.5, -1042.08, 29.37, 342.74), -- Legion Fleeca
},
["hawick"] = {
vec4(313.81, -280.43, 54.16, 342.29), -- Hawick Fleeca
},
["vinewood"] = {
vec4(-351.4, -51.24, 49.04, 338.4), -- Vinewood Fleeca
},
["delperro"] = {
vec4(-1212.11, -332.01, 37.78, 25.33), -- Del Perro Fleeca
},
["route1"] = {
vec4(-2961.17, 482.9, 15.7, 84.68), -- Route 1 Fleeca
},
["route68"] = {
vec4(1175.03, 2708.2, 38.09, 180.0), -- Route 68 Fleeca
},
["paleto"] = {
vec4(-111.22, 6470.03, 31.63, 133.86), -- Paleto Bank
},
["pacific"] = {
vec4(243.58, 226.25, 106.29, 169.06), -- Pacific Bank Window 1
vec4(247.08, 224.98, 106.29, 157.75), -- Pacific Bank Window 2
},
}
if Config.General.Gabz then
Config.Receipts.CashInLocations = {
vec4(269.28, 217.24, 106.28, 69.0)
}
BankLocations = {
["legion"] = {
vec4(149.5, -1042.08, 29.37, 342.74), -- Legion Fleeca
},
["hawick"] = {
vec4(313.81, -280.43, 54.16, 342.29), -- Hawick Fleeca
},
["vinewood"] = {
vec4(-351.4, -51.24, 49.04, 338.4), -- Vinewood Fleeca
},
["delperro"] = {
vec4(-1212.11, -332.01, 37.78, 25.33), -- Del Perro Fleeca
},
["route1"] = {
vec4(-2961.17, 482.9, 15.7, 84.68), -- Route 1 Fleeca
},
["route68"] = {
vec4(1175.03, 2708.2, 38.09, 180.0), -- Route 68 Fleeca
},
["paleto"] = {
vec4(-110.72, 6469.82, 31.63, 222.94), -- Paleto Bank (GABZ) - 1
vec4(-108.98, 6471.56, 31.63, 222.92), -- Paleto Bank (GABZ) - 2
},
["pacific"] = {
vec4(258.55, 227.63, 106.28, 160.96), -- Pacficic Gabz 1+2
vec4(263.21, 225.93, 106.28, 158.25), -- Pacficic Gabz 3+4
vec4(267.95, 224.24, 106.28, 158.5), -- Pacficic Gabz 5+6
vec4(263.71, 212.63, 106.28, 337.53), -- Pacficic Gabz 7+8
vec4(259.02, 214.32, 106.28, 337.82), -- Pacficic Gabz 9+10
vec4(254.27, 216.06, 106.28, 336.37), -- Pacficic Gabz 11+12
},
}
end

View File

@@ -1,120 +0,0 @@
QBCore = exports['qb-core']:GetCoreObject()
local time = 1000
function loadModel(model) if not HasModelLoaded(model) then
if Config.Debug then print("^5Debug^7: ^2Loading Model^7: '^6"..model.."^7'") end
while not HasModelLoaded(model) do
if time > 0 then time -= 1 RequestModel(model)
else time = 1000 print("^5Debug^7: ^3LoadModel^7: ^2Timed out loading model ^7'^6"..model.."^7'") break
end
Wait(10)
end
end end
function unloadModel(model) if Config.Debug then print("^5Debug^7: ^2Removing Model^7: '^6"..model.."^7'") end SetModelAsNoLongerNeeded(model) end
function loadAnimDict(dict) if not HasAnimDictLoaded(dict) then if Config.Debug then print("^5Debug^7: ^2Loading Anim Dictionary^7: '^6"..dict.."^7'") end while not HasAnimDictLoaded(dict) do RequestAnimDict(dict) Wait(5) end end end
function unloadAnimDict(dict) if Config.Debug then print("^5Debug^7: ^2Removing Anim Dictionary^7: '^6"..dict.."^7'") end RemoveAnimDict(dict) end
function loadPtfxDict(dict) if not HasNamedPtfxAssetLoaded(dict) then if Config.Debug then print("^5Debug^7: ^2Loading Ptfx Dictionary^7: '^6"..dict.."^7'") end while not HasNamedPtfxAssetLoaded(dict) do RequestNamedPtfxAsset(dict) Wait(5) end end end
function unloadPtfxDict(dict) if Config.Debug then print("^5Debug^7: ^2Removing Ptfx Dictionary^7: '^6"..dict.."^7'") end RemoveNamedPtfxAsset(dict) end
function lookEnt(entity)
if type(entity) == "vector3" then
if not IsPedHeadingTowardsPosition(PlayerPedId(), entity, 10.0) then
TaskTurnPedToFaceCoord(PlayerPedId(), entity, 1500)
if Config.Debug then print("^5Debug^7: ^2Turning Player to^7: '^6"..json.encode(entity).."^7'") end
Wait(1500)
end
else
if DoesEntityExist(entity) then
if not IsPedHeadingTowardsPosition(PlayerPedId(), GetEntityCoords(entity), 30.0) then
TaskTurnPedToFaceCoord(PlayerPedId(), GetEntityCoords(entity), 1500)
if Config.Debug then print("^5Debug^7: ^2Turning Player to^7: '^6"..entity.."^7'") end
Wait(1500)
end
end
end
end
function destroyProp(entity)
if Config.Debug then print("^5Debug^7: ^2Destroying Prop^7: '^6"..entity.."^7'") end
SetEntityAsMissionEntity(entity) Wait(5)
DetachEntity(entity, true, true) Wait(5)
DeleteObject(entity)
end
function makeProp(data, freeze, synced)
loadModel(data.prop)
local prop = CreateObject(data.prop, data.coords.x, data.coords.y, data.coords.z, synced or false, synced or false, 0)
SetEntityHeading(prop, data.coords.w+180.0)
FreezeEntityPosition(prop, freeze or 0)
if Config.Debug then print("^5Debug^7: ^6Prop ^2Created ^7: '^6"..prop.."^7'") end
return prop
end
function makePed(model, coords, freeze, collision, scenario, anim)
loadModel(model)
local ped = CreatePed(0, model, coords.x, coords.y, coords.z-1.03, coords.w, false, false)
SetEntityInvincible(ped, true)
SetBlockingOfNonTemporaryEvents(ped, true)
FreezeEntityPosition(ped, freeze or true)
if collision then SetEntityNoCollisionEntity(ped, PlayerPedId(), false) end
if scenario then TaskStartScenarioInPlace(ped, scenario, 0, true) end
if anim then
loadAnimDict(anim[1])
TaskPlayAnim(ped, anim[1], anim[2], 1.0, 1.0, -1, 1, 0.2, 0, 0, 0)
end
if Config.Debug then print("^5Debug^7: ^6Ped ^2Created for location^7: '^6"..model.."^7'") end
return ped
end
function makeBlip(data)
local blip = AddBlipForCoord(data.coords)
SetBlipAsShortRange(blip, true)
SetBlipSprite(blip, data.sprite or 1)
SetBlipColour(blip, data.col or 0)
SetBlipScale(blip, data.scale or 0.7)
SetBlipDisplay(blip, (data.disp or 6))
BeginTextCommandSetBlipName('STRING')
AddTextComponentString(tostring(data.name))
EndTextCommandSetBlipName(blip)
if Config.Debug then print("^5Debug^7: ^6Blip ^2created for location^7: '^6"..data.name.."^7'") end
return blip
end
function triggerNotify(title, message, type, src)
if Config.Notify == "okok" then
if not src then exports['okokNotify']:Alert(title, message, 6000, type or 'info')
else TriggerClientEvent('okokNotify:Alert', src, title, message, 6000, type or 'info') end
elseif Config.Notify == "qb" then
if not src then TriggerEvent("QBCore:Notify", message, "primary")
else TriggerClientEvent("QBCore:Notify", src, message, "primary") end
elseif Config.Notify == "t" then
if not src then exports['t-notify']:Custom({title = title, style = type, message = message, sound = true})
else TriggerClientEvent('t-notify:client:Custom', src, { style = type, duration = 6000, title = title, message = message, sound = true, custom = true}) end
elseif Config.Notify == "infinity" then
if not src then TriggerEvent('infinity-notify:sendNotify', message, type)
else TriggerClientEvent('infinity-notify:sendNotify', src, message, type) end
elseif Config.Notify == "rr" then
if not src then exports.rr_uilib:Notify({msg = message, type = type, style = "dark", duration = 6000, position = "top-right", })
else TriggerClientEvent("rr_uilib:Notify", src, {msg = message, type = type, style = "dark", duration = 6000, position = "top-right", }) end
end
end
function pairsByKeys(t)
local a = {}
for n in pairs(t) do a[#a+1] = n end
table.sort(a)
local i = 0
local iter = function() i += 1 if a[i] == nil then return nil else return a[i], t[a[i]] end end
return iter
end
function countTable(table) local i = 0 for keys in pairs(table) do i += 1 end return i end
function cv(amount)
local formatted = amount
while true do
formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1,%2')
if (k==0) then break end
end
return formatted
end

6
version.txt Normal file
View File

@@ -0,0 +1,6 @@
3.0.05
- Add extra check for if playerData exists when getting player list
- Add new lookAtCharge option to allow players to target who to charge
https://github.com/jimathy/jim-payments