getarg, setarg and numarg
#2

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 
numargs()-1i!=0i--)
    {
        if(
getarg(i) > mm=getarg(i);
    }
    return 
m;
}
//Usage:
printf("%d",maxi(1,3,0,5,3,2,1,-1,4)); //returns 5 
Reply


Messages In This Thread
getarg, setarg and numarg - by NeXoR - 30.09.2016, 21:12
Re: getarg, setarg and numarg - by Kaliber - 30.09.2016, 21:23
Re: getarg, setarg and numarg - by NeXoR - 30.09.2016, 21:25
Re: getarg, setarg and numarg - by Kaliber - 30.09.2016, 21:27
Re: getarg, setarg and numarg - by NeXoR - 30.09.2016, 21:30
Re: getarg, setarg and numarg - by Kaliber - 30.09.2016, 21:34
Re: getarg, setarg and numarg - by NeXoR - 30.09.2016, 21:37
Re: getarg, setarg and numarg - by SickAttack - 30.09.2016, 22:13
Re: getarg, setarg and numarg - by GoldenLion - 30.09.2016, 22:14
Re: getarg, setarg and numarg - by SickAttack - 30.09.2016, 22:15

Forum Jump:


Users browsing this thread: 2 Guest(s)