[Tutorial] How to Add Number plates and 3DTextLabels to Vehicles
#1

So welcome to my tutorial

First off we are going to be working under OnGamemodeInit so lets go there

Code:

pawn Код:
public OnGameModeInit()
{
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
Reply


Messages In This Thread
How to Add Number plates and 3DTextLabels to Vehicles - by Flake. - 10.10.2011, 02:20
Re: How to Add Number plates and 3DTextLabels to Vehicles - by Fierro - 10.10.2011, 03:45
Re: How to Add Number plates and 3DTextLabels to Vehicles - by Flake. - 10.10.2011, 04:04
Re: How to Add Number plates and 3DTextLabels to Vehicles - by Lorenc_ - 10.10.2011, 05:07
Re: How to Add Number plates and 3DTextLabels to Vehicles - by Flake. - 10.10.2011, 05:44

Forum Jump:


Users browsing this thread: 2 Guest(s)