Raised This Month: $ Target: $400
 0% 

Killermen's Albums
  Album Title Pictures Last Picture
  Jailbreak MaxCt 1
Jailbreak Max Ct 1
Team Limiter By KilLeR MeN =)
Cvar: amx_ct_limit "1" = Max CT
0 None
  Jailbreak MaxCt 1
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <cstrike>

#define PLUGIN "TeamCt Max 1"
#define VERSION "1.0"
#define AUTHOR "KilLeR MeN =)"

new pCTLimit

public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)

register_clcmd ( "chooseteam" , "Switch_Teams" )
register_clcmd ( "join" , "Switch_Teams" )

pCTLimit = register_cvar ( "amx_ct_limit" , "1" )

server_cmd ( "humans_join_team ^"t^"" )
}

public Switch_Teams ( id )
{
new numCTs = countCTs ()

if ( numCTs >= get_pcvar_num ( pCTLimit ) )
cs_set_user_team ( id , CS_TEAM_T)
else
cs_set_user_team ( id , CS_TEAM_CT)
}
public countCTs ()
{
new returnVal = 0

for ( new i = 0 ; i < get_maxplayers () ; i++ )
{
if ( !is_user_connected ( i ) )
continue

new TeamName[3]
get_user_team ( i , TeamName , 2 )

if ( TeamName[0] == 'C' )
returnVal++
}

return returnVal
}
0 None

All times are GMT -4. The time now is 13:26.


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