array average on players
I would like to add skill to every player in winer team,
The amount of skill added should be the average of opposite team skill.
Is it something like this? :
PHP Code:
new CTPlayers[32], totalSkill; new CTplayerCount, i, CTplayer get_players(CTPlayers, CTplayerCount, "h") for (i=0; i<CTplayerCount; i++) { if(cs_get_user_team(i) != CS_TEAM_CT) continue; CTplayer = CTPlayers[i]; totalSkill+= iSkill[CTplayer]; } new TPlayers[32] new TplayerCount, x, Tplayer get_players(TPlayers, TplayerCount, "h") new Float:avgskill = totalSkill / TplayerCount + 0.0; for (x=0; x<TplayerCount; x++) { if(cs_get_user_team(i) != CS_TEAM_T) continue; Tplayer = TPlayers[x] iSkill[Tplayer]+= avgskill + 0.0; }
Sorry I can't test it out because I haven't any server.
|