Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
PickleModifications authored Nov 30, 2022
1 parent bafea9f commit cae208f
Show file tree
Hide file tree
Showing 19 changed files with 1,301 additions and 0 deletions.
6 changes: 6 additions & 0 deletions __INSTALLATION/Jobs/esx.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
INSERT INTO `jobs` (`name`, `label`, `whitelisted`) VALUES ('airport', 'Airport', '1');

INSERT INTO `job_grades` (`job_name`, `grade`, `name`, `label`, `salary`, `skin_male`, `skin_female`) VALUES ('airport', '0', 'recruit', 'Recruit', '0', '{}', '{}');
INSERT INTO `job_grades` (`job_name`, `grade`, `name`, `label`, `salary`, `skin_male`, `skin_female`) VALUES ('airport', '0', 'employee', 'Pilot', '0', '{}', '{}');
INSERT INTO `job_grades` (`job_name`, `grade`, `name`, `label`, `salary`, `skin_male`, `skin_female`) VALUES ('airport', '0', 'manager', 'Lead Pilot', '0', '{}', '{}');
INSERT INTO `job_grades` (`job_name`, `grade`, `name`, `label`, `salary`, `skin_male`, `skin_female`) VALUES ('airport', '0', 'boss', 'Air-Traffic Controller', '0', '{}', '{}');
25 changes: 25 additions & 0 deletions __INSTALLATION/Jobs/qbcore.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
['airport'] = {
label = 'Airport',
defaultDuty = true,
offDutyPay = false,
grades = {
['0'] = {
name = 'Recruit',
payment = 0
},
['1'] = {
name = 'Pilot',
payment = 0
},
['2'] = {
name = 'Lead Pilot',
payment = 0
},
['3'] = {
name = 'Air-Traffic Controller',
isboss = true,
bankAuth = true,
payment = 0
},
},
},
32 changes: 32 additions & 0 deletions bridge/esx/client.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
if GetResourceState('es_extended') ~= 'started' then return end

ESX = exports.es_extended:getSharedObject()

function ShowNotification(text)
ESX.ShowNotification(text)
end

function ShowHelpNotification(text)
ESX.ShowHelpNotification(text)
end

function ServerCallback(name, cb, ...)
ESX.TriggerServerCallback(name, cb, ...)
end

function PermissionCheck(perm)
local job = ESX.GetPlayerData().job
if (perm == "flight") then
return (job.name == "airport")
elseif (perm == "hangar") then
return (job.name == "airport")
elseif (perm == "pilot_mission") then
return (job.name == "airport")
elseif (perm == "view_tracker") then
return (job.name == "airport" or job.name == "police")
end
end

RegisterNetEvent(GetCurrentResourceName()..":showNotification", function(text)
ShowNotification(text)
end)
61 changes: 61 additions & 0 deletions bridge/esx/server.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
if GetResourceState('es_extended') ~= 'started' then return end

ESX = exports.es_extended:getSharedObject()

function RegisterCallback(name, cb)
ESX.RegisterServerCallback(name, cb)
end

function ShowNotification(target, text)
TriggerClientEvent(GetCurrentResourceName()..":showNotification", target, text)
end

function Search(source, name)
local xPlayer = ESX.GetPlayerFromId(source)
if (name ~= "money") then
local item = xPlayer.getInventoryItem(name)
if item ~= nil then
return item.count
else
return 0
end
else
return xPlayer.getMoney()
end
end

function AddItem(source, name, amount)
local xPlayer = ESX.GetPlayerFromId(source)
if name == "money" then
return xPlayer.addMoney(amount)
else
return xPlayer.addInventoryItem(name, amount)
end
end

function RemoveItem(source, name, amount)
local xPlayer = ESX.GetPlayerFromId(source)
if name == "money" then
return xPlayer.removeMoney(amount)
else
return xPlayer.removeInventoryItem(name, amount)
end
end

