Returning largest number
#1

Hello,

I am making a DM/Paintball script. When the rounds end, the script has to choose the winner by itself. The winner is the one with the highest score (duh). But now, how do i make a function that will return the largest inserted number? So ...

Код:
public OnRoundEnd(areaid)
{
	if(ReturnAreaPlayers(areaid) < 2) return SendClientMessageToArea(areaid, COLOR_RED, "The match has been ended. There not enough players to select a winner.");
    for(new i = 0; i < MAX_PLAYERS; i++)
	{
		if(inPBarea[i] == 1 && PBareaid[i] == areaid)
		{
                                 //here that function that will return the biggest PBscore[i]
                                 //if succes here my winner-code
Thanks
Greetz,
Danny
Reply
#2

What variable stores the "hits" ?

//This forum requires that you wait 60 seconds between posts. Please try again in 27 seconds.
Got myself some nice, english tea
Reply
#3

Danny,

See my "tools": https://sampforum.blast.hk/showthread.php?tid=209395
"GetPlayerWithHighestScore"

- Kevin
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)