30.09.2016, 21:23
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