[Help] Random
#5

pawn Код:
new rand;
rand = random(100); //0 - 100
if(rand <= 49) //50% chance there will be under 49
{
  //do something
}
else if(rand >= 50) //50 and up - 50% chance there will be higher
{
  //do something else
}
That will basically random a number from 0 to 100.

Leopard
Reply


Messages In This Thread
[Help] Random - by borisblat - 14.05.2009, 11:17
Re: [Help] Random - by OmeRinG - 14.05.2009, 11:21
Re: [Help] Random - by MX_Master - 14.05.2009, 11:54
Re: [Help] Random - by borisblat - 14.05.2009, 14:52
Re: [Help] Random - by pspleo - 14.05.2009, 15:04

Forum Jump:


Users browsing this thread: 1 Guest(s)