display score how?¿
i saw this code from the yap plugin where i think it display the scores of the team that is winning when a new round comes up.
it display like this.
PHP Code:
PUG_SCORE_WINNING = The %s are winning:
where the %s is the team name that is winning the pug and latter of the " : " it display the score example
PHP Code:
The CT's are winning: 12-3
i want to display something like this
PHP Code:
Current scores: CTs - 12, Terrorists - 7
the code is in the yap_core around the lines 944 - 1006
or tell me if you want to display all those lines
i try to do it my self but dont know from where comes the scores the "12-3" from my example. in the code
PHP Code:
public display_scores(id,method[]) { new curr_scores[MAX_TEAMS]; static team_name[50], finished_scores[MAX_TEAMS * 5] new top_team = 0; for(new i = 1; i < pug_teams_num; ++i) { if(pug_score[top_team] < pug_score[i]) top_team = i; curr_scores[i] = pug_score[i] } if(pug_calc_winner() == 0) formatex(team_name,49,"%L",id,"PUG_SCORE_TIED") // Some posted a Bug said "Terrist are winning" when its tie else { formatex(team_name,49,"%L",id,method,pug_teams[top_team]) }
SortIntegers(curr_scores, MAX_TEAMS,Sort_Descending); format(finished_scores,MAX_TEAMS * 5,"%d",curr_scores[0]) for(new i = 2; i < pug_teams_num; ++i) { format(finished_scores,MAX_TEAMS * 5,"%s-%d",finished_scores,curr_scores[i - 1]) } client_print(id,print_chat,"%s %s %s",pug_header, team_name, finished_scores); if(id == 0) { server_print("%s %s %s",pug_header, team_name, finished_scores); } }
|