mirror of
https://github.com/citizenfx/cfx-server-data.git
synced 2025-01-11 00:03:18 +08:00
25 lines
484 B
Lua
25 lines
484 B
Lua
|
RegisterNetEvent('rlUpdateNames')
|
||
|
|
||
|
AddEventHandler('rlUpdateNames', function()
|
||
|
local names = {}
|
||
|
|
||
|
for i = 0, 31 do
|
||
|
if NetworkIsPlayerActive(i) then
|
||
|
names[GetPlayerServerId(i)] = { id = i, name = GetPlayerName(i) }
|
||
|
end
|
||
|
end
|
||
|
|
||
|
TriggerServerEvent('rlUpdateNamesResult', names)
|
||
|
end)
|
||
|
|
||
|
Citizen.CreateThread(function()
|
||
|
while true do
|
||
|
Wait(0)
|
||
|
|
||
|
if NetworkIsSessionStarted() then
|
||
|
TriggerServerEvent('rlPlayerActivated')
|
||
|
|
||
|
return
|
||
|
end
|
||
|
end
|
||
|
end)
|