Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions [gameplay]/trainhorn/client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function soundHorn()
-- Make it so they can't play multiple train horns at the same time (causes lag and distortion)
if (vehicle and getVehicleType(vehicle) == "Train" and getVehicleController(vehicle) == localPlayer and getTickCount() - spam >= 5000) then
spam = getTickCount()
triggerServerEvent("onSyncHorn", resourceRoot)
triggerServerEvent("onSyncHorn", localPlayer)
local x, y, z = getElementPosition(vehicle)
local sound = playSound3D("horn.aac", x, y, z, false)
attachElements(sound, vehicle)
Expand Down Expand Up @@ -45,4 +45,4 @@ function integrityCheck()
unbindKey("horn", "down", soundHorn)
end
end
addEventHandler("onClientPlayerWasted", localPlayer, integrityCheck)
addEventHandler("onClientPlayerWasted", localPlayer, integrityCheck)
4 changes: 2 additions & 2 deletions [gameplay]/trainhorn/server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ function syncHorn()
end
end
addEvent("onSyncHorn", true)
addEventHandler("onSyncHorn", resourceRoot, syncHorn)
addEventHandler("onSyncHorn", root, syncHorn)

function quitHandler()
spam[source] = nil
end
addEventHandler("onPlayerQuit", root, quitHandler)
addEventHandler("onPlayerQuit", root, quitHandler)