Raised This Month: $ Target: $400
 0% 

TeamInfo Message


Post New Thread Reply   
 
Thread Tools Display Modes
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
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 05-16-2012 , 15:36   Re: TeamInfo Message
Reply With Quote #2

TeamInfo is called very often for various things.
Try to hook chooseteam and jointeam commands.
__________________
<VeCo> is offline
OvidiuS
Chillaxin'
Join Date: Dec 2009
Location: Serbia
Old 05-16-2012 , 16:56   Re: TeamInfo Message
Reply With Quote #3

Quote:
Originally Posted by <VeCo> View Post
TeamInfo is called very often for various things.
Try to hook chooseteam and jointeam commands.
Thank's for helping, but it would be nice if you write that "various things".
OvidiuS is offline
Send a message via Skype™ to OvidiuS
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 00:30.


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