Random() question?
#8

Not that it matters now, I would have done it like that, maybe add at the end some checks for empty results
pawn Код:
new
    i,
    result[3]
;
while(i++ < 3) {
    result[random(sizeof result)]++;
}
SmallGrip[playerid] += result[0];
MedGrip[playerid] += result[1];
LargeGrip[playerid] += result[2];

printf("You got %d SmallGrip, %d MedGrip and %d LargeGrip from the package.", result[0], result[1], result[2]);
Reply


Messages In This Thread
Random() question? - by Dokins - 11.08.2013, 18:19
Re: Random() question? - by Vince - 11.08.2013, 18:31
Re: Random() question? - by Dokins - 11.08.2013, 18:34
Re: Random() question? - by [XST]O_x - 11.08.2013, 18:38
Re: Random() question? - by Dokins - 11.08.2013, 18:43
Re: Random() question? - by [XST]O_x - 11.08.2013, 18:48
Re: Random() question? - by Dokins - 11.08.2013, 18:56
AW: Random() question? - by Nero_3D - 11.08.2013, 18:58

Forum Jump:


Users browsing this thread: 1 Guest(s)