Skip to content

Instantly share code, notes, and snippets.

View Xinerki's full-sized avatar
💬
!!

Xin Xinerki

💬
!!
View GitHub Profile
@Xinerki
Xinerki / beacons.lua
Created June 6, 2023 06:59
nfs heat style
function math.clamp(value, minClamp, maxClamp)
return math.min(maxClamp, math.max(value, minClamp))
end
function DrawSprite3D(textureDict, textureName, x, y, z, width, height, heading, red, green, blue, alpha)
x = x + math.sin(math.rad(-heading-90.0)) * (width*0.5)
y = y + math.cos(math.rad(-heading-90.0)) * (width*0.5)
--z = z -0.5
local offX = math.sin(math.rad(-heading+90)) * width
function lerp(x1, x2, t)
return x1 + (x2 - x1) * t
end
pos = GetEntityPosition(PlayerPedId())
camPos = pos + vec(1.0, 1.0, 1.0) -- your camera calculation goes here
local ray = StartExpensiveSynchronousShapeTestLosProbe(pos.x, pos.y, pos.z, camPos.x, camPos.y, camPos.z, -1, PlayerPedId(), 0)
local _, hit, _end, _, hitEnt = GetShapeTestResult(ray)