„ams.lua“ ändern
Changed hit detection from timer based to pre render
This commit is contained in:
8
ams.lua
8
ams.lua
@@ -20,8 +20,8 @@ local blowTimer = setTimer(
|
|||||||
end,
|
end,
|
||||||
blowTime, 0)
|
blowTime, 0)
|
||||||
|
|
||||||
--Trigger reset of blowTimer every "resetTime" milliseconds if object under vehicle detected
|
--Trigger reset of blowTimer if object under vehicle is detected
|
||||||
setTimer(
|
addEventHandler('onClientPreRender', root,
|
||||||
function()
|
function()
|
||||||
local vehicle = getPedOccupiedVehicle ( getLocalPlayer() )
|
local vehicle = getPedOccupiedVehicle ( getLocalPlayer() )
|
||||||
|
|
||||||
@@ -52,8 +52,8 @@ setTimer(
|
|||||||
if hit then
|
if hit then
|
||||||
resetTimer(blowTimer)
|
resetTimer(blowTimer)
|
||||||
end
|
end
|
||||||
end,
|
end
|
||||||
resetTime, 0)
|
)
|
||||||
|
|
||||||
function isVec3Equal(v1,v2)
|
function isVec3Equal(v1,v2)
|
||||||
if (v1.x ~= v2.x) or (v1.y ~= v2.y) or (v1.z ~= v2.z) then
|
if (v1.x ~= v2.x) or (v1.y ~= v2.y) or (v1.z ~= v2.z) then
|
||||||
|
|||||||
Reference in New Issue
Block a user