forked from Simnation/Main
Update cl_dynamitefishing.lua
This commit is contained in:
parent
7b77cb1d49
commit
30d02ee495
1 changed files with 34 additions and 32 deletions
|
@ -61,7 +61,7 @@ local function StartDynamiteFishing()
|
||||||
return QBCore.Functions.Notify('Du brauchst eine Rohrbombe!', 'error')
|
return QBCore.Functions.Notify('Du brauchst eine Rohrbombe!', 'error')
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Wurf-Animation (KORRIGIERT)
|
-- Wurf-Animation
|
||||||
local throwDict = "anim@mp_fireworks"
|
local throwDict = "anim@mp_fireworks"
|
||||||
local throwAnim = "place_firework_3_box"
|
local throwAnim = "place_firework_3_box"
|
||||||
|
|
||||||
|
@ -74,14 +74,42 @@ local function StartDynamiteFishing()
|
||||||
Wait(1500)
|
Wait(1500)
|
||||||
ClearPedTasks(ped)
|
ClearPedTasks(ped)
|
||||||
|
|
||||||
-- Skill-Check
|
-- SKILL CHECK DIREKT NACH DEM WURF
|
||||||
if not lib.skillCheck(Config.SkillCheck.difficulty, Config.SkillCheck.keys) then
|
if not lib.skillCheck(Config.SkillCheck.difficulty, Config.SkillCheck.keys) then
|
||||||
TriggerServerEvent('dynamitefishing:removeItem')
|
TriggerServerEvent('dynamitefishing:removeItem')
|
||||||
isActive = false
|
isActive = false
|
||||||
return QBCore.Functions.Notify('Fehlgeschlagen!', 'error')
|
return QBCore.Functions.Notify('Fehlgeschlagen! Die Bombe ist ins Wasser gefallen.', 'error')
|
||||||
end
|
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 collectDict = "amb@world_human_stand_fishing@idle_a"
|
||||||
local collectAnim = "idle_c"
|
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)
|
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, {
|
QBCore.Functions.Progressbar('dynamite_fishing', 'Fische sammeln...', 5000, false, true, {
|
||||||
disableMovement = true,
|
disableMovement = true,
|
||||||
disableCarMovement = true
|
disableCarMovement = true
|
||||||
}, {}, {}, {}, function()
|
}, {}, {}, {}, function()
|
||||||
local coords = GetEntityCoords(ped)
|
-- Belohnungen nach dem Sammeln
|
||||||
|
|
||||||
-- 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')
|
|
||||||
TriggerServerEvent('dynamitefishing:reward')
|
TriggerServerEvent('dynamitefishing:reward')
|
||||||
ClearPedTasks(ped)
|
ClearPedTasks(ped)
|
||||||
isActive = false
|
isActive = false
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue