Skip to content

Commit

Permalink
chores: use lua-format
Browse files Browse the repository at this point in the history
  • Loading branch information
Mcfloy committed Jun 5, 2023
1 parent 4101282 commit 32df03e
Showing 1 changed file with 33 additions and 31 deletions.
64 changes: 33 additions & 31 deletions resources/[soz]/soz-jobs/client/jobs/news.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,26 +52,27 @@ RegisterNetEvent("jobs:client:news:SellNewspaper", function()

local delivery = NewsConfig.Deliveries[math.random(#NewsConfig.Deliveries)]

exports["qb-target"]:AddBoxZone("jobs:news:sell", delivery, 1.0, 1.0, {
name = "jobs:news:sell",
heading = delivery.w,
minZ = delivery.z - 1.5,
maxZ = delivery.z + 1.5,
}, {
options = {
{
label = "Livrer",
color = "news",
icon = "c:news/livrer.png",
event = "jobs:client:news:newspaperSold",
canInteract = function()
return PlayerData.job.onduty
end,
job = "news",
},
exports["qb-target"]:AddBoxZone("jobs:news:sell", delivery, 1.0, 1.0,
{
name = "jobs:news:sell",
heading = delivery.w,
minZ = delivery.z - 1.5,
maxZ = delivery.z + 1.5,
}, {
options = {
{
label = "Livrer",
color = "news",
icon = "c:news/livrer.png",
event = "jobs:client:news:newspaperSold",
canInteract = function()
return PlayerData.job.onduty
end,
job = "news",
},
distance = 2.5,
})
},
distance = 2.5,
})

QBCore.Functions.CreateBlip("jobs:news:sell", {name = "Point de livraison", coords = delivery, route = true})

Expand All @@ -85,15 +86,16 @@ RegisterNetEvent("jobs:client:news:newspaperSold", function()
end)

RegisterNetEvent("jobs:client:news:farmNewspaper", function()
QBCore.Functions.Progressbar("farmNewspaper", "Récupération de journaux", 10000, false, false, {
disableMovement = true,
disableCarMovement = true,
disableMouse = false,
disableCombat = true,
}, {animDict = "anim@narcotics@trash", anim = "drop_front", flags = 16}, {}, {}, function()
StopAnimTask(PlayerPedId(), "anim@narcotics@trash", "drop_front", 1.0)
TriggerServerEvent("jobs:server:news:newspaperFarm")
end)
QBCore.Functions.Progressbar("farmNewspaper", "Récupération de journaux", 10000, false, false,
{
disableMovement = true,
disableCarMovement = true,
disableMouse = false,
disableCombat = true,
}, {animDict = "anim@narcotics@trash", anim = "drop_front", flags = 16}, {}, {}, function()
StopAnimTask(PlayerPedId(), "anim@narcotics@trash", "drop_front", 1.0)
TriggerServerEvent("jobs:server:news:newspaperFarm")
end)
end)

RegisterNetEvent("jobs:client:news:OpenSocietyMenu", function()
Expand Down Expand Up @@ -131,7 +133,7 @@ RegisterNetEvent("jobs:client:news:OpenSocietyMenu", function()
image = exports["soz-hud"]:Input("Lien de l'image de la communication", 255, image)
end)

local messageButton = newsCreationSubMenu:AddButton({label = "Message",length = 235})
local messageButton = newsCreationSubMenu:AddButton({label = "Message", length = 235})

local message = ""

Expand Down Expand Up @@ -159,11 +161,11 @@ RegisterNetEvent("jobs:client:news:OpenSocietyMenu", function()
})

TriggerServerEvent("monitor:server:event", "job_news_create_flash", {flash_type = value},
{message = message, position = GetEntityCoords(PlayerPedId())}, true)
{message = message, position = GetEntityCoords(PlayerPedId())}, true)
end,
})

societyMenu:AddButton({label = "Faire une communication",value = newsCreationSubMenu})
societyMenu:AddButton({label = "Faire une communication", value = newsCreationSubMenu})

societyMenu:AddSlider({
label = "Poser un objet",
Expand Down

0 comments on commit 32df03e

Please sign in to comment.