From a9d01b4c9e7e8e5c8b8e544997feae59b0459c65 Mon Sep 17 00:00:00 2001 From: Nico <122193236+Nico8340@users.noreply.github.com> Date: Sat, 4 Jan 2025 21:35:56 +0100 Subject: [PATCH 1/6] Prep: Delete old code --- [gameplay]/headshot/headshot.lua | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 [gameplay]/headshot/headshot.lua diff --git a/[gameplay]/headshot/headshot.lua b/[gameplay]/headshot/headshot.lua deleted file mode 100644 index 7f02c21de..000000000 --- a/[gameplay]/headshot/headshot.lua +++ /dev/null @@ -1,25 +0,0 @@ -local removeHeadOnHeadshot = get("removeHeadOnHeadshot") - -addEvent("onPlayerHeadshot", false) - -local function checkForHeadshot(attacker, weapon, bodypart, loss) - if bodypart == 9 then - local forceDeath = triggerEvent("onPlayerHeadshot", source, attacker, weapon, loss) - - if forceDeath then - killPed(source, attacker, weapon, bodypart) - - if removeHeadOnHeadshot then - setPedHeadless(source, true) - end - end - end -end -addEventHandler("onPlayerDamage", root, checkForHeadshot) - -local function restorePlayerHead() - if removeHeadOnHeadshot and isPedHeadless(source) then - setPedHeadless(source, false) -- Restore head if it got blown off - end -end -addEventHandler("onPlayerSpawn", root, restorePlayerHead) \ No newline at end of file From d942222dd147080cefa57d7c9256245158e18bcf Mon Sep 17 00:00:00 2001 From: Nico <122193236+Nico8340@users.noreply.github.com> Date: Sat, 4 Jan 2025 21:36:22 +0100 Subject: [PATCH 2/6] Prep: Delete old meta and create a new one --- [gameplay]/headshot/meta.xml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/[gameplay]/headshot/meta.xml b/[gameplay]/headshot/meta.xml index 28e79cc7d..e3e1f490a 100644 --- a/[gameplay]/headshot/meta.xml +++ b/[gameplay]/headshot/meta.xml @@ -1,11 +1,12 @@ - -