mirror of
https://github.com/jimathy/jim-payments.git
synced 2026-08-18 23:06:02 +01:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
487459eda8 | ||
|
|
be931570bb | ||
|
|
e958ae1582 | ||
|
|
d1ea279f4a | ||
|
|
256394bfe3 | ||
|
|
227fbd322c |
@@ -1,6 +1,10 @@
|
|||||||
# jim-payments
|
# jim-payments
|
||||||
QBCore based payment system
|
QBCore based payment system
|
||||||
|
|
||||||
|
--------------
|
||||||
|
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
|
Enchanced QB-Input payment system from my other scripts now free on its own
|
||||||
|
|
||||||
 
|
 
|
||||||
@@ -41,3 +45,7 @@ Go to [qb] > qb-phone > client > main.lua
|
|||||||
- Add this line:
|
- Add this line:
|
||||||
|
|
||||||
```TriggerServerEvent('jim-payments:Tickets:Give', amount, society)```
|
```TriggerServerEvent('jim-payments:Tickets:Give', amount, society)```
|
||||||
|
|
||||||
|
--------------
|
||||||
|
|
||||||
|
NOTE: If you are converting from my older job scripts, I recommend removing the previous triggers from qb-phone
|
||||||
|
|||||||
37
client.lua
37
client.lua
@@ -36,27 +36,32 @@ end)
|
|||||||
|
|
||||||
RegisterNetEvent('jim-payments:client:Charge', function()
|
RegisterNetEvent('jim-payments:client:Charge', function()
|
||||||
if not onDuty then TriggerEvent("QBCore:Notify", "Not Clocked in!", "error") return end -- Require to be on duty when making a payment
|
if not onDuty then TriggerEvent("QBCore:Notify", "Not Clocked in!", "error") return end -- Require to be on duty when making a payment
|
||||||
QBCore.Functions.TriggerCallback('jim-payments:server:GetCurrentPlayers', function(playerList)
|
local playerList = {}
|
||||||
if playerList[1] == nil then TriggerEvent("QBCore:Notify", "No one near by to charge", "error") return end
|
for k,v in pairs(QBCore.Functions.GetPlayersFromCoords(GetEntityCoords(PlayerPedId()), Config.PaymentRadius)) do
|
||||||
local dialog = exports['qb-input']:ShowInput({ header = "Charge Customer", submitText = "Send",
|
dist = #(GetEntityCoords(GetPlayerPed(v)) - GetEntityCoords(PlayerPedId()))
|
||||||
inputs = {
|
TriggerEvent("QBCore:Notify", "["..GetPlayerServerId(v).."] - "..GetPlayerName(v).." ("..math.floor(dist+0.5).."m)", "error")
|
||||||
{ text = "Citizen", name = "citizen", type = "select", options = playerList },
|
if v ~= PlayerId() then
|
||||||
{ type = 'number', isRequired = true, name = 'price', text = 'Amount to Charge' },
|
playerList[#playerList+1] = { value = GetPlayerServerId(v), text = "["..GetPlayerServerId(v).."] - "..GetPlayerName(v).." ("..math.floor(dist+0.5).."m)" }
|
||||||
{ type = 'radio', name = 'billtype', text = 'Payment Type', options = { { value = "cash", text = "Cash" }, { value = "card", text = "Card" } } }, }
|
|
||||||
})
|
|
||||||
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)
|
|
||||||
end
|
end
|
||||||
end)
|
end
|
||||||
|
if playerList[1] == nil then TriggerEvent("QBCore:Notify", "No one near by to charge", "error") return end
|
||||||
|
local dialog = exports['qb-input']:ShowInput({ header = "Charge Customer", submitText = "Send",
|
||||||
|
inputs = {
|
||||||
|
{ text = "Citizen", name = "citizen", type = "select", options = playerList },
|
||||||
|
{ type = 'number', isRequired = true, name = 'price', text = 'Amount to Charge' },
|
||||||
|
{ type = 'radio', name = 'billtype', text = 'Payment Type', options = { { value = "cash", text = "Cash" }, { value = "card", text = "Card" } } }, }
|
||||||
|
})
|
||||||
|
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)
|
||||||
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
RegisterNetEvent('jim-payments:Tickets:Menu', function()
|
RegisterNetEvent('jim-payments:Tickets:Menu', function()
|
||||||
for k, v in pairs(Config.Jobs) do if k ~= PlayerJob.name then
|
for k, v in pairs(Config.Jobs) do if k ~= PlayerJob.name then
|
||||||
else exports['qb-menu']:openMenu({
|
else exports['qb-menu']:openMenu({
|
||||||
{ isMenuHeader = true, header = PlayerJob.label.." Ticket Payment", txt = "Do you want trade your tickets for payment?" },
|
{ isMenuHeader = true, header = PlayerJob.label.." Ticket Payment", txt = "Do you want trade your tickets for payment?" },
|
||||||
{ header = "Yes", txt = "", params = { event = "jim-payments:Tickets:Sell:yes" } },
|
{ header = "Yes", txt = "", params = { event = "jim-payments:Tickets:Sell:yes" } },
|
||||||
{ header = "No", txt = "", params = { event = "jim-payments:Tickets:Sell:no" } }, })
|
{ header = "No", txt = "", params = { event = "jim-payments:Tickets:Sell:no" } }, })
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
print("Jim-Payments v1.0 - Payments Script by Jimathy")
|
print("Jim-Payments v1.1 - Payments Script by Jimathy")
|
||||||
|
|
||||||
-- 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.
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
name "Jim-Payments"
|
name "Jim-Payments"
|
||||||
author "Jimathy"
|
author "Jimathy"
|
||||||
version "v1.1"
|
version "v1.2"
|
||||||
description "Payment Script By Jimathy"
|
description "Payment Script By Jimathy"
|
||||||
fx_version "cerulean"
|
fx_version "cerulean"
|
||||||
game "gta5"
|
game "gta5"
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ QBCore.Functions.CreateCallback('jim-payments:server:GetCurrentPlayers', functio
|
|||||||
local Player = QBCore.Functions.GetPlayer(v)
|
local Player = QBCore.Functions.GetPlayer(v)
|
||||||
if Player ~= nil and v ~= source then
|
if Player ~= nil and v ~= source then
|
||||||
local dist = #(vector3(Player.PlayerData.position.x, Player.PlayerData.position.y, Player.PlayerData.position.z) - vector3(SPlayer.PlayerData.position.x, SPlayer.PlayerData.position.y, SPlayer.PlayerData.position.z))
|
local dist = #(vector3(Player.PlayerData.position.x, Player.PlayerData.position.y, Player.PlayerData.position.z) - vector3(SPlayer.PlayerData.position.x, SPlayer.PlayerData.position.y, SPlayer.PlayerData.position.z))
|
||||||
if dist <= Config.PaymentRadius then onlineList[#onlineList+1] = { value = tonumber(v), text = "["..v.."] - "..Player.PlayerData.charinfo.firstname..' '..Player.PlayerData.charinfo.lastname..' ('..dist..'m)' }
|
if dist <= Config.PaymentRadius then onlineList[#onlineList+1] = { value = tonumber(v), text = "["..v.."] - "..Player.PlayerData.charinfo.firstname..' '..Player.PlayerData.charinfo.lastname..' ('..math.floor(dist+0.5)..'m)' }
|
||||||
elseif dist > Config.PaymentRadius then end
|
elseif dist > Config.PaymentRadius then end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user