25.04.2011, 18:54
ive stopped Developing after some time, and Decided to Give it a try again. I made a successful small little script to just get me started on scripting again tho i didn't find anything similar to this except a GetPlayerWitHhighestScore or something similar. Anyway. What it does is basically Go throught all the arguments to find the Highest Number
Example of Usage:
Would Compare the highest Yet number, the first six Rounds of the loops would be nine.
This is exactly what it does
Hope this will be useful to someone.
pawn Код:
stock GetHighestNumber(...)
{
new args = numargs();
new highestyet = 0;
for (new i = 0; i<args; i++)
{
if (getarg(i,0) > highestyet) highestyet = getarg(i,0);
}
return highestyet;
}
Код:
GetHighestNumber(9,9,6,5,1,0,444,5);
This is exactly what it does
Код:
Is 0 (Start Number) > 9. Yes. Start Number = 9. Is 9 > 9. No. Start Number unchanged Is 6 > 9. No. Start number unchanged. And so on