Skip to content

Commit beaac47

Browse files
committed
Simplify and cancel onVehicleExplode instead (thanks to q8X)
1 parent 3ded13c commit beaac47

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

[editor]/editor_gui/server/override.lua

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,13 @@ addEventHandler("onPlayerQuit", root, function()
2020
playersInBasicTest[source] = nil
2121
end)
2222

23-
addDebugHook("preFunction", function(sourceResource, functionName, isAllowedByACL, luaFilename, luaLineNumber, ...)
24-
if functionName == "blowVehicle" then
25-
for player, _ in pairs(playersInBasicTest) do
26-
if isElement(player) then
27-
return "skip"
23+
addEventHandler("onVehicleExplode", root, function()
24+
for player in pairs(playersInBasicTest) do
25+
if isElement(player) then
26+
local vehicle = getPedOccupiedVehicle(player)
27+
if vehicle == source then
28+
cancelEvent()
2829
end
2930
end
3031
end
31-
end, {"blowVehicle"})
32+
end)

0 commit comments

Comments
 (0)