-
Notifications
You must be signed in to change notification settings - Fork 15
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
e74acf2
commit fb24d10
Showing
3 changed files
with
170 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,110 @@ | ||
-- Copyright 2022 © aymanTV (AN Services) | ||
-- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
-- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
|
||
----- Made By https://aymantv.tebex.io/ | ||
----- For Support, Join my Discord: https://discord.gg/f2Nbv9Ebf5 | ||
----- For custom services or help, check my Fiverr: https://www.fiverr.com/aymannajim | ||
|
||
local PlayerData | ||
local PlayerJob | ||
|
||
local createdBlips = {} | ||
|
||
Citizen.CreateThread(function() | ||
if Config.Framework == 'ESX' then | ||
while ESX == nil do | ||
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) | ||
Citizen.Wait(0) | ||
end | ||
|
||
while ESX.GetPlayerData().job == nil do | ||
Citizen.Wait(10) | ||
end | ||
|
||
PlayerData = ESX.GetPlayerData() | ||
elseif Config.Framework == 'QBCORE' then | ||
QBCore = exports['qb-core']:GetCoreObject() | ||
end | ||
Wait(2000) | ||
loadBlips() | ||
end) | ||
|
||
------ This is for ESX | ||
RegisterNetEvent('esx:playerLoaded') | ||
AddEventHandler('esx:playerLoaded', function(xPlayer) | ||
PlayerData = xPlayer | ||
end) | ||
|
||
RegisterNetEvent('esx:setJob') | ||
AddEventHandler('esx:setJob', function(job) | ||
PlayerJob = job | ||
for k,v in pairs(createdBlips) do | ||
RemoveBlip(v) | ||
end | ||
Wait(500) | ||
loadBlips() | ||
end) | ||
------ | ||
|
||
------ This is for QBCore | ||
RegisterNetEvent('QBCore:Client:OnJobUpdate') | ||
AddEventHandler('QBCore:Client:OnJobUpdate', function(JobInfo) | ||
PlayerJob = JobInfo | ||
for k,v in pairs(createdBlips) do | ||
RemoveBlip(v) | ||
end | ||
Wait(500) | ||
loadBlips() | ||
end) | ||
------ | ||
|
||
|
||
function loadBlips() | ||
for k,v in pairs(Config.Blips) do | ||
local canSee = false | ||
if #v.AllowedJobs == 0 then | ||
canSee = true | ||
elseif #v.DeniedJobs == 0 then | ||
canSee = false | ||
end | ||
for ke,va in pairs(v.DeniedJobs) do | ||
if va == getJob() then | ||
canSee = false | ||
end | ||
end | ||
for key,val in pairs(v.AllowedJobs) do | ||
if val == getJob() then | ||
canSee = true | ||
end | ||
end | ||
if canSee then | ||
local blip = AddBlipForCoord(v.Coords.x, v.Coords.y, v.Coords.z) | ||
SetBlipSprite(blip, v.Blip.sprite) | ||
SetBlipDisplay(blip, 4) | ||
SetBlipScale(blip, v.Blip.size) | ||
SetBlipColour(blip, v.Blip.color) | ||
SetBlipAsShortRange(blip, true) | ||
BeginTextCommandSetBlipName("STRING") | ||
AddTextComponentString(v.Blip.name) | ||
EndTextCommandSetBlipName(blip) | ||
table.insert(createdBlips, blip) | ||
end | ||
end | ||
end | ||
|
||
function getJob() | ||
if Config.Framework == 'ESX' then | ||
PlayerJob = PlayerData.job | ||
return PlayerJob.name | ||
elseif Config.Framework == 'QBCORE' then | ||
local Player = QBCore.Functions.GetPlayerData() | ||
PlayerJob = Player.job | ||
return PlayerJob.name | ||
end | ||
end | ||
|
||
----- Made By https://aymantv.tebex.io/ | ||
----- For Support, Join my Discord: https://discord.gg/f2Nbv9Ebf5 | ||
----- For custom services or help, check my Fiverr: https://www.fiverr.com/aymannajim |
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,33 @@ | ||
-- Copyright 2022 © aymanTV (AN Services) | ||
-- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
-- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
|
||
----- Made By https://aymantv.tebex.io/ | ||
----- For Support, Join my Discord: https://discord.gg/f2Nbv9Ebf5 | ||
----- For custom services or help, check my Fiverr: https://www.fiverr.com/aymannajim | ||
|
||
Config = {} | ||
|
||
Config.Framework = 'ESX' -- 'ESX' or 'QBCORE' | ||
Config.Blips = { | ||
[1] = { | ||
Coords = { x = 859.88, y = -2363.52, z = 30.34 }, | ||
Blip = { name = 'LS Car Meet', sprite = 777, size = 0.68, color = 0 }, | ||
AllowedJobs = {}, | ||
DeniedJobs = { 'police', 'sheriff' }, | ||
}, | ||
------ TEMPLATE ------ | ||
--[[ -- REMOVE THIS LINE | ||
[2] = { | ||
Coords = { x = 0.0, y = 0.0, z = 0.0 }, -- Blip Coords | ||
Blip = { name = 'Blip Name', sprite = 0, size = 0.65, color = 0 }, -- Blip Settings | ||
AllowedJobs = { 'AllowedJob1', 'AllowedJob2' }, -- Leave Blank if you want everyone to see this blip except for DeniedJobs // Add as many as you want | ||
DeniedJobs = { 'DeniedJob1', 'DeniedJob2' }, -- Leave Blank if you only want AllowedJobs to see this blip // Add as many as you want | ||
}, | ||
]] -- REMOVE THIS LINE | ||
} | ||
|
||
----- Made By https://aymantv.tebex.io/ | ||
----- For Support, Join my Discord: https://discord.gg/f2Nbv9Ebf5 | ||
----- For custom services or help, check my Fiverr: https://www.fiverr.com/aymannajim |
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,27 @@ | ||
-- Copyright 2022 © aymanTV (AN Services) | ||
-- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
-- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
|
||
----- Made By https://aymantv.tebex.io/ | ||
----- For Support, Join my Discord: https://discord.gg/f2Nbv9Ebf5 | ||
----- For custom services or help, check my Fiverr: https://www.fiverr.com/aymannajim | ||
|
||
fx_version 'cerulean' | ||
games { 'rdr3', 'gta5' } | ||
|
||
description 'Blips per Jobs by AN Services | Join Discord for Support: https://discord.gg/f2Nbv9Ebf5' | ||
|
||
author 'AN Services' | ||
|
||
client_scripts { | ||
'client.lua' | ||
} | ||
|
||
shared_scripts { | ||
'config.lua', | ||
} | ||
|
||
----- Made By https://aymantv.tebex.io/ | ||
----- For Support, Join my Discord: https://discord.gg/f2Nbv9Ebf5 | ||
----- For custom services or help, check my Fiverr: https://www.fiverr.com/aymannajim |