-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from SOH69/main
Update
- Loading branch information
Showing
17 changed files
with
196 additions
and
25 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,10 @@ | ||
name: Lint | ||
on: [push, pull_request] | ||
jobs: | ||
lint: | ||
name: Lint Resource | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Lint | ||
uses: iLLeniumStudios/fivem-lua-lint-action@v2 |
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 |
---|---|---|
@@ -0,0 +1,61 @@ | ||
if Shared.Core == "qbox" then | ||
function Radio:QboxInit(data) | ||
local PlayerData = data or exports.qbx_core:GetPlayer() | ||
if PlayerData then | ||
Radio.PlayerJob = PlayerData.job.type | ||
Radio.PlayerGang = PlayerData.gang.name | ||
Radio.PlayerDuty = PlayerData.job.onduty | ||
end | ||
|
||
local rec = {} | ||
for k, v in pairs(Shared.RestrictedChannels) do | ||
if v.type == 'job' and lib.table.contains(v.name, Radio.PlayerJob) then | ||
rec[#rec+1] = k | ||
elseif v.type == 'gang' and lib.table.contains(v.name, Radio.PlayerGang) then | ||
rec[#rec+1] = k | ||
end | ||
end | ||
Radio.favourite = rec | ||
for _, val in ipairs(Radio.userData.favourite) do | ||
if not lib.table.contains(Radio.favourite, val) then | ||
Radio.favourite[#Radio.favourite+1] = val | ||
end | ||
end | ||
Radio:doRadioCheck() | ||
end | ||
|
||
RegisterNetEvent('QBCore:Server:OnPlayerLoaded', function() | ||
Radio:QboxInit() | ||
end) | ||
|
||
-- Resets state on logout, in case of character change. | ||
RegisterNetEvent('QBCore:Client:OnPlayerUnload', function() | ||
Radio.PlayerItems = {} | ||
Radio.hasRadio = false | ||
Radio:leaveradio() | ||
end) | ||
|
||
RegisterNetEvent('QBCore:Client:OnJobUpdate', function(job) | ||
Radio.PlayerJob = job.type | ||
Radio:QboxInit() | ||
end) | ||
|
||
RegisterNetEvent('QBCore:Client:OnGangUpdate', function(gang) | ||
Radio.PlayerGang = gang.name | ||
Radio:QboxInit() | ||
end) | ||
|
||
RegisterNetEvent("QBCore:Client:SetDuty", function(newDuty) | ||
Radio.PlayerDuty = newDuty | ||
end) | ||
|
||
AddEventHandler('gameEventTriggered', function(event, data) | ||
if event ~= "CEventNetworkEntityDamage" then return end | ||
if not IsEntityAPed(data[1]) then return end | ||
if data[4] and NetworkGetPlayerIndexFromPed(data[1]) == cache.playerId and IsEntityDead(cache.ped) then | ||
if LocalPlayer.state.isLoggedIn and Radio.onRadio and Radio.hasRadio and Radio.RadioChannel ~= 0 then | ||
Radio:leaveradio() | ||
end | ||
end | ||
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
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ fx_version 'cerulean' | |
game "gta5" | ||
|
||
author "Master Mind" | ||
version '1.6.0' | ||
version '1.8.0' | ||
|
||
lua54 'yes' | ||
|
||
|
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
Oops, something went wrong.