SR: final polish + KR: add handle clean

This commit is contained in:
dogan 2020-07-24 15:09:40 +02:00
parent 05321cbc8d
commit d035336a2d
2 changed files with 12 additions and 10 deletions

View File

@ -174,6 +174,7 @@ public Action Command_KnifeRevert(int client, int argc)
g_iClientIndexKnifedZombie = -1;
g_bKnife = false;
KillTimer(KnifeRevertTimer);
KnifeRevertTimer = INVALID_HANDLE;
for(int i = 1; i <= MaxClients; i++)
{

View File

@ -28,7 +28,7 @@ public void OnPluginStart()
{
RegConsoleCmd("sm_stuck", Command_StuckRequest, "Send a request to admins for being stuck");
RegConsoleCmd("sm_zstuck", Command_StuckRequest, "Send a request to admins for being stuck");
RegAdminCmd("sm_acc", Command_AcceptRequest, ADMFLAG_GENERIC, "Accept the current stuck-request");
RegAdminCmd("sm_acc", Command_AcceptRequest, ADMFLAG_GENERIC, "Accepts the current stuck-request");
RegAdminCmd("sm_deny", Command_DenyRequest, ADMFLAG_GENERIC, "Denies the current stuck-request");
HookEvent("player_death", OnPlayerDeath);
@ -85,7 +85,7 @@ public void OnClientDisconnect(int client)
{
if(IsAdmin(i))
{
CPrintToChat(i, "{lightgreen}[StuckRequest]{yellow} %N left the Server while having a Request open.", g_iStuckRequester);
CPrintToChat(i, "{lightgreen}[StuckRequest]{yellow} %N left the Server while having a Request open. Request aborted.", g_iStuckRequester);
}
}
@ -102,9 +102,9 @@ public Action Command_StuckRequest(int client, int args)
return Plugin_Handled;
}
if(IsAdmin(client))
if(BaseComm_IsClientGagged(client))
{
CReplyToCommand(client, "{lightgreen}[StuckRequest]{yellow} Don't be silly! Teleport yourself.");
ReplyToCommand(client, "{lightgreen}[StuckRequest]{yellow} Cannot use this while being gagged.");
return Plugin_Handled;
}
@ -120,12 +120,6 @@ public Action Command_StuckRequest(int client, int args)
return Plugin_Handled;
}
if(BaseComm_IsClientGagged(client))
{
ReplyToCommand(client, "{lightgreen}[StuckRequest]{yellow} Cannot use while being gagged.");
return Plugin_Handled;
}
if(!IsPlayerAlive(client))
{
CReplyToCommand(client, "{lightgreen}[StuckRequest]{yellow} Cannot use this while being dead.");
@ -138,6 +132,12 @@ public Action Command_StuckRequest(int client, int args)
return Plugin_Handled;
}
if(IsAdmin(client))
{
CReplyToCommand(client, "{lightgreen}[StuckRequest]{yellow} Don't be silly! Teleport yourself.");
return Plugin_Handled;
}
CReplyToCommand(client, "{lightgreen}[StuckRequest]{yellow} Sent your Request to Admins!");
g_iStuckRequester = client;
SendRequestToAdmin(g_iStuckRequester);
@ -180,6 +180,7 @@ public Action OnStuckRequest(Handle timer)
}
}
return Plugin_Handled;
}