How can I make random with 'real' numbers?
#5

Quote:
Originally Posted by ******
Посмотреть сообщение
What's with all the extra variables?

pawn Код:
stock Float:frandom(Float:max)
{
    return max * random(32768) / 32768.0;
}
pawn Код:
stock Float:frandomex(Float:min, Float:max)
{
    return min + (max - min) * random(32768) / 32768.0;
}
Trust me, reduction like this is good in PAWN (as is the ".0") and the use of "32768" instead of "32767".
What do I need to put instead of the Float:frandomex?
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)