#pragma semicolon 1
#pragma newdecls required
#include <sdktools_hooks>
#include <sdktools_functions>
static const float
NULL_SPEED[3],
CT_FREEZE_TIME = 5.0; // время блокировки передвижения и стрельбы CT
Handle hTimer;
public void OnPluginStart()
{
HookEvent("round_start", Event_Start, EventHookMode_PostNoCopy);
HookEvent("round_freeze_end", Event_Start, EventHookMode_PostNoCopy);
}
public void OnMapStart()
{
hTimer = null;
}
public void Event_Start(Event event, const char[] name, bool dontBroadcast)
{
if(hTimer)
{
CloseHandle(hTimer);
hTimer = null;
}
if(name[6] == 'f') hTimer = CreateTimer(CT_FREEZE_TIME, Timer_Unfreeze, _, TIMER_FLAG_NO_MAPCHANGE);
}
public Action Timer_Unfreeze(Handle timer)
{
hTimer = null;
return Plugin_Stop;
}
public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3], float angles[3], int &weapon, int &subtype, int &cmdnum, int &tickcount, int &seed, int mouse[2])
{
if(hTimer && IsClientInGame(client) && GetClientTeam(client) == 3 && IsPlayerAlive(client))
{
TeleportEntity(client, NULL_VECTOR, NULL_VECTOR, NULL_SPEED);
buttons = 0;
return Plugin_Changed
}
return Plugin_Continue;
}