Quote:
Originally Posted by Zyten
thx works,
Mutes all who respawn can that be bypassed somehow? (jailbreak server)
|
PHP Code:
#include <sourcemod>
#include <sdktools>
#pragma newdecls required
#pragma semicolon 1
ConVar gCV_Respawn = null;
public void OnPluginStart()
{
gCV_Respawn = FindConVar("mp_respawn_on_death_t");
if (gCV_Respawn == null)
SetFailState("The cvar 'mp_respawn_on_death_t' isn't valid (Not CS:GO?)");
HookEvent("player_spawn", Event_PlayerSpawn, EventHookMode_Post);
HookEvent("player_death", Event_CheckStatus, EventHookMode_Post);
HookEvent("round_start", Event_CheckStatus, EventHookMode_Post);
}
public void OnClientDisconnect_Post(int client)
{
if (!gCV_Respawn.BoolValue && GetTeamClientCount(3) == 0)
gCV_Respawn.SetInt(1);
}
public void Event_PlayerSpawn(Event hEvent, const char[] sEventName, bool bDontBroadcast)
{
if (gCV_Respawn.BoolValue)
{
int client = GetClientOfUserId(hEvent.GetInt("userid"));
if (0 < client <= MaxClients && IsClientInGame(client)) {
SetClientListeningFlags(client, VOICE_NORMAL);
}
}
}
public void Event_CheckStatus(Event hEvent, const char[] sEventName, bool bDontBroadcast)
{
if (GetTeamClientCount(3) == 0)
{
if (!gCV_Respawn.BoolValue)
gCV_Respawn.SetInt(1);
}
else
{
if (gCV_Respawn.BoolValue)
gCV_Respawn.SetInt(0);
}
}
Assuming this is for CS:GO
__________________