How to Add Number plates and 3DTextLabels to Vehicles -
Flake. - 10.10.2011
So welcome to my tutorial
First off we are going to be working under OnGamemodeInit so lets go there
Code:
Ok so now we want to add
Code:
pawn Код:
new vehicle_id, Text3D:vehicle3Dtext;
This will Create the variable
ok so now it should look like this
Code:
pawn Код:
public OnGameModeInit()
{
new vehicle_id, Text3D:vehicle3Dtext;
Ok so now lets create the text label on your car
pawn Код:
vehicle3Dtext = Create3DTextLabel( "Best car in the Game!", 0xFF0000AA, 0.0, 0.0, 0.0, 50.0, 0, 1 );
so lets break that down a little
In the brackets we have the label that will display on the car then after that we have the colour (that's red) then all those complex numbers are the positioning of the label you can play around with them or check the wiki for extra info on that
Now lets attach the label
pawn Код:
Attach3DTextLabelToVehicle( vehicle3Dtext, vehicle_id, 0.0, 0.0, 2.0);
That just pretty much attaches it to the vehicle
Now Its almost over, lets just create the car and the license plate!
pawn Код:
vehicle_id = SetVehicleNumberPlate(CreateVehicle(411, 786.0544, -513.6415, 16.3859,0.00000000, 144,422, 30), "FlakeZor");
now lets have a look at this, This will create the vehicle while having a license plate on it the '411' is the car ID and in this case it is a infernus then we just have the X Y Z cords Then comes the fun bit, creating the atcuall License plate in this case mine obviously says FlakeZor
Now lets put it all together
pawn Код:
public OnGameModeInit()
{
new vehicle_id, Text3D:vehicle3Dtext;
vehicle3Dtext = Create3DTextLabel( "Best car in the Game!", 0xFF0000AA, 0.0, 0.0, 0.0, 50.0, 0, 1 );
Attach3DTextLabelToVehicle( vehicle3Dtext, vehicle_id, 0.0, 0.0, 2.0);
vehicle_id = SetVehicleNumberPlate(CreateVehicle(411, 786.0544, -513.6415, 16.3859,0.00000000, 144,422, 30), "FlakeZor");
return 1; // and exit :)
}
Hope you all liked it and you enjoyed it, i left all the variables as default
Re: How to Add Number plates and 3DTextLabels to Vehicles -
Fierro - 10.10.2011
Oh hey PwnFlakes. Great tutorial on license plates!
Re: How to Add Number plates and 3DTextLabels to Vehicles -
Flake. - 10.10.2011
Quote:
Originally Posted by Fierro
Oh hey PwnFlakes. Great tutorial on license plates!
|
haha thanks, but im not PwnFlakes im just Flake
Re: How to Add Number plates and 3DTextLabels to Vehicles -
Lorenc_ - 10.10.2011
pawn Код:
Attach3DTextLabelToVehicle( vehicle3Dtext, vehicle_id, 0.0, 0.0, 2.0);
vehicle_id = SetVehicleNumberPlate(CreateVehicle(411, 786.0544, -513.6415, 16.3859,0.00000000, 144,422, 30), "FlakeZor");
I'm sure this wouldn't work.
Re: How to Add Number plates and 3DTextLabels to Vehicles -
Flake. - 10.10.2011
haha yep, ill fix it up here
this is for adding the label to the vehicle
pawn Код:
vehicle_id = CreateVehicle( 510, 0.0. 0.0, 15.0, 5, 0, 120 );
my bad lawl