SA-MP Forums Archive
Possible to make a random tail number then...? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Possible to make a random tail number then...? (/showthread.php?tid=202762)



Possible to make a random tail number then...? - propilot - 25.12.2010

Hey, is it possible to make a random tail number selection in the server then it saved like that forever? till I decide to delete or change it?
If so, how would I do that?


Re: Possible to make a random tail number then...? - Krx17 - 25.12.2010

What is a "tail" number?


Re: Possible to make a random tail number then...? - propilot - 25.12.2010

Planes have tail numbers for example RXV-678 requesting to taxi on B1.
This is the atc to RXV-678 you may taxi on B1.


Re: Possible to make a random tail number then...? - trapped1 - 25.12.2010

ou need to get xyz cords and make them like holding objects or I'm wrong.... (Not professional)


Re: Possible to make a random tail number then...? - Krx17 - 25.12.2010

If you want to attach a label to a plane, then use Create3DTextLabel and Attach3DTextLabelToVehicle.


Re: Possible to make a random tail number then...? - propilot - 25.12.2010

Quote:
Originally Posted by Krx17
Посмотреть сообщение
If you want to attach a label to a plane, then use Create3DTextLabel and Attach3DTextLabelToVehicle.
random tail number selection in the server.

so something like
pawn Код:
randomtailnumber
{
{bg23}
or what ever the function was
}
return 0;



Re: Possible to make a random tail number then...? - Krx17 - 25.12.2010

Erm. No.

pawn Код:
//Something like this.
public OnGameModeInit()
{
    new mycar = CreateVehicle(...);
    new tailnumber = Create3DTextLabel(...);
    Attach3DTextLabelToVehicle(tailnumber, mycar, 0, -5, 5);
}



Re: Possible to make a random tail number then...? - propilot - 25.12.2010

so if i have 100 planes, ill need too add 100 of those?
I think it possible to make something random between
3 letters
A-Z A-Z A-Z - 1-9 1-9 1-9
so it gonna be some thing

UZI-915
and if server restarts the plane number will still be UZI-915
or even easier without 3d model.
add. what it called. Just text?

Welcome pilot, your tail number is %.
and if the pilot forgot he can do
/tailnumber


Re: Possible to make a random tail number then...? - Krx17 - 25.12.2010

You can just run a loop.
pawn Код:
for(new i = 0; i < 100; i++)
{
    new mycar = CreateVehicle(...);
    new string[30];
    format(string, 30, "PFG%d", random(30));
    new tailnumber = Create3DTextLabel(string, ...);
    Attach3DTextLabelToVehicle(tailnumber, mycar, 0, -5, 5);
}



Re: Possible to make a random tail number then...? - propilot - 25.12.2010

Quote:
Originally Posted by Krx17
Посмотреть сообщение
You can just run a loop.
pawn Код:
for(new i = 0; i < 100; i++)
{
    new mycar = CreateVehicle(...);
    new string[30];
    format(string, 30, "PFG%d", random(30));
    new tailnumber = Create3DTextLabel(string, ...);
    Attach3DTextLabelToVehicle(tailnumber, mycar, 0, -5, 5);
}
Alright but I don't have only planes I have vehicles too lol
so ill need to use my if(IsVehicleAirBorne( GetVehicleModel( GetPlayerVehicleID( playerid ) ) ) )
function