How to get most Score earned.
#1

Hi mates

Can anyone help me to get highest score earned in the last of round end.
Thank You guys, help me.

rep++.
Reply
#2

PHP Code:
new topscoretopplayer;
for(new 
idid MAX_PLAYERSid++) if(GetPlayerScore(id) > topscoretopscore GetPlayerScore(id), topplayer id
topplayer is the ID of a player with the most score.
Reply
#3

I wanted it with a variable like Score[MAX_PLAYERS] which set to 0 OnPlayerConnect then it can be set to most scored earned by playerid in one round, then at round ends it showed with a message and resetted.
Reply
#4

Quote:
Originally Posted by TadePoleMG
View Post
I wanted it with a variable like Score[MAX_PLAYERS] which set to 0 OnPlayerConnect then it can be set to most scored earned by playerid in one round, then at round ends it showed with a message and resetted.
So do it
Reply
#5

I can't can you pls
Reply
#6

Quote:
Originally Posted by TadePoleMG
View Post
I can't can you pls
Unfortunately, no. That' "Scripting help" section, not "I'll script 4 u" section.
The answer has been given previsouly (I guess, I didn't checked it). Try to understand it and, if needed, post your questions here.
Reply
#7

PHP Code:
new MyScore[MAX_PLAYERS];
public 
OnPlayerDeath(playeridkilleridreason) {
    
MyScore[killerid]++;
    return 
1;
}
CMD:gameover(playeridparams[])
{
    new 
currentwinnerscorefinalwinner[24], string[128];
    foreach(
Playeri)
    {
        if(
MyScore(i) > score)
        {
            
score MyScore(i);
            
currentwinner i;
        }
    }
    
GetPlayerName(currentwinnerfinalwinnersizeof(finalwinner));
    
format(stringsizeof(string), "%s (ID %d) has won this game with a total score of %d."finalwinnercurrentwinnerscore);
    return 
1;

This a very blank way of doing it, you'll have to integrate it with your code by yourself.
(Not tested)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)