Hi I need a little help with my code... I want transfer a player to terrorist team when there're 1 ct each 4 tts.
I try make this with averages but I fail because I can't set correctly the float.
PHP Code:
public eTeamInfo()
{
if (!get_pcvar_num(pcvar[0]))
return 0
new id = read_data(1)
new countT, countCT
for (new i = 0; i < get_maxplayers(); i++)
{
if (get_user_team(i) == 1)
countT++
if (get_user_team(i) == 2)
countCT++
}
new Float:average = (countT - countCT) / 4
if (average < 1.5)
cs_set_user_team(id, CS_TEAM_T)
return 0
}
Thanks, and happy new year