Initial commit
This commit is contained in:
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
/MTATD.bundle.lua
|
||||||
|
/.vscode
|
||||||
63
client.lua
Normal file
63
client.lua
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
----------------------------
|
||||||
|
--Anti magnet script exploit
|
||||||
|
--by Greenlander
|
||||||
|
----------------------------
|
||||||
|
local debug = false -- visualize the line of sight which detects objects in game
|
||||||
|
local blowTime = 10000 -- in milliseconds - Sets the time after which players vehicle gets blows if the timer is not reset within time
|
||||||
|
local resetTime = 100 -- in milliseconds - Sets the time interval to check if gravity is altered and objects are below vehivle
|
||||||
|
|
||||||
|
--Blow vehicle if no objects detected within "blowTime"
|
||||||
|
local blowTimer = setTimer(
|
||||||
|
function()
|
||||||
|
local vehicle = getPedOccupiedVehicle ( getLocalPlayer() )
|
||||||
|
|
||||||
|
if not vehicle then return end
|
||||||
|
|
||||||
|
if getElementData(getLocalPlayer(), 'state') == 'alive' then
|
||||||
|
blowVehicle( vehicle )
|
||||||
|
outputChatBox("[AMS]:#ff8000Get rekt filthy cheater", 255, 255, 255, true)
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
blowTime, 0)
|
||||||
|
|
||||||
|
--Trigger reset of blowTimer every "resetTime" milliseconds if object under vehicle detected
|
||||||
|
setTimer(
|
||||||
|
function()
|
||||||
|
local vehicle = getPedOccupiedVehicle ( getLocalPlayer() )
|
||||||
|
|
||||||
|
if not isTimer(blowTimer) then return end
|
||||||
|
if not vehicle then resetTimer(blowTimer) return end
|
||||||
|
if getElementModel( vehicle ) == 425 then resetTimer(blowTimer) return end
|
||||||
|
|
||||||
|
local v1 = Vector3(0,0,-1)
|
||||||
|
local gx, gy, gz = getVehicleGravity( vehicle )
|
||||||
|
local v2 = Vector3(gx, gy, gz)
|
||||||
|
|
||||||
|
if isVec3Equal(v1, v2) then resetTimer(blowTimer) return end
|
||||||
|
|
||||||
|
local cx, cy, cz = getElementPosition( vehicle )
|
||||||
|
local matrix = getElementMatrix(vehicle)
|
||||||
|
local offX = 0 * matrix[1][1] + 0 * matrix[2][1] - 2 * matrix[3][1] + matrix[4][1]
|
||||||
|
local offY = 0 * matrix[1][2] + 0 * matrix[2][2] - 2 * matrix[3][2] + matrix[4][2]
|
||||||
|
local offZ = 0 * matrix[1][3] + 0 * matrix[2][3] - 2 * matrix[3][3] + matrix[4][3]
|
||||||
|
|
||||||
|
local hit = processLineOfSight(cx, cy, cz, offX, offY, offZ, true, false, false, true, true, true, false, true)
|
||||||
|
|
||||||
|
-- visualize processLineOfSight and print result
|
||||||
|
if debug then
|
||||||
|
dxDrawLine3D(cx, cy, cz, offX, offY, offZ, tocolor(255, 0, 0, 255), 2)
|
||||||
|
print(tostring(hit))
|
||||||
|
end
|
||||||
|
|
||||||
|
if hit then
|
||||||
|
resetTimer(blowTimer)
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
resetTime, 0)
|
||||||
|
|
||||||
|
function isVec3Equal(v1,v2)
|
||||||
|
if (v1.x ~= v2.x) or (v1.y ~= v2.y) or (v1.z ~= v2.z) then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
return true
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user