random
#1

Hello guys!


Apearently i can't do this:
pawn Код:
randomEx(6,4,16,18,10,17);
So how i can choose random number ,but only from that numbers which i selected?

Like not from 1 to 5 ,but 16 or 17 or 2 or 5 and etc...
Reply
#2

Код:
new randomNumbers[6] = {6,4,16,18,10,17};
new rand = randomEx(0, 5);

new myrandomnumber = randomNumbers[rand];
Reply
#3

How could i import your script to mine's?

pawn Код:
BusinessInfo[id][bInsideInt] = randomINT;
    randomINT = randomEx(6,4,16,18,10,17);
    if(randomINT == 6)
    {
        BusinessInfo[id][bExitX] = -26.691598;
        BusinessInfo[id][bExitY] = -55.714897;
        BusinessInfo[id][bExitZ] = 1003.546875;
    }
    if(randomINT == 4)
    {
        BusinessInfo[id][bExitX] = -27.312299;
        BusinessInfo[id][bExitY] = -29.277599;
        BusinessInfo[id][bExitZ] = 1003.557250;
    }
    if(randomINT == 16)
    {
        BusinessInfo[id][bExitX] = -25.132598;
        BusinessInfo[id][bExitY] = -139.066986;
        BusinessInfo[id][bExitZ] = 1003.546875;
    }
    if(randomINT == 18)
    {
        BusinessInfo[id][bExitX] = -30.946699;
        BusinessInfo[id][bExitY] = -89.609596;
        BusinessInfo[id][bExitZ] = 1003.546875;
    }
    if(randomINT == 10)
    {
        BusinessInfo[id][bExitX] = 6.091179;
        BusinessInfo[id][bExitY] = -29.271898;
        BusinessInfo[id][bExitZ] = 1003.549438;
    }
    if(randomINT == 18)
    {
        BusinessInfo[id][bExitX] = -25.884498;
        BusinessInfo[id][bExitY] = -185.868988;
        BusinessInfo[id][bExitZ] = 1003.546875;
    }
Reply
#4

EDIT: Late, still valid?

pawn Код:
randomFromSet(...)
     return getarg(random(numargs()));
You can use any number of arguments you want.
Reply
#5

This really tiny function should work;
pawn Код:
randomSelective(...)
    return getarg(random(numargs()));
Edit: Damn, I'm slow.
Reply
#6

Can you guys try to integrate your scripts to mine's?
I'm beginner...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)