testanim v2 + 0r_idcard qb-target + animations reference

- testanim refacut: suporta dict/anim/prop/bone/offsets/rotation
- 0r_idcard: migrat DrawText3D la qb-target + bubble 📸 la poza buletin
- Creat docs/animations_reference.md (animatii, props, bones, flags, state bags)
- Auto-oprire animatie anterioara la fiecare testanim
- Fisiere: 17mov_JobCenter/client/utils.lua, 0r_idcard/client/main.lua, docs/animations_reference.md
This commit is contained in:
2026-04-01 01:22:17 +03:00
parent 7a1f7f24eb
commit f2ea62d16c
7 changed files with 111 additions and 46 deletions

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@@ -29,6 +29,21 @@ git tkn: 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
### 📋 Rulebook Updates ### 📋 Rulebook Updates
- ✏️ Regula 13: Commit info (Summary + Description) după fiecare modificare - ✏️ Regula 13: Commit info (Summary + Description) după fiecare modificare
### 🎯 Migrare 0r_idcard → qb-target
- ✏️ `resources/[framework]/[addons]/0r_idcard/client/main.lua` — înlocuit DrawText3D + [E] cu qb-target
- NPC poza buletin: 📷 "Poza pentru buletin/ID" + animație mugshot + bubble 📸
- NPC act fals: 🪪 "Creeaza act fals"
- Eliminat while loop cu sleep (performanță mai bună)
### 🛠️ Testanim Tool (v2)
- ✏️ `17mov_JobCenter/client/utils.lua` — testanim refăcut complet:
- Suportă: `dict anim`, `dict anim propName`, `dict anim propName boneId`, `+ ox oy oz rx ry rz`
- Auto-oprește animația anterioară la fiecare apel
- Fără argumente = afișează help
### 📚 Animations Reference
- 🆕 `docs/animations_reference.md` — referință completă: animații, props, bone IDs, flags, state bags
### 🎯 Migrare Sistem Interacțiuni → qb-target (20 resurse) ### 🎯 Migrare Sistem Interacțiuni → qb-target (20 resurse)
Toate resursele care foloseau DrawText3D `[E]` / Markers au fost trecute pe **qb-target** (third-eye system) pentru experiență uniformă. Toate resursele care foloseau DrawText3D `[E]` / Markers au fost trecute pe **qb-target** (third-eye system) pentru experiență uniformă.

View File

