• making a simple ip banlist
    2 replies, posted
So basically I have this code: [code]BannedIPs = { "00.00.00.00" --Example IP Ban } hook.Add("PlayerInitialSpawn", "CheckBannedIPs", function(ply) if (string.find(ply:IPAddress(), BannedIPs, 1, true)) then local id = ply:SteamID(); RunConsoleCommand("ulx", "banid", id, 0, "[IP Blacklisted]"); end end)[/code] But I get this error: [code]143: bad argument #2 to 'find' (string expected, got table)[/code] how would i fix this?
You should use table.HasValue instead of string.find - the error is quite clear as to what the problem is
[QUOTE=NiandraLades;48628073]You should use table.HasValue instead of string.find - the error is quite clear as to what the problem is[/QUOTE] :facepalm: thanks.
Sorry, you need to Log In to post a reply to this thread.