From 2a14c6fb900fb3ead0fcffdb977e2594b570dad5 Mon Sep 17 00:00:00 2001 From: Fernando-A-Rocha Date: Wed, 31 Jul 2024 13:17:17 +0100 Subject: [PATCH] Update c_testing.lua --- newmodels_reborn/optional/c_testing.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/newmodels_reborn/optional/c_testing.lua b/newmodels_reborn/optional/c_testing.lua index 4021561..8c1d25c 100644 --- a/newmodels_reborn/optional/c_testing.lua +++ b/newmodels_reborn/optional/c_testing.lua @@ -60,7 +60,7 @@ local function drawDebug() dxDrawText(drawStr, SW/2, 30, SW, 0, 0xFFFFFFFF, 1, "default-bold") end -addCommandHandler("newmodelsdebug", function(cmd) +local function toggleDebugView(cmd) if not enabled then if not (debugTimer) or (not isTimer(debugTimer)) then debugTimer = setTimer(updateDebugStr, 1000, 0) end addEventHandler("onClientRender", root, drawDebug, false) @@ -70,4 +70,6 @@ addCommandHandler("newmodelsdebug", function(cmd) end enabled = not enabled outputChatBox(cmd .. " => " .. tostring(enabled)) -end, false) +end +addCommandHandler("newmodelsdebug", toggleDebugView, false) +executeCommandHandler("newmodelsdebug") \ No newline at end of file