mirror of
https://github.com/jimathy/jim-payments.git
synced 2026-08-18 14:56:02 +01:00
triggerNotify()
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
local QBCore = exports['qb-core']:GetCoreObject()
|
||||
RegisterNetEvent('QBCore:Client:UpdateObject', function() QBCore = exports['qb-core']:GetCoreObject() end)
|
||||
|
||||
-- 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
|
||||
@@ -226,7 +227,7 @@ RegisterNetEvent('jim-payments:Client:ATM:use', function(data)
|
||||
Wait(1000)
|
||||
TriggerServerEvent('jim-payments:server:ATM:use', dialog.amount, dialog.billtype, dialog.account, data.id, info.society, info.gsociety)
|
||||
end
|
||||
end, function() TriggerEvent("QBCore:Notify", "Cancelled!", "error")
|
||||
end, function() triggerNotify(nil, "Cancelled!", "error")
|
||||
end, data.icon)
|
||||
end)
|
||||
|
||||
@@ -245,7 +246,7 @@ RegisterNetEvent('jim-payments:client:ATM:give', function()
|
||||
end
|
||||
dist = nil
|
||||
end
|
||||
if not nearbyList[1] then TriggerEvent("QBCore:Notify", "No one near by to charge", "error") return end
|
||||
if not nearbyList[1] then triggerNotify(nil, "No one near by to charge", "error") return end
|
||||
local dialog = exports['qb-input']:ShowInput({ header = "Give someone cash", submitText = "Give",
|
||||
inputs = {
|
||||
{ text = " ", name = "citizen", type = "select", options = nearbyList },
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
local QBCore = exports['qb-core']:GetCoreObject()
|
||||
RegisterNetEvent('QBCore:Client:UpdateObject', function() QBCore = exports['qb-core']:GetCoreObject() end)
|
||||
|
||||
PlayerJob = {}
|
||||
PlayerGang = {}
|
||||
@@ -58,7 +59,7 @@ 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 TriggerEvent("QBCore:Notify", "Not Clocked in!", "error") return end
|
||||
if not outside and not onDuty and data.gang == nil then triggerNotify(nil, "Not Clocked in!", "error") return end
|
||||
local newinputs = {} -- Begin qb-input creation here.
|
||||
if Config.List then -- If nearby player list is wanted:
|
||||
--Retrieve a list of nearby players from server
|
||||
@@ -77,7 +78,7 @@ RegisterNetEvent('jim-payments:client:Charge', function(data, outside)
|
||||
end
|
||||
end
|
||||
--If list is empty(no one nearby) show error and stop
|
||||
if not nearbyList[1] then TriggerEvent("QBCore:Notify", "No one near by to charge", "error") return end
|
||||
if not nearbyList[1] then triggerNotify(nil, "No one near by to charge", "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 = '# Customer ID #' }
|
||||
@@ -102,7 +103,7 @@ 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 TriggerEvent("QBCore:Notify", "You don't have the required job", "error") return end
|
||||
if not allowed then triggerNotify(nil, "You don't have the required job", "error") return end
|
||||
|
||||
local newinputs = {} -- Begin qb-input creation here.
|
||||
if Config.FineJobList then -- If nearby player list is wanted:
|
||||
@@ -122,7 +123,7 @@ RegisterNetEvent('jim-payments:client:PolCharge', function()
|
||||
end
|
||||
end
|
||||
--If list is empty(no one nearby) show error and stop
|
||||
if not nearbyList[1] then TriggerEvent("QBCore:Notify", "No one near by to charge", "error") return end
|
||||
if not nearbyList[1] then triggerNotify(nil, "No one near by to charge", "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 = "# Person's ID #" }
|
||||
@@ -143,7 +144,7 @@ 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 TriggerEvent("QBCore:Notify", "You don't have any tickets to trade", "error") amount = 0 return end
|
||||
if not amount then triggerNotify(nil, "You don't have any tickets to trade", "error") amount = 0 return end
|
||||
local sellable = false
|
||||
local name = "" local label = ""
|
||||
--Check/adjust for job/gang names
|
||||
|
||||
Reference in New Issue
Block a user