Skip to content
Open
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
25 changes: 17 additions & 8 deletions client/gizmo.lua
Original file line number Diff line number Diff line change
Expand Up @@ -76,25 +76,30 @@ local function gizmoLoop(entity)
end

EnterCursorMode()
isCursorActive = true

if IsEntityAPed(entity) then
SetEntityAlpha(entity, 200)
else
SetEntityDrawOutline(entity, true)
end


isCursorActive = true

while gizmoEnabled and DoesEntityExist(entity) do
Wait(0)

DisableControlAction(0, 191, true)
DisableControlAction(0, 176, true)

if IsControlJustPressed(0, 47) then -- G
if isCursorActive then
LeaveCursorMode()
isCursorActive = false
else
EnterCursorMode()
isCursorActive = true
end
isCursorActive = not isCursorActive
end

DisableControlAction(0, 24, true) -- lmb
DisableControlAction(0, 25, true) -- rmb
DisableControlAction(0, 140, true) -- r
Expand All @@ -108,12 +113,15 @@ local function gizmoLoop(entity)
applyEntityMatrix(entity, matrixBuffer)
end
end

if isCursorActive then
LeaveCursorMode()
end

isCursorActive = false

while IsControlPressed(0, 191) or IsDisabledControlPressed(0, 191) do
Wait(0)
end

LeaveCursorMode()

if DoesEntityExist(entity) then
if IsEntityAPed(entity) then SetEntityAlpha(entity, 255) end
SetEntityDrawOutline(entity, false)
Expand All @@ -123,6 +131,7 @@ local function gizmoLoop(entity)
currentEntity = nil
end


local function GetVectorText(vectorType)
if not currentEntity then return 'ERR_NO_ENTITY_' .. (vectorType or "UNK") end
local label = (vectorType == "coords" and "Position" or "Rotation")
Expand Down