Detecting the smallest variables
#2

I'm sure there's an easier way, but the simple way I can think of is:
pawn Код:
new smallvar = 0;
for(new i = 0; i < 10; i++)
{
    if(BLABLA[playerid][i] < BLABLA[playerid][smallvar]) smallvar = i;
}
printf("%d is the smallest value.", BLABLA[playerid][smallvar]);
I think there might be an easy way with y_iterate, but I haven't really used that extensively unfortunately.
Reply


Messages In This Thread
Detecting the smallest variables - by deimantas1 - 27.02.2015, 13:18
Re: Detecting the smallest variables - by Threshold - 27.02.2015, 13:41
Re: Detecting the smallest variables - by deimantas1 - 27.02.2015, 13:47

Forum Jump:


Users browsing this thread: 1 Guest(s)