Raised This Month: $51 Target: $400
 12% 

FireToClient MethodMap


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Vit_amin
Senior Member
Join Date: Dec 2015
Location: Russian Federation
Old 10-23-2017 , 19:23   FireToClient MethodMap
Reply With Quote #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;
}
Vit_amin is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:39.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode