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')
|
||||
end
|
||||
|
||||
-- Wurf-Animation (KORRIGIERT)
|
||||
-- Wurf-Animation
|
||||
local throwDict = "anim@mp_fireworks"
|
||||
local throwAnim = "place_firework_3_box"
|
||||
|
||||
|
@ -74,43 +74,26 @@ 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)
|
||||
local collectDict = "amb@world_human_stand_fishing@idle_a"
|
||||
local collectAnim = "idle_c"
|
||||
|
||||
RequestAnimDict(collectDict)
|
||||
while not HasAnimDictLoaded(collectDict) do
|
||||
Wait(10)
|
||||
end
|
||||
|
||||
TaskPlayAnim(ped, collectDict, collectAnim, 8.0, -8.0, -1, 1, 0, false, false, false)
|
||||
|
||||
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 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 im Wasser erzeugen
|
||||
-- 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
|
||||
-- PS-Dispatch Alert
|
||||
exports['ps-dispatch']:CustomAlert({
|
||||
message = Config.Police.message,
|
||||
dispatchCode = Config.Police.codeName,
|
||||
|
@ -123,7 +106,26 @@ local function StartDynamiteFishing()
|
|||
})
|
||||
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"
|
||||
|
||||
RequestAnimDict(collectDict)
|
||||
while not HasAnimDictLoaded(collectDict) do
|
||||
Wait(10)
|
||||
end
|
||||
|
||||
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()
|
||||
-- Belohnungen nach dem Sammeln
|
||||
TriggerServerEvent('dynamitefishing:reward')
|
||||
ClearPedTasks(ped)
|
||||
isActive = false
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue