hi my plugin dont work why?
I want to move to the last ct, at the end of round
PHP Code:
register_logevent("logevent_roundEnd", 2, "1=Round_End")
public logevent_roundEnd(){
new tt
tt = Terroristas()
new ct
ct = Counter( )
if( ct == 3){
//engclient_cmd(id, "jointeam", "2")
//engclient_cmd(id, "joinclass", "1")
check_time()
ColorChat(0, GREEN, "fuiste trasnferido por balancimiento (reviso mensaje 1)")
}
}
Terroristas( )
{
new iTerroristas
iTerroristas = 0
new Index
for( Index = 1; Index <= MaxiumUsers; Index++ )
{
if( is_user_connected( Index ) && get_user_team( Index ) == 1 )
iTerroristas++
}
return iTerroristas
}
Counter( )
{
new iCt
iCt = 0
new Index
for( Index = 1; Index <= MaxiumUsers; Index++ )
{
if( is_user_connected( Index ) && get_user_team( Index ) == 2 )
iCt++
}
return iCt
}
public check_time()
{
new Players[32], iNum;
get_players(Players, iNum, "ae", "CT")
for(new i = 1; i <= get_maxplayers(); i++)
{
new id = Players[i]
if(get_user_time(id) < get_user_time(i))
{
if(is_user_connected(id)){
cs_set_user_team(id, CS_TEAM_T)
ColorChat(0, GREEN, "fuiste trasnferido por balancimiento automatico3 (reviso mensaje 2)")
}
}
}
}