I have made a client-side kick script, and confirmed that the script is registered correctly as I am able to log the entrance of the script. However, it doesn’t seem to enter the loop of users even that I know that a least one user is logged into the server.
Can anyone help me with this small script?
RegisterCommand('kick', function(source, args)
local reason = args[2] or 'No reason specified'
for _, k in ipairs(GetPlayers()) do
local name = GetPlayerName(k)
if name == args[1] then
QBCore.Functions.Kick(k, reason, nil, nil)
end
end
end, false)