NoAdminTools: some fixed

feel free to improve the code, right now too tired to look at it
This commit is contained in:
Dogan 2019-07-08 16:01:07 +02:00
parent 5f01907035
commit 5edac45eb7

View File

@ -95,7 +95,7 @@ public void OnClientDisconnect(int client)
public void OnClientPostAdminCheck(int client)
{
if(CheckCommandAccess(client, "", ADMFLAG_GENERIC) && IsValidClient(client))
if(CheckCommandAccess(client, "", ADMFLAG_GENERIC))
{
g_bActiveAdmin[client] = true;
}
@ -127,8 +127,10 @@ public Action Timer_DelaySelfExtend(Handle timer)
public Action Command_DisplayActiveAdmins(int client, int args)
{
for(int i = 1; i <= MaxClients; i++)
if(CheckCommandAccess(i, "", ADMFLAG_GENERIC) && IsValidClient(i) && ActiveAdmin(i))
if(IsValidClient(i) && CheckCommandAccess(i, "", ADMFLAG_GENERIC) && ActiveAdmin(i))
g_bActiveAdmin[i] = true;
else if(IsValidClient(i) && CheckCommandAccess(i, "", ADMFLAG_GENERIC) && !ActiveAdmin(i))
g_bActiveAdmin[i] = false;
char aBuf[1024];
char aBuf2[MAX_NAME_LENGTH];
@ -137,7 +139,7 @@ public Action Command_DisplayActiveAdmins(int client, int args)
for(int i = 1; i <= MaxClients; i++)
{
if(IsClientInGame(i) && !IsFakeClient(i))
if(IsValidClient(i))
{
if(g_bActiveAdmin[i])
{
@ -146,7 +148,7 @@ public Action Command_DisplayActiveAdmins(int client, int args)
StrCat(aBuf, sizeof(aBuf), ", ");
}
if(!g_bActiveAdmin[i] && CheckCommandAccess(i, "", ADMFLAG_GENERIC) && IsValidClient(i))
if(CheckCommandAccess(i, "", ADMFLAG_GENERIC) && !g_bActiveAdmin[i])
{
GetClientName(i, bBuf2, sizeof(bBuf2));
StrCat(bBuf, sizeof(bBuf), bBuf2);