The overall code doesn't make much sense.
First, preffer using local variables than global ones.
Second, you can use a Trie (search the forums for implementations on these) to store the Steam IDs and look them up.
There's no need to complicate it like you did. If you want an example on any of these, feel free to ask for it.