Hey, I built a function that is called, but for some wierd reason after it is called (and im sure it is called cuz i did a client_print to see if it reaches there) it never calls the function StartMatch(), why is that??
Here is the code:
PHP Code:
public CurrentTeams()
{
new players[32], pnum, tempid;
get_players(players, pnum, "ch");
for( new i; i<pnum; i++ )
{
if (cs_get_user_team(tempid) == CS_TEAM_SPECTATOR)
{
MoveFromSpec(tempid)
}
}
StartMatch()
}
public MoveFromSpec(id)
{
new players[32], pnum, tempid;
new tteam, ctteam
get_players(players, pnum, "ch");
for( new i; i<pnum; i++ )
{
tempid = players[i];
if (cs_get_user_team(tempid) == CS_TEAM_T)
{
tteam++
}
else if(cs_get_user_team(tempid) == CS_TEAM_CT)
{
ctteam++
}
}
if (tteam > ctteam)
{
cs_set_user_team(id, CS_TEAM_CT)
}
else if (ctteam >= tteam)
{
cs_set_user_team(id, CS_TEAM_T)
}
}