Hello everyone,
I present to you my new script, available on my Tebex Page ==> https://narus.tebex.io
–==> Youtube Preview <==–
-
Electronic Payment Terminal Script Compatible with QBCore and ESX
-
Automatic retrieval of the sender’s job
-
Display of the UI on the target player for payment validation or rejection
-
Automatic detection of player balance (if validation of credit on the sender’s company account)
-
Automatic rejection if insufficient player account, with UI returned to the sender
Configurable:
- Translation into fr / en / es / de
- Debug mode to test the device on yourself + addition of the /tpe command
- Choice of framework: qb or esx
- Use of an item (by default tpe but modifiable, if the activation trigger described in the configuration is disabled)
- Maximum distance from the client
- Maximum authorized amount
- Activation or deactivation of the loading screen + loading screen duration
- Discord log (also translated depending on the chosen language) Sender name, company name, target name, amount, and status (pay, decline) from the bank, refusal by the player)
- Customizable webhook avatar and name
Configuration (config.lua)
-- Lang : fr / en / es /de
Config.Locale = 'fr'
-- Debug mode: enables the /tpe command to open the NUI without a target
Config.Debug = false
-- Framework choice: 'qb' or 'esx'
Config.Framework = 'qb'
-- Item usage: allow opening the TPE via an inventory item (if false ==> TriggerClientEvent('tpe_ui:client:openPayment', source, jobName, jobLabel, source)
Config.UseItem = true
Config.TPEItem = 'tpe'
-- Business parameters
Config.MaxDistance = 3.0 -- max distance to target a player
Config.MaxAmount = 10000000 -- maximum invoice amount
Config.MaxDigits = 10 -- max number of digits on the pad
-- NUI loading screen
Config.Loading = {
Enabled = true, -- enable/disable the loading screen
Duration = 3000, -- duration in milliseconds
}
-- Discord webhook for logs
Config.TPEWebhook = {
Enabled = true, -- enable Discord logging
Url = 'https://discord.com/api/webhooks/…',
username = 'TPE Logger',
avatar_url = 'https://i.imgur.com/AfFp7pu.png',
}
--[[
_________________________________________________________________________________________
If UseItem = false
--== QBCORE ==--
local ply = QBCore.Functions.GetPlayer(src)
if not ply then return end
local jobName = ply.PlayerData.job.name
local jobLabel = ply.PlayerData.job.label
if jobName == 'unemployed' then
return notify(source, L('not_employed'), "error")
end
TriggerClientEvent('tpe_ui:client:openPayment', source, jobName, jobLabel, source)
_________________________________________________________________________________________
--== ESX ==--
local ply = ESX.GetPlayerFromId(src)
if not ply then return end
local job = ply.job or {}
if job.name == 'unemployed' then
return notify(src, L('not_employed'))
end
TriggerClientEvent('tpe_ui:client:openPayment', src, job.name, job.label or job.grade_label or job.name, src)
]]--
Adding the TPE Item
ESX
In your ESX database, run:
INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`)
VALUES
('tpe', 'Payment Terminal', 1, 0, 1);
QB-Core
In qb-core/shared/items.lua, add :
tpe = {
name = 'tpe',
label = 'Payment Terminal',
weight = 100,
type = 'item',
image = 'tpe.png',
unique = true,
useable = true,
shouldClose = true,
description = 'Payment Terminal'
},
Note :
- The command
/tpe
is only available whenConfig.Debug = true
. - If you switch to
Framework = 'esx'
, don’t forget to update youritems
table as shown and restart your server.
Code is accessible | No (config and locales yes) |
Subscription-based | No |
Lines (approximately) | 1360 |
Requirements | oxmysql |
Support | Yes |