-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bafea9f
commit cae208f
Showing
19 changed files
with
1,301 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', '{}', '{}'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
}, | ||
}, | ||
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.") |
Oops, something went wrong.