SA-MP Forums Archive
Returning largest number - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Returning largest number (/showthread.php?tid=223919)



Returning largest number - Danny - 10.02.2011

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


Re: Returning largest number - Ash. - 10.02.2011

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


Re: Returning largest number - Kwarde - 10.02.2011

Danny,

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

- Kevin