feat: migrare interactiuni la qb-target (20 resurse) + animatie tableta Job Center + bus icon + terminologie devTeam
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
Config = {}
|
||||
|
||||
Config.Lang = "ro" -- Langugage that you want to use (before changing this value make sure that this lang is exists into ./locale directory)
|
||||
Config.UseTarget = false -- Change it to true if you want to use a target system. All settings about the target system are under target.lua file.
|
||||
Config.UseTarget = true -- Change it to true if you want to use a target system. All settings about the target system are under target.lua file.
|
||||
Config.DistanceCheck = true -- Allows to find players that thries to get some job with 17mov_JobCenter:SetPlayerJob event, but he's so far from job center ped. If set to true job will not be set and you will receive information in the server console. Set this to false if you want to open menu from other locations than default with 17mov_JobCenter:OpenMenu event
|
||||
|
||||
-- Configuration of locations where you can open job center menu
|
||||
|
||||
@@ -8,6 +8,75 @@ elseif GetResourceState("ox_target") ~= "missing" then
|
||||
Config.TargetSystem = "qtarget" -- OX_Target have a backward compability to qtarget
|
||||
end
|
||||
|
||||
-- Comenzi utile pentru testare animatii + props
|
||||
local testProp = nil
|
||||
RegisterCommand("testanim", function()
|
||||
local ped = PlayerPedId()
|
||||
local dict = "amb@code_human_in_bus_passenger_idles@female@tablet@base"
|
||||
RequestAnimDict(dict)
|
||||
while not HasAnimDictLoaded(dict) do Wait(10) end
|
||||
TaskPlayAnim(ped, dict, "base", 2.0, -2.0, -1, 49, 0, false, false, false)
|
||||
local model = GetHashKey("prop_cs_tablet")
|
||||
RequestModel(model)
|
||||
while not HasModelLoaded(model) do Wait(10) end
|
||||
local coords = GetEntityCoords(ped)
|
||||
testProp = CreateObject(model, coords.x, coords.y, coords.z, true, true, true)
|
||||
AttachEntityToEntity(testProp, ped, GetPedBoneIndex(ped, 60309),
|
||||
0.03, 0.002, -0.0, 10.0, 160.0, 0.0, true, true, false, true, 1, true)
|
||||
end, false)
|
||||
|
||||
RegisterCommand("stopanim", function()
|
||||
ClearPedTasks(PlayerPedId())
|
||||
if testProp and DoesEntityExist(testProp) then DeleteEntity(testProp) testProp = nil end
|
||||
end, false)
|
||||
|
||||
-- Animatie tableta pentru meniul Job Center
|
||||
local tabletProp = nil
|
||||
local animDict = "amb@code_human_in_bus_passenger_idles@female@tablet@base"
|
||||
local animName = "base"
|
||||
|
||||
Utils.PlayTabletAnim = function()
|
||||
local ped = PlayerPedId()
|
||||
|
||||
-- Incarca animatia
|
||||
RequestAnimDict(animDict)
|
||||
while not HasAnimDictLoaded(animDict) do
|
||||
Wait(10)
|
||||
end
|
||||
|
||||
-- Joaca animatia (flag 49 = loop + upper body + secondary)
|
||||
TaskPlayAnim(ped, animDict, animName, 2.0, -2.0, -1, 49, 0, false, false, false)
|
||||
|
||||
-- Creeaza prop tableta
|
||||
local model = GetHashKey("prop_cs_tablet")
|
||||
RequestModel(model)
|
||||
while not HasModelLoaded(model) do
|
||||
Wait(10)
|
||||
end
|
||||
|
||||
local coords = GetEntityCoords(ped)
|
||||
tabletProp = CreateObject(model, coords.x, coords.y, coords.z, true, true, true)
|
||||
-- Ataseaza la mana dreapta (bone 60309)
|
||||
AttachEntityToEntity(tabletProp, ped, GetPedBoneIndex(ped, 60309),
|
||||
0.03, 0.002, -0.0, 10.0, 160.0, 0.0, true, true, false, true, 1, true)
|
||||
|
||||
SetModelAsNoLongerNeeded(model)
|
||||
RemoveAnimDict(animDict)
|
||||
end
|
||||
|
||||
Utils.StopTabletAnim = function()
|
||||
local ped = PlayerPedId()
|
||||
|
||||
-- Opreste animatia
|
||||
ClearPedTasks(ped)
|
||||
|
||||
-- Sterge prop-ul
|
||||
if tabletProp and DoesEntityExist(tabletProp) then
|
||||
DeleteEntity(tabletProp)
|
||||
tabletProp = nil
|
||||
end
|
||||
end
|
||||
|
||||
Utils.AddEntityToTarget = function(entity)
|
||||
exports[Config.TargetSystem]:AddTargetEntity(entity, {
|
||||
options = {
|
||||
@@ -15,6 +84,7 @@ Utils.AddEntityToTarget = function(entity)
|
||||
icon = "fas fa-briefcase",
|
||||
label = _L("Interaction.Open"),
|
||||
action = function()
|
||||
Utils.PlayTabletAnim()
|
||||
Utils.ToggleNUI(true)
|
||||
end,
|
||||
},
|
||||
@@ -22,3 +92,21 @@ Utils.AddEntityToTarget = function(entity)
|
||||
distance = 1.5
|
||||
})
|
||||
end
|
||||
|
||||
-- Opreste animatia cand se inchide meniul (safety net)
|
||||
-- Monitorizeza NUI focus — cand se pierde, opreste animatia
|
||||
CreateThread(function()
|
||||
local wasOpen = false
|
||||
while true do
|
||||
Wait(500)
|
||||
local nuiFocused = IsNuiFocused()
|
||||
if wasOpen and not nuiFocused then
|
||||
-- Meniul tocmai s-a inchis
|
||||
Utils.StopTabletAnim()
|
||||
wasOpen = false
|
||||
elseif nuiFocused and tabletProp and DoesEntityExist(tabletProp) then
|
||||
wasOpen = true
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
Locale["ro"] = {
|
||||
["Blip.Label"] = "Centru de Locuri de Munca",
|
||||
["Interaction.Open"] = "~r~[E] |~s~ Deschide Centrul de Locuri de Munca",
|
||||
["Interaction.Open"] = "Deschide Centrul de Locuri de Munca",
|
||||
["Notify.Hired"] = "Ai schimbat locul de munca cu succes",
|
||||
["Notify.Waypoint"] = "Punct GPS setat cu succes",
|
||||
["Notify.JobNotRegistered"] = "Locul de munca selectat nu este inregistrat in framework. Raporteaza aceasta problema administratorilor.",
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
<svg width="20" height="18" viewBox="0 0 20 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M3 0C1.34 0 0 1.34 0 3V12.5C0 13.06 0.19 13.57 0.5 14V16.5C0.5 17.05 0.95 17.5 1.5 17.5H2.5C3.05 17.5 3.5 17.05 3.5 16.5V15.5H16.5V16.5C16.5 17.05 16.95 17.5 17.5 17.5H18.5C19.05 17.5 19.5 17.05 19.5 16.5V14C19.81 13.57 20 13.06 20 12.5V3C20 1.34 18.66 0 17 0H3ZM3 1.5H17C17.83 1.5 18.5 2.17 18.5 3V7H1.5V3C1.5 2.17 2.17 1.5 3 1.5ZM3.5 11C4.33 11 5 11.67 5 12.5C5 13.33 4.33 14 3.5 14C2.67 14 2 13.33 2 12.5C2 11.67 2.67 11 3.5 11ZM16.5 11C17.33 11 18 11.67 18 12.5C18 13.33 17.33 14 16.5 14C15.67 14 15 13.33 15 12.5C15 11.67 15.67 11 16.5 11Z" fill="#FF1A35"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 675 B |
Reference in New Issue
Block a user