Code modernize (#234)

* refactor: declare exports at runtime and drop the player-data provides alias

Signed-off-by: Mathu-lmn <[email protected]>

* refactor: pass handlers directly to RegisterNetEvent

Signed-off-by: Mathu-lmn <[email protected]>

* refactor: use CreateThread/Wait without the Citizen prefix

Signed-off-by: Mathu-lmn <[email protected]>

* chore: remove trailing whitespace, stray lines and unused locals

Signed-off-by: Mathu-lmn <[email protected]>

---------

Signed-off-by: Mathu-lmn <[email protected]>
This commit is contained in:
Mathu-lmn
2026-09-23 21:00:01 +02:00
committed by GitHub
parent 2935a6ba1d
commit 39b91b14ce
23 changed files with 64 additions and 137 deletions
+3 -6
View File
@@ -50,9 +50,7 @@ local function handleRunCode(data, res)
end
end
RegisterNetEvent('runcode:runInBand')
AddEventHandler('runcode:runInBand', function(id, data)
RegisterNetEvent('runcode:runInBand', function(id, data)
local s = source
local privs = GetPrivs(s)
@@ -113,7 +111,7 @@ end
CreateThread(function()
while true do
Wait(1000)
if attempts > 0 and (GetGameTimer() - lastAttempt) > 5000 then
attempts = 0
lastAttempt = 0
@@ -155,8 +153,7 @@ CreateThread(function()
end
end)
RegisterNetEvent('runcode:gotResult')
AddEventHandler('runcode:gotResult', returnCode)
RegisterNetEvent('runcode:gotResult', returnCode)
SetHttpHandler(function(req, res)
local path = req.path