added IsClientInKickQueue() to deal with a bot issue

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401515
This commit is contained in:
David Anderson
2007-10-01 18:41:39 +00:00
parent 4c4b89a403
commit 2c5cd63552
4 changed files with 48 additions and 1 deletions
+21
View File
@@ -1002,6 +1002,8 @@ static cell_t KickClient(IPluginContext *pContext, const cell_t *params)
return pContext->ThrowNativeError("Client %d is not connected", client);
}
pPlayer->MarkAsBeingKicked();
if (pPlayer->IsFakeClient())
{
char kickcmd[40];
@@ -1091,6 +1093,24 @@ static cell_t NotifyPostAdminCheck(IPluginContext *pContext, const cell_t *param
return 1;
}
static cell_t IsClientInKickQueue(IPluginContext *pContext, const cell_t *params)
{
int client = params[1];
CPlayer *pPlayer = g_Players.GetPlayerByIndex(client);
if (!pPlayer)
{
return pContext->ThrowNativeError("Client index %d is invalid", client);
}
else if (!pPlayer->IsConnected())
{
return pContext->ThrowNativeError("Client %d is not in game", client);
}
return pPlayer->IsInKickQueue() ? 1 : 0;
}
REGISTER_NATIVES(playernatives)
{
{"AddUserFlags", AddUserFlags},
@@ -1140,6 +1160,7 @@ REGISTER_NATIVES(playernatives)
{"KickClient", KickClient},
{"RunAdminCacheChecks", RunAdminCacheChecks},
{"NotifyPostAdminCheck", NotifyPostAdminCheck},
{"IsClientInKickQueue", IsClientInKickQueue},
{NULL, NULL}
};