random vaule
#1

hey there im wondering how to make a ranom value so like the following example..


not true script dont use in comment if you are wishing to anser this

if(something == 10)
{
GivePlayerCash(playerid,i need the random numbers here);
}
I need a set of numbers allong the line of this...

random 1
4521
30984
342
46346

just something like that
Reply
#2

What do you mean? Please explain better.
Reply
#3

well im makeing a rob bank scipt so i need to produce difrent numbers so they get difrent amounts of money each time
Reply
#4

Код:
GivePlayerMoney(playerid, random(100000));
Reply
#5

if you'd like to make it run out of chance (say 1 of 10 chance) you could do this:

pawn Код:
#define CHANCE_DEF /* Your chance selection */
#define RAND_STEAL /* How much in random do you want them to steal?*/

stock RobBank(playerid)
{
new chance = Random(9); // CHANCE COUNTS FROM 0

if(chance == CHANCE_DEF)
{
GivePlayerMoney(playerid,Random(RAND_STEAL));
}
else
{
SendClientMessage(playerid,COLOR,"Un-successful in robbing bank");
}
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)