[HELP] Random Numbers
#2

You could try randomstring by RyDeR`. I made a quick example:

pawn Код:
stock randomString(strDest[], strLen = 30)
{
    while(strLen--)
        strDest[strLen] = random(2) ? (random(26) + (random(2) ? 'a' : 'A')) : (random(10) + '0');
}
pawn Код:
CMD:printshit(playerid, params[])
{
    new plate[10], firstpart[3], secondpart[3];
    randomString(firstpart, 3);
    randomString(secondpart, 3);
    format(plate, sizeof(plate), "%s - %s", firstpart, secondpart);
    SendClientMessage(playerid, -1, plate);
    return 1;
}
Tested it in game:


just spammed /printshit and got some nice strings outputted :P
Reply


Messages In This Thread
[HELP] Random Numbers - by BornHuman - 01.12.2014, 04:46
Re: [HELP] Random Numbers - by Capua - 01.12.2014, 05:14
Re: [HELP] Random Numbers - by Threshold - 01.12.2014, 06:35

Forum Jump:


Users browsing this thread: 1 Guest(s)