Random();
#1

Hello.

I'm making 3D label, but..
I want make it, system generates randomly plane number:
Like: LH-392, SF-382, OD-382....

new rand = random(??);
format(string,sizeof(string),"[PLANE: %s-%d]",rand?);

So how do it? Thanks. :3
Reply
#2

well IRL planes are Dest ID - unique number. so it'd be LV SF or LS.
random(x); goes from 0 - x so if you wanted from 100 - 999 you would do min + random(max - min)

example
pawn Код:
switch(random(3))
{
    case 0: format(string,sizeof(string),"LV - ",100 + random(899));
    case 1: format(string,sizeof(string),"SF - ",100 + random(899));
    case 2: format(string,sizeof(string),"LS - ",100 + random(899));
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)