I am trying to print a staff list with all the online staff members on the server
This is my code:
RegisterCommand('staff', function(source)
local catistaff = 0
local staff = vRP.getOnlineAdmins{};
for k,v in pairs(staff) do
local player = vRP.getUserSource{v}
local name = GetPlayerName(player) or "Unknown"
if name ~= "Unknown" then
TriggerClientEvent('chatMessage', player, '^5' .. name .. ' ^0(^5' .. v .. '^0) -> ^1' .. vRP.getUserAdminTitle{v})
catistaff = catistaff +1
end
end
TriggerClientEvent('chatMessage', source, 'Staff Online: ^1' .. catistaff)
end)
And this is the error that I ve got:
[ c-scripting-core] InvokeNative: execution failed: Argument at index 1 was null.
[ script:vrp] SCRIPT ERROR: Execution of native 000000002f7a49e6 in script host failed: Argument at index 1 was null.
[ script:vrp] > [global chunk] (TriggerClientEventInternal.lua:3)
[ script:vrp] > sendStaffMessage (@vrp/modules/admin.lua:411)
[ script:vrp] > callback (@vrp/modules/admin.lua:317)
[ script:vrp] > handler (vrp-lib/Tunnel.lua:139)
[ script:vrp] null