Rconlog error GetNumPlayerIdentifiers(null) rconlog_server.lua:55

■■■■■■■ was in FXServer resources by default, so I think I should report this.

> status
InvokeNative: execution failed: Argument at index 0 was null.
Error running system event handling function for resource ■■■■■■■: citizen:/scripting/lua/scheduler.lua:39: Failed to execute thread: Execution of native 00000000ff7f66ab in script host failed.
stack traceback:
	[C]: in upvalue '_in'
	citizen:/scripting/lua/natives_server.lua:97: in function 'GetNumPlayerIdentifiers'
	citizen:/scripting/lua/scheduler.lua:195: in function 'GetPlayerIdentifiers'
	rconlog_server.lua:55: in upvalue 'handler'
	citizen:/scripting/lua/scheduler.lua:124: in function <citizen:/scripting/lua/scheduler.lua:123>
stack traceback:
	[C]: in function 'error'
	citizen:/scripting/lua/scheduler.lua:39: in field 'CreateThreadNow'
	citizen:/scripting/lua/scheduler.lua:123: in function <citizen:/scripting/lua/scheduler.lua:92>
No such command status.

I guess I should rewrite status command, add check for 0 or nil before calling GetNumPlayerIdentifiers. But is it enoght? Maybe something else should be changed elsewhere? I wonder if this bug is considered normal and will be moved to technical support.

Hm - what server state caused this? It’s been something not seen before, normally this doesn’t happen…

Maybe I did something wrong in playerConnecting or playerDropped event handlers? I’m dropping clients without “steam:” identifier, can it be the reason?

You’re using DropPlayer on a source from playerConnecting, I guess?

No, I’m using KickReason and CancelEvent in playerConnecting, but I have DropPlayer in other event that I send from my client script. I was using simple thread starting with Wait(2000) to send event to server to load player data few seconds after resource startup on client side. Looks like that event may arrive too early. Added this line before sending it.

while not NetworkIsSessionStarted() do Wait(100) end

It happened again. I wonder how is it possible. Keys in names are actually netids and if key value pair was added to names it means that GetPlayerName, GetPlayerIdentifiers and GetPlayerEP was called successfully for that netid without error in rlPlayerActivated event handler.

AddEventHandler('rlPlayerActivated', function()
    ■■■■■■■({ msgType = 'playerActivated', netID = source, name = GetPlayerName(source), guid = GetPlayerIdentifiers(source)[1], ip = GetPlayerEP(source) })

    names[source] = { name = GetPlayerName(source), id = source }

    TriggerClientEvent('rlUpdateNames', GetHostId())
end)
1 Like

There is no fix yet ? i still have the same problem and i couldn’t find where the problem exactly at !

Same…

2 Likes