mirror of
https://github.com/citizenfx/cfx-server-data.git
synced 2026-11-10 13:57:18 +01:00
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:
@@ -7,7 +7,7 @@ local function detectUpdates()
|
||||
SetTimeout(500, detectUpdates)
|
||||
|
||||
local template = GetConvar('playerNames_template', '[{{id}}] {{name}}')
|
||||
|
||||
|
||||
if curTemplate ~= template then
|
||||
setNameTemplate(-1, template)
|
||||
|
||||
@@ -20,7 +20,7 @@ local function detectUpdates()
|
||||
local newTag = formatPlayerNameTag(v, template)
|
||||
if newTag ~= curTags[v] then
|
||||
setName(v, newTag)
|
||||
|
||||
|
||||
curTags[v] = newTag
|
||||
end
|
||||
end
|
||||
@@ -37,8 +37,7 @@ AddEventHandler('playerDropped', function()
|
||||
activePlayers[source] = nil
|
||||
end)
|
||||
|
||||
RegisterNetEvent('playernames:init')
|
||||
AddEventHandler('playernames:init', function()
|
||||
RegisterNetEvent('playernames:init', function()
|
||||
reconfigure(source)
|
||||
activePlayers[source] = true
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user