Generate random
#4

Quote:
Originally Posted by SymonClash
Посмотреть сообщение
Thank you both.

Crayder, what if i have to use your GenerateRandomString in a command? How?

Something like this maybe?

pawn Код:
CMD:generate(playerid)
{
    new rand = GenerateRandomString();
    SCMEX(playerid, -1, "Generated code: %d", rand);
    return 1;
}
pawn Код:
CMD:generate(playerid)
{
    SCMEX(playerid, -1, "Generated code: %s", GenerateRandomString());
    return 1;
}
The function returns a string, so format a string not an integer, plus all the stuff is made *inside* the function, no need to random anything just use the function plainly.
Reply


Messages In This Thread
Generate random - by SymonClash - 28.03.2019, 20:44
Re: Generate random - by TokicMajstor - 28.03.2019, 23:11
Re: Generate random - by Crayder - 29.03.2019, 03:07
Re: Generate random - by TheToretto - 29.03.2019, 08:22
Re: Generate random - by SymonClash - 29.03.2019, 08:24
Re: Generate random - by bgedition - 29.03.2019, 16:45
Re: Generate random - by Crayder - 30.03.2019, 06:50
Re: Generate random - by Nero_3D - 30.03.2019, 12:00
Re: Generate random - by Crayder - 30.03.2019, 16:31

Forum Jump:


Users browsing this thread: 1 Guest(s)