-
Notifications
You must be signed in to change notification settings - Fork 0
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
0 parents
commit 697b45f
Showing
15 changed files
with
597 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,29 @@ | ||
RegisterNetEvent('togolo_lib:client:showAdvancedNotification', function (data) | ||
local params = data.params | ||
if params.global then | ||
params.global = nil | ||
TriggerServerEvent('togolo_lib:server:showAdvancedNotification', data) | ||
return | ||
end | ||
showAdvancedNotification(params.message, params.sender, params.subject, params.textureDict, params.iconType, params.color) | ||
end) | ||
|
||
-- iconTypes: | ||
-- 1 : Chat Box | ||
-- 2 : Email | ||
-- 3 : Add Friend Request | ||
-- 4 : Nothing | ||
-- 5 : Nothing | ||
-- 6 : Nothing | ||
-- 7 : Right Jumping Arrow | ||
-- 8 : RP Icon | ||
-- 9 : $ Icon | ||
|
||
function showAdvancedNotification(message, sender, subject, textureDict, iconType, color) | ||
BeginTextCommandThefeedPost('STRING') | ||
AddTextComponentSubstringPlayerName(message) | ||
ThefeedNextPostBackgroundColor(color) | ||
EndTextCommandThefeedPostMessagetext(textureDict, textureDict, true, iconType, sender, subject) | ||
EndTextCommandThefeedPostTicker(false, false) | ||
end | ||
exports('showAdvancedNotification', showAdvancedNotification) |
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,83 @@ | ||
local function createBlips(blipData, options) | ||
local createdBlips = {} | ||
|
||
if options then | ||
if options.job == PlayerData.job.name:lower() or options.gang == PlayerData.gang.name:lower() or options.player == PlayerData.source then | ||
for name, data in pairs(blipData) do | ||
local blip = AddBlipForCoord(data.coords) | ||
SetBlipSprite(blip, data.sprite) | ||
SetBlipAsShortRange(blip, true) | ||
SetBlipScale(blip, data.scale) | ||
SetBlipColour(blip, data.color) | ||
BeginTextCommandSetBlipName('STRING') | ||
AddTextComponentSubstringPlayerName(name) | ||
EndTextCommandSetBlipName(blip) | ||
|
||
table.insert(createdBlips, blip) | ||
end | ||
end | ||
else | ||
for name, data in pairs(blipData) do | ||
local blip = AddBlipForCoord(data.coords) | ||
SetBlipSprite(blip, data.sprite) | ||
SetBlipAsShortRange(blip, true) | ||
SetBlipScale(blip, data.scale) | ||
SetBlipColour(blip, data.color) | ||
BeginTextCommandSetBlipName('STRING') | ||
AddTextComponentSubstringPlayerName(name) | ||
EndTextCommandSetBlipName(blip) | ||
|
||
table.insert(createdBlips, blip) | ||
end | ||
end | ||
|
||
return createdBlips | ||
end | ||
|
||
local function createBlip(blipData, options) | ||
local blip = nil | ||
if options then | ||
if options.job == PlayerData.job.name:lower() or options.gang == PlayerData.gang.name:lower() or options.player == PlayerData.source then | ||
blip = AddBlipForCoord(blipData.coords) | ||
SetBlipSprite(blip, blipData.sprite) | ||
SetBlipAsShortRange(blip, true) | ||
SetBlipScale(blip, blipData.scale) | ||
SetBlipColour(blip, blipData.color) | ||
BeginTextCommandSetBlipName('STRING') | ||
AddTextComponentSubstringPlayerName(blipData.label) | ||
EndTextCommandSetBlipName(blip) | ||
end | ||
if options.route then | ||
SetBlipRoute(blip, true) | ||
if options.routeColor then | ||
SetBlipRouteColour(blip, options.routeColor) | ||
end | ||
end | ||
else | ||
blip = AddBlipForCoord(blipData.coords) | ||
SetBlipSprite(blip, blipData.sprite) | ||
SetBlipAsShortRange(blip, true) | ||
SetBlipScale(blip, blipData.scale) | ||
SetBlipColour(blip, blipData.color) | ||
BeginTextCommandSetBlipName('STRING') | ||
AddTextComponentSubstringPlayerName(blipData.label) | ||
EndTextCommandSetBlipName(blip) | ||
end | ||
return blip | ||
end | ||
|
||
local function deleteBlips(blipData) | ||
for _, blip in ipairs(blipData) do | ||
RemoveBlip(blip) | ||
end | ||
end | ||
|
||
local function deleteBlip(blip) | ||
RemoveBlip(blip) | ||
end | ||
|
||
exports('createBlips', createBlips) | ||
exports('createBlip', createBlip) | ||
|
||
exports('deleteBlips', deleteBlips) | ||
exports('deleteBlip', deleteBlip) |
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,113 @@ | ||
-- Créer via xsound | ||
-- [voice]\xsound\server\exports | ||
|
||
xSound = exports.xsound | ||
-- xSound:setVolume(musicId, data.volume) | ||
RegisterNetEvent('togolo_lib:client:boomBoxPlay', function(source, boomBoxId, data) | ||
xSound:PlayUrlPos(boomBoxId, data.link, data.volume, data.position) | ||
end) | ||
|
||
|
||
RegisterNetEvent('togolo_lib:client:OpenBoomBoxMenu', function() | ||
-- shownGangMenu = true | ||
-- shownBoomBoxMenu = true | ||
|
||
local boomBoxMenu = { | ||
{ | ||
header = 'Cabine DJ', | ||
icon = 'fa-solid fa-circle-info', | ||
isMenuHeader = true, | ||
}, | ||
{ | ||
txt = 'Lancer une musique', | ||
icon = 'fa-solid fa-music', | ||
params = { | ||
event = 'togolo_lib:client:boomBoxPlay', | ||
} | ||
}, | ||
{ | ||
txt = 'Mettre la musique sur pause', | ||
icon = 'fa-solid fa-pause', | ||
params = { | ||
event = 'qb-gangmenu:client:HireMembers', | ||
} | ||
}, | ||
{ | ||
txt = 'Reprendre la musique', | ||
icon = 'fa-solid fa-play', | ||
params = { | ||
event = 'qb-gangmenu:client:Stash', | ||
} | ||
}, | ||
{ | ||
txt = 'Changer le volume', | ||
icon = 'fa-solid fa-volume-high', | ||
params = { | ||
event = 'qb-gangmenu:client:Warbobe', | ||
} | ||
}, | ||
{ | ||
txt = 'Arrêter la musique', | ||
icon = 'fa-solid fa-stop', | ||
params = { | ||
event = 'qb-gangmenu:client:Warbobe', | ||
} | ||
} | ||
} | ||
|
||
-- for _, v in pairs(DynamicMenuItems) do | ||
-- boomBoxMenu[#boomBoxMenu + 1] = v | ||
-- end | ||
|
||
boomBoxMenu[#boomBoxMenu + 1] = { | ||
header = Lang:t('bodygang.exit'), | ||
icon = 'fa-solid fa-angle-left', | ||
params = { | ||
event = 'qb-menu:closeMenu', | ||
} | ||
} | ||
|
||
exports['qb-menu']:openMenu(boomBoxMenu) | ||
end) | ||
|
||
|
||
local function createBoomBox(boomBoxData) | ||
local zoneBoomBoxs = {} | ||
for job, boomBoxs in pairs(boomBoxData) do | ||
for key, boomBox in ipairs(boomBoxs) do | ||
local zoneName = generateZoneName('boomBox', job, key) | ||
local zoneParams = { | ||
name = zoneName, | ||
heading = boomBox.heading, | ||
minZ = boomBox.minZ, | ||
maxZ = boomBox.maxZ, | ||
debugPoly = Config.debug | ||
} | ||
local options = { | ||
{ | ||
type = 'client', | ||
event = 'togolo_lib:client:OpenBoomBoxMenu', | ||
icon = 'fas fa-hand-paper', | ||
label = Lang:t('boomBox.play'), | ||
job = job | ||
} | ||
} | ||
local boxOptions = { | ||
options = options, | ||
distance = 1.5 | ||
} | ||
local zoneBoomBox = exports['qb-target']:AddBoxZone(zoneName, boomBox.coords, boomBox.length, boomBox.width, zoneParams, boxOptions) | ||
table.insert(zoneBoomBoxs, zoneBoomBox.name) | ||
end | ||
end | ||
return zoneBoomBoxs | ||
end | ||
|
||
local function deleteBoomBox(zoneBoomBoxName) | ||
for _, zoneName in ipairs(zoneBoomBoxName) do | ||
exports['qb-target']:RemoveZone(zoneName) | ||
end | ||
end | ||
|
||
exports('createBoomBox', createBoomBox) | ||
exports('deleteBoomBox', deleteBoomBox) |
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,42 @@ | ||
local function createBossMenu(bossMenuData) | ||
local zoneBossMenus = {} | ||
|
||
for job, bossMenus in pairs(bossMenuData) do | ||
|
||
for key, bossMenu in ipairs(bossMenus) do | ||
local zoneName = generateZoneName('bossMenu', job, key) | ||
local zoneParams = { | ||
name = zoneName, | ||
heading = bossMenu.heading, | ||
minZ = bossMenu.minZ, | ||
maxZ = bossMenu.maxZ, | ||
debugPoly = Config.debug | ||
} | ||
local options = { | ||
{ | ||
type = 'client', | ||
event = 'qb-bossmenu:client:OpenMenu', | ||
icon = 'fas fa-ring', | ||
label = Lang:t('bossMenu.open_bossMenu'), | ||
job = job | ||
} | ||
} | ||
local boxOptions = { | ||
options = options, | ||
distance = 1.5 | ||
} | ||
local zoneBossMenu = exports['qb-target']:AddBoxZone(zoneName, bossMenu.coords, bossMenu.length, bossMenu.width, zoneParams, boxOptions) | ||
table.insert(zoneBossMenus, zoneBossMenu.name) | ||
end | ||
end | ||
return zoneBossMenus | ||
end | ||
|
||
local function deleteBossMenu(zoneBossMenusName) | ||
for _, zoneName in ipairs(zoneBossMenusName) do | ||
exports['qb-target']:RemoveZone(zoneName) | ||
end | ||
end | ||
|
||
exports('createBossMenu', createBossMenu) | ||
exports('deleteBossMenu', deleteBossMenu) |
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,48 @@ | ||
local function createClothingRoom(clothingRoomsZones, clothingRoomsOutfit) | ||
local zonesClothingRooms = {} | ||
for job, clothingRooms in pairs(clothingRoomsZones) do | ||
for key, room in ipairs(clothingRooms) do | ||
local zoneName = generateZoneName('clothingRoom', job, key) | ||
|
||
local zoneParams = { | ||
name = zoneName, | ||
heading = room.heading, | ||
minZ = room.minZ, | ||
maxZ = room.maxZ, | ||
debugPoly = Config.debug, | ||
} | ||
|
||
local options = {{ | ||
action = function() | ||
local playerPed = PlayerPedId() | ||
local gradeLevel = PlayerData.job.grade.level | ||
exports['qb-clothing']:getOutfits(gradeLevel, clothingRoomsOutfit[job]) | ||
SetEntityHeading(playerPed, GetEntityHeading(playerPed) + 180) | ||
end, | ||
icon = "fas fa-sign-in-alt", | ||
label = Lang:t("clothing.open_clothingRooms"), | ||
job = job | ||
}} | ||
|
||
local boxOptions = { | ||
options = options, | ||
distance = 1.5 | ||
} | ||
|
||
local zoneClothingRoom = exports['qb-target']:AddBoxZone(zoneName, room.coords, room.length, room.width, zoneParams, boxOptions) | ||
table.insert(zonesClothingRooms, zoneClothingRoom.name) | ||
end | ||
end | ||
return zonesClothingRooms | ||
end | ||
|
||
|
||
local function deleteClothingRoom(zonesClothingRooms) | ||
for _, zoneName in ipairs(zonesClothingRooms) do | ||
exports['qb-target']:RemoveZone(zoneName) | ||
end | ||
end | ||
|
||
exports('createClothingRoom', createClothingRoom) | ||
exports('deleteClothingRoom', deleteClothingRoom) | ||
|
Oops, something went wrong.