[FilterScript] TheLazySloth Functions
#14

Quote:
pawn Code:
stock Randomize(Minimum, Maximum) {
    new Result = random((Maximum + 1));
    while(Result < Minimum) {
        Result = random((Maximum + 1));
    }
    return Result;
}
Euhm, i don't think this will give good results.
When you do Randomize(5, 100), it will give a value between 5 and 95.

I'll suggest this
pawn Code:
#define RANDOM(%0,%1) (%0 + random(%1 - %0))
or as a stock function
pawn Code:
stock Random(min, max)
{
    return min + random(max - min);
}
Reply


Messages In This Thread
TheLazySloth Functions - by TheLazySloth - 16.03.2012, 19:21
Re: TheLazySloth Functions - by thefatshizms - 16.03.2012, 20:53
Re : TheLazySloth Functions - by dydjyz - 16.03.2012, 21:09
Re: TheLazySloth Functions - by SimonItaly - 16.03.2012, 23:17
Re: TheLazySloth Functions - by MP2 - 17.03.2012, 00:11
Re: TheLazySloth Functions - by TheLazySloth - 17.03.2012, 06:04
Re: TheLazySloth Functions - by Jonny5 - 17.03.2012, 14:48
Re: TheLazySloth Functions - by TheLazySloth - 18.03.2012, 02:00
Re: TheLazySloth Functions - by Jonny5 - 18.03.2012, 02:24
Re: TheLazySloth Functions - by TheLazySloth - 18.03.2012, 16:40
Re: TheLazySloth Functions - by Soldier9221 - 19.03.2012, 20:10
Re: TheLazySloth Functions - by TheLazySloth - 21.03.2012, 05:59
Re: TheLazySloth Functions - by Spooky - 19.04.2012, 05:57
Re: TheLazySloth Functions - by Wazner - 19.04.2012, 18:05
Re: TheLazySloth Functions - by Universal Member - 20.04.2012, 09:07

Forum Jump:


Users browsing this thread: 1 Guest(s)