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

[CS:GO] Need help with Plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
QazthePineapple
New Member
Join Date: Jul 2015
Old 07-14-2015 , 03:38   [CS:GO] Need help with Plugin
Reply With Quote #1

Need help with a a bit code , that Counts how many players are alive on each time and when one team has more players it announces in chat.

Code:
public Event_PlayerDeath (Handle:event, const String:name[], bool:dontBroadcast)
{
		new Ts
		new CTs
		UpdatePlayerCounts(Ts, CTs);
		if (Ts >= CTs || Ts == CTs)
		{
			PrintToChatAll("Terrorist Rush");
		}
		else
		{
			PrintToChatAll("Counter-Terrorist Rush");
		}
		
		
}

UpdatePlayerCounts(Ts , CTs)
{
	for(new i = 1; i <= MaxClients; i++)
	{
		if (IsClientInGame(i) && IsPlayerAlive(i))
		{
			if (GetClientTeam(i) == CS_TEAM_T)
			{
				Ts++;
			}
			else if (GetClientTeam(i) == CS_TEAM_CT)
			{
				CTs++;
				
			}
			
		}
	}

Thank you in future for any help.
QazthePineapple 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 01:24.


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