ed
This commit is contained in:
parent
8583400066
commit
87ba32a6be
12 changed files with 3 additions and 941 deletions
|
@ -106,7 +106,7 @@ local function toggleAnchor(vehicle)
|
|||
local vehicleNetId = NetworkGetNetworkIdFromEntity(vehicle)
|
||||
|
||||
if anchoredBoats[vehicleNetId] then
|
||||
-- Anker lichten
|
||||
-- Anker lichten (ohne Wackel-Effekt)
|
||||
FreezeEntityPosition(vehicle, false)
|
||||
SetEntityInvincible(vehicle, false)
|
||||
anchoredBoats[vehicleNetId] = nil
|
||||
|
@ -115,19 +115,8 @@ local function toggleAnchor(vehicle)
|
|||
removeAnchorFromServer(vehicle)
|
||||
|
||||
QBCore.Functions.Notify('⚓ Anker gelichtet! Das Boot kann wieder bewegt werden.', 'success')
|
||||
|
||||
-- Effekt: Kurzes Wackeln beim Anker lichten
|
||||
CreateThread(function()
|
||||
local originalCoords = GetEntityCoords(vehicle)
|
||||
for i = 1, 10 do
|
||||
local offset = math.random(-10, 10) / 100
|
||||
SetEntityCoords(vehicle, originalCoords.x + offset, originalCoords.y + offset, originalCoords.z)
|
||||
Wait(50)
|
||||
end
|
||||
SetEntityCoords(vehicle, originalCoords.x, originalCoords.y, originalCoords.z)
|
||||
end)
|
||||
else
|
||||
-- Anker werfen
|
||||
-- Anker werfen (ohne Sound und Effekte)
|
||||
local coords = GetEntityCoords(vehicle)
|
||||
local heading = GetEntityHeading(vehicle)
|
||||
|
||||
|
@ -146,33 +135,6 @@ local function toggleAnchor(vehicle)
|
|||
saveAnchorToServer(vehicle, anchorData)
|
||||
|
||||
QBCore.Functions.Notify('⚓ Anker geworfen! Das Boot ist jetzt verankert.', 'success')
|
||||
|
||||
-- Anker-Wurf Effekt
|
||||
CreateThread(function()
|
||||
-- Spiele Anker-Sound
|
||||
PlaySoundFromEntity(-1, "CHECKPOINT_PERFECT", vehicle, "HUD_MINI_GAME_SOUNDSET", 0, 0)
|
||||
|
||||
-- Kleine Wellen-Animation
|
||||
for i = 1, 5 do
|
||||
local coords = GetEntityCoords(vehicle)
|
||||
local waterHeight = GetWaterHeight(coords.x, coords.y, coords.z)
|
||||
if waterHeight then
|
||||
local effect = "ent_sht_water"
|
||||
RequestNamedPtfxAsset(effect)
|
||||
while not HasNamedPtfxAssetLoaded(effect) do
|
||||
Wait(1)
|
||||
end
|
||||
|
||||
for j = 1, 3 do
|
||||
local offsetX = math.random(-200, 200) / 100
|
||||
local offsetY = math.random(-200, 200) / 100
|
||||
UseParticleFxAssetNextCall(effect)
|
||||
StartParticleFxNonLoopedAtCoord("ent_sht_water", coords.x + offsetX, coords.y + offsetY, waterHeight, 0.0, 0.0, 0.0, 0.5, false, false, false)
|
||||
end
|
||||
end
|
||||
Wait(200)
|
||||
end
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -709,6 +671,6 @@ RegisterCommand('anchor', function()
|
|||
end
|
||||
end, false)
|
||||
|
||||
-- Keybinds registrieren
|
||||
-- Keybinds registrieren (F1 statt F6)
|
||||
RegisterKeyMapping('seats', 'Sitzplatz Menü öffnen', 'keyboard', 'F1')
|
||||
RegisterKeyMapping('anchor', 'Anker werfen/lichten', 'keyboard', 'H')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue