From 30d02ee495a8f5a6e0c9068ac59db1b020c81611 Mon Sep 17 00:00:00 2001 From: Nordi98 Date: Fri, 11 Jul 2025 23:44:49 +0200 Subject: [PATCH] Update cl_dynamitefishing.lua --- .../client/cl_dynamitefishing.lua | 66 ++++++++++--------- 1 file changed, 34 insertions(+), 32 deletions(-) diff --git a/resources/[jobs]/[crime]/nordi_dynamitefishing/client/cl_dynamitefishing.lua b/resources/[jobs]/[crime]/nordi_dynamitefishing/client/cl_dynamitefishing.lua index 137dff513..cc42eabb5 100644 --- a/resources/[jobs]/[crime]/nordi_dynamitefishing/client/cl_dynamitefishing.lua +++ b/resources/[jobs]/[crime]/nordi_dynamitefishing/client/cl_dynamitefishing.lua @@ -61,7 +61,7 @@ local function StartDynamiteFishing() return QBCore.Functions.Notify('Du brauchst eine Rohrbombe!', 'error') end - -- Wurf-Animation (KORRIGIERT) + -- Wurf-Animation local throwDict = "anim@mp_fireworks" local throwAnim = "place_firework_3_box" @@ -74,14 +74,42 @@ local function StartDynamiteFishing() Wait(1500) ClearPedTasks(ped) - -- Skill-Check + -- SKILL CHECK DIREKT NACH DEM WURF if not lib.skillCheck(Config.SkillCheck.difficulty, Config.SkillCheck.keys) then TriggerServerEvent('dynamitefishing:removeItem') isActive = false - return QBCore.Functions.Notify('Fehlgeschlagen!', 'error') + return QBCore.Functions.Notify('Fehlgeschlagen! Die Bombe ist ins Wasser gefallen.', 'error') end - -- Erfolgreich: Sammel-Animation (KORRIGIERT) + -- Berechne Position für Explosion (etwas vor dem Spieler im Wasser) + local coords = GetEntityCoords(ped) + local heading = GetEntityHeading(ped) + local radians = math.rad(heading) + local explosionX = coords.x + 8.0 * math.sin(-radians) + local explosionY = coords.y + 8.0 * math.cos(-radians) + local explosionZ = coords.z - 1.0 -- Etwas unter der Wasseroberfläche + + -- EXPLOSION DIREKT NACH ERFOLGREICHEM SKILL CHECK + AddExplosion(explosionX, explosionY, explosionZ, Config.Explosion.type, Config.Explosion.volume, true, false, Config.Explosion.cameraShake) + + -- PS-DISPATCH ALERT + if Config.Police.enable and math.random(1, 100) <= Config.Police.alertChance then + exports['ps-dispatch']:CustomAlert({ + message = Config.Police.message, + dispatchCode = Config.Police.codeName, + code = Config.Police.code, + icon = Config.Police.icon, + priority = Config.Police.priority, + coords = coords, + gender = GetPlayerGender(), -- Nutzt die Funktion aus ps-dispatch + jobs = { 'police' } + }) + end + + -- Item entfernen (nach erfolgreicher Explosion) + TriggerServerEvent('dynamitefishing:removeItem') + + -- Sammel-Animation nach der Explosion local collectDict = "amb@world_human_stand_fishing@idle_a" local collectAnim = "idle_c" @@ -92,38 +120,12 @@ local function StartDynamiteFishing() TaskPlayAnim(ped, collectDict, collectAnim, 8.0, -8.0, -1, 1, 0, false, false, false) + -- Progressbar für das Sammeln der Fische QBCore.Functions.Progressbar('dynamite_fishing', 'Fische sammeln...', 5000, false, true, { disableMovement = true, disableCarMovement = true }, {}, {}, {}, function() - local coords = GetEntityCoords(ped) - - -- Berechne Position für Explosion (etwas vor dem Spieler im Wasser) - local heading = GetEntityHeading(ped) - local radians = math.rad(heading) - local explosionX = coords.x + 8.0 * math.sin(-radians) - local explosionY = coords.y + 8.0 * math.cos(-radians) - local explosionZ = coords.z - 1.0 -- Etwas unter der Wasseroberfläche - - -- Explosion im Wasser erzeugen - AddExplosion(explosionX, explosionY, explosionZ, Config.Explosion.type, Config.Explosion.volume, true, false, Config.Explosion.cameraShake) - - -- PS-DISPATCH ALERT - if Config.Police.enable and math.random(1, 100) <= Config.Police.alertChance then - -- PS-Dispatch Alert - exports['ps-dispatch']:CustomAlert({ - message = Config.Police.message, - dispatchCode = Config.Police.codeName, - code = Config.Police.code, - icon = Config.Police.icon, - priority = Config.Police.priority, - coords = coords, - gender = GetPlayerGender(), -- Nutzt die Funktion aus ps-dispatch - jobs = { 'police' } - }) - end - - TriggerServerEvent('dynamitefishing:removeItem') + -- Belohnungen nach dem Sammeln TriggerServerEvent('dynamitefishing:reward') ClearPedTasks(ped) isActive = false