AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   display score how?¿ (https://forums.alliedmods.net/showthread.php?t=159346)

liryck 06-15-2011 23:23

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 scoresCTs 12Terrorists 

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 
1pug_teams_num; ++i)
    {
        if(
pug_score[top_team] < pug_score[i]) top_team i;
        
curr_scores[i] = pug_score[i]
    }
    
    if(
pug_calc_winner() == 0formatex(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_scoresMAX_TEAMS,Sort_Descending);
    
    
format(finished_scores,MAX_TEAMS 5,"%d",curr_scores[0])
    for(new 
2pug_teams_num; ++i)
    {
        
format(finished_scores,MAX_TEAMS 5,"%s-%d",finished_scores,curr_scores[1])
    }
    
    
client_print(id,print_chat,"%s %s %s",pug_headerteam_namefinished_scores);
    
    if(
id == 0)
    { 
        
server_print("%s %s %s",pug_headerteam_namefinished_scores);
    }




All times are GMT -4. The time now is 23:32.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.