Dores I just thing that 2 codes worst working.
P.S.Your code working ,but buggy,I don't know how but sometimes terrorist's spawns in ct's spawn when switching,I don't say always ,but sometimes :/
And thanks for trying help,suggest ;)
And yes your code works but buggy :/
Dores I'm asking you and other people :}
And this code may cause those bugs for switching?
PHP Code:
///Here is the in the ct team can be max 4 ct's///
public message_teaminfo(msg_id, msg_dest){
if (msg_dest != MSG_ALL && msg_dest != MSG_BROADCAST) return;
new id = get_msg_arg_int(1)
static team[2]
get_msg_arg_string(2, team, sizeof team - 1)
if(team[0] == 'U' || team[0] == 'S') return;
new cts = ckrun_get_ct_num()
if(cts >= 4){
cs_set_user_team(id, CS_TEAM_T, CS_DONTCHANGE)
set_msg_arg_string(2, "TERRORIST")
}
}stock ckrun_get_ct_num(){
new num = 0 , i
for (i = 1; i <= g_maxplayers; i++){
if (is_user_connected(i) && get_user_team(i) == 2)
num ++
}
return num
}