Update README.md

This commit is contained in:
Jim Shield
2022-07-28 15:56:57 +01:00
committed by GitHub
parent 0990422823
commit 120dae8066

195
README.md
View File

@@ -1,92 +1,175 @@
# jim-payments # jim-payments
QBCore based payment system - QBCore based payment system
- Enchanced QB-Input payment system from my other scripts now free on its own
If you think I did a good job here, consider donating as it keeps by lights on and my cat fat: ### If you think I did a good job here, consider donating as it keeps by lights on and my cat fat/floofy:
https://ko-fi.com/jixelpatterns https://ko-fi.com/jixelpatterns
--------------
If you use a different phone/invoice system let me know and I will add support for it as best I can! ---
Enchanced QB-Input payment system from my other scripts now free on its own - If you use a different phone/invoice system let me know and I will add support for it as best I can!
- Currently supported are:
- qb-phone
- gks-phone
- qs-smartphone
![General](https://i.imgur.com/37d2mE3.jpeg) ![General](https://i.imgur.com/AIdXzxX.jpeg)
![General](https://i.imgur.com/RYADcI2.jpeg) ![General](https://i.imgur.com/ICbQyeQ.jpeg)
![](https://i.imgur.com/37d2mE3.jpeg) ![](https://i.imgur.com/AIdXzxX.jpeg)
![](https://i.imgur.com/RYADcI2.jpeg) ![](https://i.imgur.com/ICbQyeQ.jpeg)
---
# Installation # Installation
---
To make use of this payment system in a job that wasn't created by me - I always recommend starting my scripts AFTER `[qb]` not inside it as it can mess with any dependancies on server load
- I have a separate folder called `[jim]` (that is also in the resources folder) that starts WAY after everything else.
All you need to do is pick the job, grab a vector4 and confirm if you need a prop or not - This ensure's it has everything it requires before trying to load
- Example of my load order:
For example: ```CSS
```lua # QBCore & Extra stuff
CustomCashRegisters = { -- Located in the config.lua ensure qb-core
["burgershot"] = { -- Player job role restriction ensure [qb]
{ coords = vector4(-1185.5, -878.54, 13.91, 305.53), prop = true, }, -- vector4 to place the till and the way it faces ensure [standalone]
{ coords = vector4(-1184.34, -880.51, 13.93, 302.04), prop = true, }, -- "prop = true" spawns a prop at the coords ensure [voice]
}, ensure [defaultmaps]
}, ensure [vehicles]
#Extra Jim Stuff
ensure [jim]
``` ```
This does not need to be done for **MY** job scripts, they already have built in support ---
## 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
To make use of the ticket reward system for workers you need to add the ticket item to your shared items lua:
```lua ```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!"}, ["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 - Add the ticket image to your inventory script:
- Naviage to `[qb] > qb-inventory > html > images` and add this line
[qb] > qb-inventory > html > images ![](https://github.com/jimathy/jim-payments/blob/main/images/ticket.png?raw=true)
-------------- ---
To get tickets from phone invoices you NEED to add it to the event when a payment is accepted: ## 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.
For QB-Phone: #### QB-Phone:
Go to [qb] > qb-phone > client > main.lua - Go to `[qb] > qb-phone > client > main.lua`
- Around line 645 there should be the PayInvoice NUICallBack - Search for the event `RegisterNUICallback('PayInvoice', function(data, cb)` and look for the line:
- Directly *above* this line:
```lua ```lua
TriggerServerEvent('qb-phone:server:BillingEmail', data, true) TriggerServerEvent('qb-phone:server:BillingEmail', data, true)
``` ```
- Add this line: - Directly *above* this line add:
```lua ```lua
TriggerServerEvent('jim-payments:Tickets:Give', data) TriggerServerEvent('jim-payments:Tickets:Give', data)
``` ```
- The phone should now be integrated with jim-payments
For GKSPhone: #### GKS-Phone:
Go to gks-phone > server > serverapi.lua - Go to `gks-phone > server > serverapi.lua`
- Search for the event: `gksphone:faturapayBill` and search for this line:
- Search for the event: ```gksphone:faturapayBill```
- Under this line:
```lua ```lua
Ply.Functions.RemoveMoney('bank', amount, "paid-invoice") Ply.Functions.RemoveMoney('bank', amount, "paid-invoice")
``` ```
- Add these lines: - Directly under this line add this event:
```lua ```lua
TriggerEvent('jim-payments:Tickets:Give', { sender = Ply.PlayerData.charinfo.firstname, senderCitizenId = data[1].sendercitizenid, society = data[1].society, amount = data[1].amount }) TriggerEvent('jim-payments:Tickets:Give', { sender = Ply.PlayerData.charinfo.firstname, senderCitizenId = data[1].sendercitizenid, society = data[1].society, amount = data[1].amount })
``` ```
- The phone should now be integrated with jim-payments
-------------- ---
# Setup/Config
---
## Custom Locations
The latest banking systems are very simple to use and add, - You can make of this payment system for a job script that wasn't created by me
simply look in the atms.lua and change the config options at the top - 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
- 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
Choose wether to use atm's, choose wether to use banking locations ---
Choose wether to add bank blips (if you want to disable qb-banking) ## Multiple Job and Gang Role support
Choose wether to add ATM blips (if you like $ signs) - 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
- 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
- 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
New Commission system added - This script supports a customisable "police billing"
- This is the ability for selected jobroles to charge a nearby player
This brings more config options to find tune the script - 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`
Choose wether people get commission from every sale - This also supports giving the player a cut of the payment as `commission`
Choose if EVERY worker gets Commission that is on duty - Default Config:
Choose if Commission is limited by MinAmountForTicket ```lua
Choose if the worker charging the customer gets double commission 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
- 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
---