refactor(modules/npwd): format code

This commit is contained in:
Thekuca
2023-05-07 21:44:24 +02:00
committed by GitHub
parent c501f06975
commit 853df24cde
+22 -22
View File
@@ -1,32 +1,32 @@
local npwd = GetResourceState('npwd'):find('start') and exports.npwd or nil
AddEventHandler('onServerResourceStart', function(resource)
if resource ~= 'npwd' then
return
end
if resource ~= 'npwd' then
return
end
npwd = GetResourceState('npwd'):find('start') and exports.npwd or nil
npwd = GetResourceState('npwd'):find('start') and exports.npwd or nil
for _, xPlayer in pairs(ESX.Players) do
npwd:newPlayer({
source = xPlayer.source,
identifier = xPlayer.identifier,
firstname = xPlayer.get('firstName'),
lastname = xPlayer.get('lastName')
})
end
for _, xPlayer in pairs(ESX.Players) do
npwd:newPlayer({
source = xPlayer.source,
identifier = xPlayer.identifier,
firstname = xPlayer.get('firstName'),
lastname = xPlayer.get('lastName')
})
end
end)
AddEventHandler('onServerResourceStop', function(resource)
if resource == 'npwd' then
npwd = nil
end
if resource == 'npwd' then
npwd = nil
end
end)
AddEventHandler('esx:playerLoaded', function(playerId, xPlayer)
if not npwd then
return
end
if not npwd then
return
end
if not xPlayer then
xPlayer = ESX.GetPlayerFromId(playerId)
@@ -41,9 +41,9 @@ AddEventHandler('esx:playerLoaded', function(playerId, xPlayer)
end)
AddEventHandler('esx:playerLogout', function(playerId)
if not npwd then
return
end
if not npwd then
return
end
npwd:unloadPlayer(playerId)
end)
end)