Raised This Month: $ Target: $400
 0% 

TeamInfo Message


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
OvidiuS
Chillaxin'
Join Date: Dec 2009
Location: Serbia
Old 05-16-2012 , 15:05   TeamInfo Message
Reply With Quote #1

When is it called? When player change team, or when player join team, on spawn, etc..
Code:
	register_message(get_user_msgid("TeamInfo"), "msgTeamInfo")
Can i do something like this to block join ct team if more than 3 player in ct team?
Code:
#include < amxmodx >
#include < cstrike >

public plugin_init( )
{
	register_message(get_user_msgid("TeamInfo"), "msgTeamInfo")
}

public msgTeamInfo(msg_id, msg_dest)
{
	if (msg_dest != MSG_ALL && msg_dest != MSG_BROADCAST)
		return;
	
	static iTeam[2];
	get_msg_arg_string(2, iTeam, charsmax(iTeam))
	
	switch (iTeam[0])
	{
		case 'C': 
		{
			new iCT = GetPlayerCount( CS_TEAM_CT );
			if( iCT > 3 ) set_msg_arg_string( 2, "TERRORIST" );
		}
	}
}

GetPlayerCount( CsTeams:iTeam )
{
	new iPlayers[ 32 ] , iPlayerCount;
	new iTeamPlayers[ CsTeams ];
	
	get_players( iPlayers , iPlayerCount ); 
	
	for ( new i = 0 ; i < iPlayerCount ; i++ )
		iTeamPlayers[ cs_get_user_team( iPlayers[ i ] ) ]++;
  
	return iTeamPlayers[ iTeam ];
}
OvidiuS is offline
Send a message via Skype™ to OvidiuS
 


Thread Tools
Display Modes

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 00:30.


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