-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat! replace QBCore support with Qbox
- Loading branch information
1 parent
09da141
commit 0a151de
Showing
8 changed files
with
50 additions
and
78 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
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
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
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
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
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
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
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 |
---|---|---|
@@ -1,34 +1,37 @@ | ||
RegisterNetEvent('mtc-cityhall:server:ApplyJob', function(id) | ||
local Player = QBCore.Functions.GetPlayer(source) | ||
if not Player then return end | ||
local xPlayer = exports.qbx_core:GetPlayer(source) | ||
if not xPlayer then return end | ||
|
||
local job = Config.jobs[id] | ||
if not job then return end | ||
|
||
Player.Functions.SetJob(job.job, 0) | ||
xPlayer.Functions.SetJob(job.job, 0) | ||
if Config.RenewedPhone then | ||
exports['qb-phone']:hireUser(job.job, Player.PlayerData.citizenid, 0) | ||
end | ||
TriggerClientEvent('QBCore:Notify', source, Lang['hired']:format(job.label), 'success') | ||
end) | ||
|
||
RegisterNetEvent('mtc-cityhall:server:BuyIdentity', function(id) | ||
local src = source | ||
local Player = QBCore.Functions.GetPlayer(src) | ||
if not Player then return end | ||
local xPlayer = exports.qbx_core:GetPlayer(source) | ||
if not xPlayer then return end | ||
|
||
local item = Config.items[id] | ||
if not item then return end | ||
|
||
if not Player.Functions.RemoveMoney('bank', item.price, "Cityhall purchase") then | ||
TriggerClientEvent('QBCore:Notify', src, Lang['not_enough_money'], 'error') | ||
if not exports.ox_inventory:CanCarryItem(source, item.item) then | ||
TriggerClientEvent('QBCore:Notify', source, Lang['no_space'], 'error') | ||
return | ||
end | ||
|
||
if not xPlayer.Functions.RemoveMoney('bank', item.price, "Cityhall purchase") then | ||
TriggerClientEvent('QBCore:Notify', source, Lang['not_enough_money'], 'error') | ||
return | ||
end | ||
|
||
if not giveIdCard(src, item) then -- Handles id_card items using qb-inventory or um_idcard if it was not an id_card give the item to the user | ||
Player.Functions.AddItem(item.item, 1, false) | ||
if not giveIdCard(source, item) then -- Handles id_card items using qb-inventory or um_idcard if it was not an id_card give the item to the user | ||
exports.ox_inventory:AddItem(source, item.item) | ||
end | ||
|
||
TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items[item.item], 'add') | ||
TriggerClientEvent('QBCore:Notify', src, Lang['bought']:format(item.label), 'success') | ||
TriggerClientEvent('QBCore:Notify', source, Lang['bought']:format(item.label), 'success') | ||
end) |