Trying to make plugin that automatically silent (no sounds and effect) freeze players on round start. But some players will be respawned in mid-round and getting freeze so how do i make it work for 'round start' only instead of 'player spawn'?
Tried these but doesn't work:
PHP Code:
HookEvent("teamplay_round_start", PlayerSpawn, EventHookMode_Post);
HookEvent("teamplay_round_start", PlayerSpawn, EventHookMode_Pre);
HookEvent("round_start", PlayerSpawn, EventHookMode_Post);
HookEvent("round_start", PlayerSpawn, EventHookMode_Pre);
PHP Code:
#include <sourcemod>
#include <sdktools>
public Plugin:myinfo =
{
name = "Silent Freeze Round Start",
author = "Bonkorn"
}
public OnPluginStart()
{
HookEvent("player_spawn", PlayerSpawn, EventHookMode_Post);
}
public PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
SetEntityMoveType(client, MOVETYPE_NONE);
CreateTimer(10.0, Timer_Unfreeze, client, TIMER_FLAG_NO_MAPCHANGE);
}
public Action:Timer_Unfreeze(Handle:timer, any:client)
{
SetEntityMoveType(client, MOVETYPE_WALK);
}