PHP Code:
#pragma semicolon 1
#include <zombiereloaded>
#include <sdkhooks>
#include <sdktools>
#include <sourcemod>
new Handle:t_timer = INVALID_HANDLE;
new Float:g_cvarRoundTime;
new Float:ForTimer;
public OnPluginStart()
{
HookEvent("round_freeze_end", RoundTime);
}
public OnMapStart()
{
g_cvarRoundTime = GetConVarFloat(FindConVar("mp_roundtime"));
ForTimer = (g_cvarRoundTime*60 - 3);
}
public Action:RoundTime(Handle:event, const String:name[], bool:dontBroadcast)
{
for(new Client = 1; Client <= MaxClients; Client++)
{
if (IsClientInGame(Client))
{
if (ZR_IsClientHuman(Client) && IsPlayerAlive(Client))
{
PrintToChat(Client, "Round start: %0.2f", g_cvarRoundTime);
}
}
}
if (t_timer != INVALID_HANDLE) {
KillTimer(t_timer);
t_timer = INVALID_HANDLE;
}
t_timer = CreateTimer(ForTimer, killer);
}
public Action: killer(Handle:timer)
{
for(new Client = 1; Client <= MaxClients; Client++)
{
if (IsClientInGame(Client))
{
if (ZR_IsClientHuman(Client) && IsPlayerAlive(Client))
{
//SetEntityHealth(Client, 1);
//SlapPlayer(Client, 1, false)
ForcePlayerSuicide(Client);
}
}
}
if (t_timer != INVALID_HANDLE) {
KillTimer(t_timer);
t_timer = INVALID_HANDLE;
}
return Plugin_Handled;
}
public OnPluginEnd()
{
UnhookEvent("round_freeze_end", RoundTime);
}
Why plugin sometimes ignores these conditions?
PHP Code:
public Action: killer(Handle:timer)
{
for(new Client = 1; Client <= MaxClients; Client++)
{
if (IsClientInGame(Client))
{
if (ZR_IsClientHuman(Client) && IsPlayerAlive(Client))
{
And kill zombies ....