Prevent admins from being banned

This commit is contained in:
Jackzie 2021-05-03 09:55:17 -05:00
parent 85b04f5c9f
commit 576d429f5b
No known key found for this signature in database
GPG key ID: 1E834FE36520537A
2 changed files with 5 additions and 1 deletions

Binary file not shown.

View file

@ -98,6 +98,8 @@ public Action OnBanClient(int client, int time, int flags, const char[] reason,
executor = "CONSOLE"; executor = "CONSOLE";
} }
if(GetUserAdmin(client) != INVALID_ADMIN_ID) return Plugin_Stop;
GetClientAuthId(client, AuthId_Steam2, identity, sizeof(identity)); GetClientAuthId(client, AuthId_Steam2, identity, sizeof(identity));
GetClientIP(client, ip, sizeof(ip)); GetClientIP(client, ip, sizeof(ip));
@ -113,6 +115,7 @@ public Action OnBanClient(int client, int time, int flags, const char[] reason,
); );
g_db.Query(DB_OnBanQuery, query); g_db.Query(DB_OnBanQuery, query);
return Plugin_Continue;
} }
public Action OnRemoveBan(const char[] identity, int flags, const char[] command, any source) { public Action OnRemoveBan(const char[] identity, int flags, const char[] command, any source) {
@ -141,7 +144,8 @@ public void DB_OnConnectCheck(Database db, DBResultSet results, const char[] err
results.FetchRow(); results.FetchRow();
char reason[128]; char reason[128];
DBResult result; DBResult result;
results.FetchString(1, reason, sizeof(reason), result); results.FetchString(2, reason, sizeof(reason), result);
//TODO: Implement temp bans
if(result == DBVal_Data) if(result == DBVal_Data)
KickClient(client, "You have been banned: %s", reason); KickClient(client, "You have been banned: %s", reason);
else else