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:
@@ -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)
|
||||
table.insert(Peds, ped)
|
||||
table.insert(Peds, fakeCardPed)
|
||||
local sleep = 1000
|
||||
|
||||
while true do
|
||||
Wait(sleep)
|
||||
-- qb-target pe NPC-ul de poza buletin
|
||||
exports['qb-target']:AddTargetEntity(ped, {
|
||||
options = {
|
||||
{
|
||||
icon = "fas fa-camera",
|
||||
label = "Poza pentru buletin/ID",
|
||||
action = function()
|
||||
local ped = PlayerPedId()
|
||||
|
||||
local playerPed = PlayerPedId()
|
||||
local coords = GetEntityCoords(playerPed)
|
||||
local dist = #(coords - vector3(Config.HeadshotPed.coords.x, Config.HeadshotPed.coords.y, Config.HeadshotPed.coords.z))
|
||||
local dist2 = #(coords - vector3(Config.FakeCardPed.coords.x, Config.FakeCardPed.coords.y, Config.FakeCardPed.coords.z))
|
||||
-- Bubble text pt alte playeri
|
||||
LocalPlayer.state:set("bubbleText", "Isi face poza pentru buletin...", true)
|
||||
LocalPlayer.state:set("bubbleIcon", "📸", true)
|
||||
LocalPlayer.state:set("browsingJobs", true, true)
|
||||
|
||||
if dist < 2 then
|
||||
sleep = 0
|
||||
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)
|
||||
|
||||
if IsControlJustPressed(0, 38) then
|
||||
startMugshotAnimation()
|
||||
Wait(250)
|
||||
local result = GetBase64(PlayerPedId())
|
||||
local shot = "assets/default.png"
|
||||
|
||||
if result.success then
|
||||
shot = result.base64
|
||||
end
|
||||
-- Animatie de pozare (sta drept, mainile pe langa corp)
|
||||
local dict = "mp_facial"
|
||||
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)
|
||||
|
||||
Config.Notify(_t("headshot_taken"), "success")
|
||||
startMugshotAnimation()
|
||||
Wait(250)
|
||||
local result = GetBase64(PlayerPedId())
|
||||
local shot = "assets/default.png"
|
||||
|
||||
TriggerServerEvent("0r_idcard:server:saveHeadshot", shot)
|
||||
end
|
||||
elseif dist2 < 2 then
|
||||
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)
|
||||
|
||||
if IsControlJustPressed(0, 38) then
|
||||
lib.showContext('fake_id_card')
|
||||
end
|
||||
else
|
||||
sleep = 1000
|
||||
end
|
||||
end
|
||||
if result.success then
|
||||
shot = result.base64
|
||||
end
|
||||
|
||||
-- Opreste animatia + bubble
|
||||
ClearPedTasks(PlayerPedId())
|
||||
LocalPlayer.state:set("browsingJobs", false, true)
|
||||
|
||||
Config.Notify(_t("headshot_taken"), "success")
|
||||
TriggerServerEvent("0r_idcard:server:saveHeadshot", shot)
|
||||
end,
|
||||
},
|
||||
},
|
||||
distance = 2.0
|
||||
})
|
||||
|
||||
-- qb-target pe NPC-ul de fake card
|
||||
exports['qb-target']:AddTargetEntity(fakeCardPed, {
|
||||
options = {
|
||||
{
|
||||
icon = "fas fa-id-card",
|
||||
label = "Creeaza act fals",
|
||||
action = function()
|
||||
lib.showContext('fake_id_card')
|
||||
end,
|
||||
},
|
||||
},
|
||||
distance = 2.0
|
||||
})
|
||||
end)
|
||||
|
||||
|
||||
lib.registerContext({
|
||||
id = 'fake_id_card',
|
||||
title = 'Create Fake ID Card',
|
||||
|
||||
Reference in New Issue
Block a user