function CanCarryItem(source, name, amount)
local xPlayer = ESX.GetPlayerFromId(source)
return xPlayer.canCarryItem(name, amount)
end

function RegisterUsableItem(...)
ESX.RegisterUsableItem(...)
end

function PermissionCheck(source, perm)
local job = ESX.GetPlayerFromId(source).job
if (perm == "flight") then
return (job.name == "airport")
elseif (perm == "pilot_mission") then
return (job.name == "airport")
end
end
38 changes: 38 additions & 0 deletions bridge/qb/client.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
if GetResourceState('qb-core') ~= 'started' then return end

QBCore = exports['qb-core']:GetCoreObject()

function ShowNotification(text)
QBCore.Functions.Notify(text)
end

function ShowHelpNotification(text)
AddTextEntry('qbHelpNotification', text)
BeginTextCommandDisplayHelp('qbHelpNotification')
EndTextCommandDisplayHelp(0, false, false, -1)
end

function ServerCallback(name, cb, ...)
QBCore.Functions.TriggerCallback(name, cb, ...)
end

RegisterNetEvent(GetCurrentResourceName()..":showNotification", function(text)
ShowNotification(text)
end)

function PermissionCheck(perm)
local job = QBCore.Functions.GetPlayerData().job
if (perm == "flight") then
return (job.name == "airport")
elseif (perm == "hangar") then
return (job.name == "airport")
elseif (perm == "pilot_mission") then
return (job.name == "airport")
elseif (perm == "view_tracker") then
return (job.name == "airport" or job.name == "police")
end
end

RegisterNetEvent(GetCurrentResourceName()..":showNotification", function(text)
ShowNotification(text)
end)
60 changes: 60 additions & 0 deletions bridge/qb/server.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
if GetResourceState('qb-core') ~= 'started' then return end

QBCore = exports['qb-core']:GetCoreObject()

function RegisterCallback(name, cb)
QBCore.Functions.CreateCallback(name, cb)
end

function ShowNotification(target, text)
TriggerClientEvent(GetCurrentResourceName()..":showNotification", target, text)
end

function Search(source, name)
local xPlayer = QBCore.Functions.GetPlayer(source)
if name ~= "money" then
local item = xPlayer.Functions.GetItemByName(name)
if item ~= nil then
return item.amount
else
return 0
end
else
return xPlayer.PlayerData.money['cash']
end
end

function AddItem(source, name, amount)
local xPlayer = QBCore.Functions.GetPlayer(source)
if name == "money" then
return xPlayer.Functions.AddMoney("cash", amount)
else
return xPlayer.Functions.AddItem(name, amount)
end
end

function RemoveItem(source, name, amount)
local xPlayer = QBCore.Functions.GetPlayer(source)
if name == "money" then
return xPlayer.Functions.RemoveMoney("cash", amount)
else
return xPlayer.Functions.RemoveItem(name, amount)
end
end

function CanCarryItem(source, name, amount)
return true -- No function for this.
end

function RegisterUsableItem(...)
QBCore.Functions.CreateUseableItem(...)
end

function PermissionCheck(source, perm)
local job = QBCore.Functions.GetPlayer(source).job
if (perm == "flight") then
return (job.name == "airport")
elseif (perm == "pilot_mission") then
return (job.name == "airport")
end
end
4 changes: 4 additions & 0 deletions bridge/standalone/client.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
if GetResourceState('es_extended') == 'started' then return end
if GetResourceState('qb-core') == 'started' then return end

print("You are not using a supported framework, it will be required to make edits to the bridge files.")
4 changes: 4 additions & 0 deletions bridge/standalone/server.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
if GetResourceState('es_extended') == 'started' then return end
if GetResourceState('qb-core') == 'started' then return end

print("You are not using a supported framework, it will be required to make edits to the bridge files.")
Loading

0 comments on commit cae208f

Please sign in to comment.