3 * Authenticates admins.
4 * This file is part of SourceMod, Copyright (C) 2004-2007 AlliedModders LLC
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26 public Plugin:myinfo =
29 author = "AlliedModders LLC",
30 description = "Authenticates Admins",
31 version = SOURCEMOD_VERSION,
32 url = "http://www.sourcemod.net/"
35 public OnClientAuthorized(client, const String:auth[])
37 if (StrEqual(auth, "BOT")
38 || StrEqual(auth, "STEAM_ID_LAN"))
44 if ((id = FindAdminByIdentity("steam", auth)) == INVALID_ADMIN_ID)
49 decl String:buffer[256], String:account[64];
51 FormatUserLogText(client, buffer, sizeof(buffer));
53 if (GetAdminUsername(id, account, sizeof(account)))
55 LogMessage("%s authenticated to account \"%s\"", buffer, account);
57 LogMessage("%s authenticated to an anonymous account", buffer);
60 SetUserAdmin(client, id);