How to get most Score earned.
#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


Messages In This Thread
How to get most Score earned. - by TadePoleMG - 08.05.2018, 10:12
Re: How to get most Score earned. - by Amads - 08.05.2018, 11:39
Re: How to get most Score earned. - by TadePoleMG - 08.05.2018, 13:21
Re: How to get most Score earned. - by Dayrion - 08.05.2018, 13:24
Re: How to get most Score earned. - by TadePoleMG - 08.05.2018, 13:25
Re: How to get most Score earned. - by Dayrion - 08.05.2018, 13:34
Re: How to get most Score earned. - by ItsRobinson - 08.05.2018, 16:38

Forum Jump:


Users browsing this thread: 2 Guest(s)