@@ -26,47 +26,64 @@ CreateThread(function()
local fakeCardPed = createPedOnCoord(Config.FakeCardPed.model, Config.FakeCardPed.coords.x, Config.FakeCardPed.coords.y, Config.FakeCardPed.coords.z, Config.FakeCardPed.coords.w) local fakeCardPed = createPedOnCoord(Config.FakeCardPed.model, Config.FakeCardPed.coords.x, Config.FakeCardPed.coords.y, Config.FakeCardPed.coords.z, Config.FakeCardPed.coords.w)
table.insert(Peds, ped) table.insert(Peds, ped)
table.insert(Peds, fakeCardPed) table.insert(Peds, fakeCardPed)
local sleep = 1000
while true do -- qb-target pe NPC-ul de poza buletin
Wait(sleep) exports['qb-target']:AddTargetEntity(ped, {
options = {
{
icon = "fas fa-camera",
label = "Poza pentru buletin/ID",
action = function()
local ped = PlayerPedId()
local playerPed = PlayerPedId() -- Bubble text pt alte playeri
local coords = GetEntityCoords(playerPed) LocalPlayer.state:set("bubbleText", "Isi face poza pentru buletin...", true)
local dist = #(coords - vector3(Config.HeadshotPed.coords.x, Config.HeadshotPed.coords.y, Config.HeadshotPed.coords.z)) LocalPlayer.state:set("bubbleIcon", "📸", true)
local dist2 = #(coords - vector3(Config.FakeCardPed.coords.x, Config.FakeCardPed.coords.y, Config.FakeCardPed.coords.z)) LocalPlayer.state:set("browsingJobs", true, true)
if dist < 2 then -- Animatie de pozare (sta drept, mainile pe langa corp)
sleep = 0 local dict = "mp_facial"
DrawText3D("Apasa ~g~[E]~s~ pentru poza pe buletin/id", Config.HeadshotPed.coords.x, Config.HeadshotPed.coords.y, Config.HeadshotPed.coords.z + 1, 0.03, 0.03) RequestAnimDict(dict)
while not HasAnimDictLoaded(dict) do Wait(10) end
TaskPlayAnim(ped, dict, "mic_chatter_camera3", 2.0, -2.0, -1, 49, 0, false, false, false)
if IsControlJustPressed(0, 38) then startMugshotAnimation()
startMugshotAnimation() Wait(250)
Wait(250) local result = GetBase64(PlayerPedId())
local result = GetBase64(PlayerPedId()) local shot = "assets/default.png"
local shot = "assets/default.png"
if result.success then if result.success then
shot = result.base64 shot = result.base64
end end
Config.Notify(_t("headshot_taken"), "success") -- Opreste animatia + bubble
ClearPedTasks(PlayerPedId())
LocalPlayer.state:set("browsingJobs", false, true)
TriggerServerEvent("0r_idcard:server:saveHeadshot", shot) Config.Notify(_t("headshot_taken"), "success")
end TriggerServerEvent("0r_idcard:server:saveHeadshot", shot)
elseif dist2 < 2 then end,
sleep = 0 },
DrawText3D("Press ~g~[E]~s~ to create a fake card", Config.FakeCardPed.coords.x, Config.FakeCardPed.coords.y, Config.FakeCardPed.coords.z + 1, 0.03, 0.03) },
distance = 2.0
})
if IsControlJustPressed(0, 38) then -- qb-target pe NPC-ul de fake card
lib.showContext('fake_id_card') exports['qb-target']:AddTargetEntity(fakeCardPed, {
end options = {
else {
sleep = 1000 icon = "fas fa-id-card",
end label = "Creeaza act fals",
end action = function()
lib.showContext('fake_id_card')
end,
},
},
distance = 2.0
})
end) end)
lib.registerContext({ lib.registerContext({
id = 'fake_id_card', id = 'fake_id_card',
title = 'Create Fake ID Card', title = 'Create Fake ID Card',

View File

@@ -9,20 +9,53 @@ elseif GetResourceState("ox_target") ~= "missing" then
end end
-- Comenzi utile pentru testare animatii + props -- Comenzi utile pentru testare animatii + props
-- testanim dict anim [propName] [boneId] [ox oy oz] [rx ry rz]
local testProp = nil local testProp = nil
RegisterCommand("testanim", function() RegisterCommand("testanim", function(_, args)
if not args[1] then
print("^3[testanim]^0 Utilizare:")
print(" testanim dict anim -- doar animatie")
print(" testanim dict anim propName -- prop pe mana dreapta (bone 60309)")
print(" testanim dict anim propName boneId -- prop pe bone custom (zero offsets)")
print(" testanim dict anim propName boneId ox oy oz rx ry rz -- full control")
print("^3Exemple:^0")
print(" testanim amb@code_human_in_bus_passenger_idles@female@tablet@base base prop_cs_tablet")
print(" testanim mp_character_creation@lineup@male_a loop_raised prop_police_id_board 28422")
return
end
-- Opreste animatia/propul anterior
ClearPedTasks(PlayerPedId())
if testProp and DoesEntityExist(testProp) then DeleteEntity(testProp) testProp = nil end
local ped = PlayerPedId() local ped = PlayerPedId()
local dict = "amb@code_human_in_bus_passenger_idles@female@tablet@base" local dict = args[1]
local anim = args[2] or "base"
-- Joaca animatia
RequestAnimDict(dict) RequestAnimDict(dict)
while not HasAnimDictLoaded(dict) do Wait(10) end while not HasAnimDictLoaded(dict) do Wait(10) end
TaskPlayAnim(ped, dict, "base", 2.0, -2.0, -1, 49, 0, false, false, false) TaskPlayAnim(ped, dict, anim, 2.0, -2.0, -1, 49, 0, false, false, false)
local model = GetHashKey("prop_cs_tablet")
RequestModel(model) -- Prop optional (arg 3+)
while not HasModelLoaded(model) do Wait(10) end if args[3] then
local coords = GetEntityCoords(ped) local model = GetHashKey(args[3])
testProp = CreateObject(model, coords.x, coords.y, coords.z, true, true, true) RequestModel(model)
AttachEntityToEntity(testProp, ped, GetPedBoneIndex(ped, 60309), while not HasModelLoaded(model) do Wait(10) end
0.03, 0.002, -0.0, 10.0, 160.0, 0.0, true, true, false, true, 1, true) local coords = GetEntityCoords(ped)
testProp = CreateObject(model, coords.x, coords.y, coords.z, true, true, true)
local bone = tonumber(args[4]) or 60309
local ox = tonumber(args[5]) or 0.0
local oy = tonumber(args[6]) or 0.0
local oz = tonumber(args[7]) or 0.0
local rx = tonumber(args[8]) or 0.0
local ry = tonumber(args[9]) or 0.0
local rz = tonumber(args[10]) or 0.0
AttachEntityToEntity(testProp, ped, GetPedBoneIndex(ped, bone),
ox, oy, oz, rx, ry, rz, true, true, false, true, 1, true)
end
end, false) end, false)
RegisterCommand("stopanim", function() RegisterCommand("stopanim", function()