mirror of
https://github.com/Jackzmc/sourcemod-plugins.git
synced 2025-05-06 13:03:20 +00:00
Prevent admins from being banned
This commit is contained in:
parent
85b04f5c9f
commit
576d429f5b
2 changed files with 5 additions and 1 deletions
|
@ -98,6 +98,8 @@ public Action OnBanClient(int client, int time, int flags, const char[] reason,
|
|||
executor = "CONSOLE";
|
||||
}
|
||||
|
||||
if(GetUserAdmin(client) != INVALID_ADMIN_ID) return Plugin_Stop;
|
||||
|
||||
GetClientAuthId(client, AuthId_Steam2, identity, sizeof(identity));
|
||||
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);
|
||||
return Plugin_Continue;
|
||||
}
|
||||
|
||||
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();
|
||||
char reason[128];
|
||||
DBResult result;
|
||||
results.FetchString(1, reason, sizeof(reason), result);
|
||||
results.FetchString(2, reason, sizeof(reason), result);
|
||||
//TODO: Implement temp bans
|
||||
if(result == DBVal_Data)
|
||||
KickClient(client, "You have been banned: %s", reason);
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue