How to make it random
#7

You can set random numbers to a string (because a 32-bit cell has limitations in it's capacity to hold a very large number)

pawn Код:
stock SetRandomNumber(string[], size = sizeof string)
{
    for(new i; i < size; i++) string[i] = 48 + random(10);
    return string;
}

//Usage:

public OnFilterScriptInit()
{

    new MyString[16]; //<-- array size is the number of digits
    SetRandomNumber(MyString);
    printf("%s", MyString);
   
    return 1;
}
Reply


Messages In This Thread
How to make it random - by JaKe Elite - 27.10.2012, 09:59
Re: How to make it random - by park4bmx - 27.10.2012, 10:04
Re: How to make it random - by JaKe Elite - 27.10.2012, 10:06
Re: How to make it random - by park4bmx - 27.10.2012, 10:08
Re: How to make it random - by Emmet_ - 27.10.2012, 10:09
Re: How to make it random - by JaKe Elite - 27.10.2012, 10:11
Re: How to make it random - by iPLEOMAX - 27.10.2012, 10:42
Re: How to make it random - by _Khaled_ - 27.10.2012, 12:22
Re: How to make it random - by iPLEOMAX - 27.10.2012, 13:36
Re: How to make it random - by JaKe Elite - 28.10.2012, 00:24

Forum Jump:


Users browsing this thread: 4 Guest(s)