Quote:
Originally Posted by Kaliber
Just like this:
PHP Code:
//You cant name this max..cause this name is already used by samp
stock maxi(...)
{
if(!numargs()) return 0; //To provide server crash!
new m=getarg(0);
for(new i = numargs()-1; i!=0; i--)
{
if(getarg(i) > m) m=getarg(i);
}
return m;
}
//Usage:
printf("%d",maxi(1,3,0,5,3,2,1,-1,4)); //returns 5
|
Thank you very much, can you explain getarg() and numarg() in like a sentence or two ? so I can understand what it does