forked from Simnation/Main
ed
This commit is contained in:
parent
ae1730aae7
commit
aa78a2febb
5 changed files with 20 additions and 22 deletions
|
@ -123,8 +123,8 @@ function CheckPlayerArrivalAt(targetPos)
|
||||||
local dist = #(GetEntityCoords(player) - vector3(targetPos.x, targetPos.y, targetPos.z))
|
local dist = #(GetEntityCoords(player) - vector3(targetPos.x, targetPos.y, targetPos.z))
|
||||||
if dist < 2.0 then
|
if dist < 2.0 then
|
||||||
DisableAllControlActions(0)
|
DisableAllControlActions(0)
|
||||||
SetEntityCoords(player, 1121.6, -1553.79, 36.09, false, false, false, true)
|
SetEntityCoords(player, -1878.6747, -322.2974, 50.1690, false, false, false, true)
|
||||||
SetEntityHeading(player, 178.72)
|
SetEntityHeading(player, 47.9116)
|
||||||
StartTreatmentSequence(player)
|
StartTreatmentSequence(player)
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
|
@ -152,7 +152,7 @@ function StartTreatmentSequence(playerPed)
|
||||||
|
|
||||||
-- Spieler an Koordinate setzen
|
-- Spieler an Koordinate setzen
|
||||||
SetEntityCoords(playerPed, 1121.6, -1553.79, 36.09)
|
SetEntityCoords(playerPed, 1121.6, -1553.79, 36.09)
|
||||||
SetEntityHeading(playerPed, 178.72)
|
SetEntityHeading(playerPed, 175.78)
|
||||||
EnableAllControlActions(0)
|
EnableAllControlActions(0)
|
||||||
DoScreenFadeIn(1000)
|
DoScreenFadeIn(1000)
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ Config.DoctorModel = "s_m_m_doctor_01"
|
||||||
Config.StretcherProp = "v_med_bed2"
|
Config.StretcherProp = "v_med_bed2"
|
||||||
|
|
||||||
-- Behandlungskosten
|
-- Behandlungskosten
|
||||||
Config.TreatmentPrice = 5000
|
Config.TreatmentPrice = 200
|
||||||
|
|
||||||
-- Cooldown
|
-- Cooldown
|
||||||
Config.TreatmentCooldown = 30
|
Config.TreatmentCooldown = 30
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
local QBCore = exports['qb-core']:GetCoreObject()
|
local QBCore = exports['qb-core']:GetCoreObject()
|
||||||
|
local isJobMenuOpen = false
|
||||||
|
|
||||||
local function GetJobs()
|
local function GetJobs()
|
||||||
local p = promise.new()
|
local p = promise.new()
|
||||||
|
@ -10,7 +11,8 @@ end
|
||||||
|
|
||||||
local function OpenUI()
|
local function OpenUI()
|
||||||
local job = QBCore.Functions.GetPlayerData().job
|
local job = QBCore.Functions.GetPlayerData().job
|
||||||
SetNuiFocus(true,true)
|
SetNuiFocus(true, true)
|
||||||
|
isJobMenuOpen = true
|
||||||
SendNUIMessage({
|
SendNUIMessage({
|
||||||
action = 'sendjobs',
|
action = 'sendjobs',
|
||||||
activeJob = job["name"],
|
activeJob = job["name"],
|
||||||
|
@ -29,7 +31,8 @@ end)
|
||||||
|
|
||||||
RegisterNUICallback('closemenu', function(data, cb)
|
RegisterNUICallback('closemenu', function(data, cb)
|
||||||
cb({})
|
cb({})
|
||||||
SetNuiFocus(false,false)
|
SetNuiFocus(false, false)
|
||||||
|
isJobMenuOpen = false
|
||||||
end)
|
end)
|
||||||
|
|
||||||
RegisterNUICallback('removejob', function(data, cb)
|
RegisterNUICallback('removejob', function(data, cb)
|
||||||
|
@ -73,18 +76,8 @@ RegisterKeyMapping('jobmenu', "Show Job Management", "keyboard", "J")
|
||||||
|
|
||||||
TriggerEvent('chat:removeSuggestion', '/jobmenu')
|
TriggerEvent('chat:removeSuggestion', '/jobmenu')
|
||||||
|
|
||||||
|
|
||||||
-- Add this to cl_main.lua
|
|
||||||
RegisterNetEvent('ps-multijob:refreshJobs', function()
|
RegisterNetEvent('ps-multijob:refreshJobs', function()
|
||||||
if not IsPauseMenuActive() then -- Only refresh if menu is open
|
if isJobMenuOpen then
|
||||||
local isMenuOpen = false
|
|
||||||
-- Check if the NUI is focused (menu is open)
|
|
||||||
if IsPauseMenuActive() and IsPauseMenuRestarting() then
|
|
||||||
isMenuOpen = true
|
|
||||||
end
|
|
||||||
|
|
||||||
if isMenuOpen then
|
|
||||||
OpenUI() -- Refresh the UI with updated job data
|
OpenUI() -- Refresh the UI with updated job data
|
||||||
end
|
end
|
||||||
end
|
|
||||||
end)
|
end)
|
|
@ -18,7 +18,12 @@ Config.WhitelistJobs = {
|
||||||
["ambulance"] = true,
|
["ambulance"] = true,
|
||||||
["mechanic"] = true,
|
["mechanic"] = true,
|
||||||
["judge"] = true,
|
["judge"] = true,
|
||||||
["lawyer"] = true,
|
["doj"] = true,
|
||||||
|
["admin"] = true,
|
||||||
|
["marshal"] = true,
|
||||||
|
["admin"] = true,
|
||||||
|
["taxi"] = true,
|
||||||
|
["news"] = true,
|
||||||
}
|
}
|
||||||
|
|
||||||
Config.Descriptions = {
|
Config.Descriptions = {
|
||||||
|
|
|
@ -297,13 +297,13 @@ RegisterNetEvent("jobs_creator:injectJobs", function(jobs)
|
||||||
-- This will run when jobs are injected by jobs_creator
|
-- This will run when jobs are injected by jobs_creator
|
||||||
print("ps-multijob: Jobs have been updated by jobs_creator")
|
print("ps-multijob: Jobs have been updated by jobs_creator")
|
||||||
|
|
||||||
-- Optional: You could notify online players that jobs have been updated
|
-- Notify online players that jobs have been updated
|
||||||
-- This would allow them to refresh their job menu to see any new jobs
|
|
||||||
local Players = QBCore.Functions.GetPlayers()
|
local Players = QBCore.Functions.GetPlayers()
|
||||||
for i = 1, #Players do
|
for i = 1, #Players do
|
||||||
local Player = QBCore.Functions.GetPlayer(Players[i])
|
local Player = QBCore.Functions.GetPlayer(Players[i])
|
||||||
if Player then
|
if Player then
|
||||||
TriggerClientEvent('QBCore:Notify', Players[i], "Job system has been updated", "success")
|
TriggerClientEvent('QBCore:Notify', Players[i], "Job system has been updated", "success")
|
||||||
|
TriggerClientEvent('ps-multijob:refreshJobs', Players[i]) -- Trigger refresh event
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue