FireToClient MethodMap

V

Vit_amin

Guest
#1
Hello. Please tell me how to remove correctly handle's from FireToClient

My code below

Code:
public Action TimerHandler_VoteCooldown(Handle hTimer)
{
if (g_bIsVoteStarted)
{
Event hEvent = CreateEvent("vote_ended");

for (int i = 1; i <= MaxClients; i++)
{
if (IsClientInGame(i) && GetClientTeam(i) == g_iVoteTeam && !IsFakeClient(i))
{
hEvent.FireToClient(i);
}
}

delete hEvent;

switch (g_iVoteYes > g_iVoteNo)
{
case true:
{
hEvent = CreateEvent("vote_passed");

hEvent.SetString("details", "#L4D_vote_passed_kick_player");
hEvent.SetString("param1", g_szVoteIssue);

hEvent.SetInt("team", g_iVoteTeam);

for (int i = 1; i <= MaxClients; i++)
{
if (IsClientInGame(i) && GetClientTeam(i) == g_iVoteTeam && !IsFakeClient(i))
{
hEvent.FireToClient(i);
}
}

delete hEvent;
}
case false:
{
hEvent = CreateEvent("vote_failed");

hEvent.SetInt("team", g_iVoteTeam);

for (int i = 1; i <= MaxClients; i++)
{
if (IsClientInGame(i) && GetClientTeam(i) == g_iVoteTeam && !IsFakeClient(i))
{
hEvent.FireToClient(i);
}
}

delete hEvent;
}
}

g_bIsVoteStarted = false;
}

return Plugin_Continue;
}​
 
   
   
   
Top