Steam ID tables again!

Only the people with there steam ID on the table should be able to do function, but everyone can.
Any help?
[lua]
function shit( p )

local id_table= {
“STEAM_0:0:14776474”,-- 1
“STEAM_0:1:17190550”, – 2
“STEAM_0:1:17123456” – 3
}

if table.HasValue(id_table, p:SteamID()) then – Chargin mah lazors.
print( “on table” ) – Shoopdawoop.
else
print( “not on table” ) – Arr ya got meh.
end

end
[/lua]

Try do it like this instead:

[lua]
function Check( ply )

local ids = { “STEAM_0:0:14776474”, “STEAM_0:1:17190550”, "STEAM_0:1:17123456 }

for k, v in pairs( ids ) do
if( v == ply:SteamID() ) then
print( “yo” );
end
end

end
[/lua]

Fixed

What’s wrong with table.HasValue?

[editline]12:05PM[/editline]

That is basically what table.HasValue does.

You tell me, it should work.

Then why’d you post a for loop that does it? I guess it does have it’s uses, table.HasValue doesn’t report back the index the thing corresponds to. Works exactly like what he has in his code.

**[Table.HasValue

http://wiki.garrysmod.com/favicon.ico](http://wiki.garrysmod.com/?title=Table.HasValue)**

Then why wont it work for me…

Post the errors your getting here, we’ll work from that.

No error, just the people who are not on the list are able to do the function as-well.

[lua]local AuthCheck = {“STEAMID”,“STEAMID”,“STEAMID”}

function authnid(ply, steamid)
if table.HasValue(AuthCheck, steamid) then
print(“Player “…ply:Name()…” (”…steamid…") is authed")
else
ply:Kick(“Your not allowed here”)
end
end
hook.Add( “PlayerAuthed”, “authid”, authnid )
[/lua]
Output:
On List:
Player Cubar (STEAMID) is authed

Not on list
Dropped Cubar from server (Kicked by Console : Your not allowed here)