I don't know if this goes here.
Good guys, I need help with this code I modified myself. The original code is this:
local whitelist = { "SteamID1", "SteamID2" } -- add your steam id's here
function CheckWhiteList( ply )
if not ULib.findInTable( whitelist, ply ) then
ULib.kick( ply )
end
end
hook.Add( "PlayerInitialSpawn", "WhitelistCheck", CheckWhiteList )
I modified the code so that only leaked to those in certain group:
function CheckWhiteList( ply )
if
not ply:CheckGroup("vip") or
not ply:CheckGroup("guia") or
not ply:IsAdmin()
then
ULib.kick ( ply )
end
end
hook.Add( "PlayerInitialSpawn", "WhitelistCheck", CheckWhiteList )
And my problem is... The code down the server when kick someone.
If you can help me with this. And sorry for my bad english.
P.D: My server show this error:
[ERROR] gamemodes/base/gamemode/player.lua:213: Tried to use a NULL entity!
1. SetTeam - [C]:-1
2. PlayerInitialSpawn - gamemodes/base/gamemode/player.lua:213
3 unkown - gamemodes/sandbox/gamemode/init.lua:121
I found a simpler way, and adding my groups to "ULX reservedslots". Close post pls.