Attach3DTextLabeltoVehicle Help -
0B3Y - 06.07.2016
I want to attach a 3d text to the back bumper of the police car, i've tried but it didnt work. Here's my police car
Код:
new LSPDVehicles[ 1 ];
LSPDVehicles[0] = AddStaticVehicleEx(596, 1602.5122, -1680.3663, 5.4630, 90.1200, 0, 1, FACTION_RESPAWN);
I want to add a callsign to the back bumper of the car. like,
Код:
new Text3D:vehicle3Dtext[MAX_VEHICLES],vehicle_id;
// Creating the TextLabel for later use
public OnGameModeInit ( )
{
vehicle_id = CreateVehicle( 510, 0.0. 0.0, 15.0, 5, 0, 120 );
vehicle3Dtext[ vehicle_id ] = Create3DTextLabel( "1-ADAM-2", 0xFF0000AA, 0.0, 0.0, 0.0, 50.0, 0, 1 );
//Creating the Vehicle
//Attaching Text Label To Vehicle
Attach3DTextLabelToVehicle( vehicle3Dtext[ vehicle_id ] , vehicle_id, 0.0, 0.0, 2.0);
}
public OnGameModeExit ( )
{
Delete3DTextLabel( vehicle3Dtext[ vehicle_id ] );
return true;
}
Thanks.
Re: Attach3DTextLabeltoVehicle Help -
Mencent - 06.07.2016
Hello!
You must use your police car, like this:
PHP код:
new Text3D:vehicle3Dtext[MAX_VEHICLES],LSPDVehicles[ 1 ];;
// Creating the TextLabel for later use
public OnGameModeInit ( )
{
LSPDVehicles[0] = AddStaticVehicleEx(596, 1602.5122, -1680.3663, 5.4630, 90.1200, 0, 1, FACTION_RESPAWN);
vehicle3Dtext[ LSPDVehicles[0] ] = Create3DTextLabel( "1-ADAM-2", 0xFF0000AA, 0.0, 0.0, 0.0, 50.0, 0, 1 );
Attach3DTextLabelToVehicle( vehicle3Dtext[ LSPDVehicles[0] ] , LSPDVehicles[0], 0.0, 0.0, 2.0);
}
public OnGameModeExit ( )
{
Delete3DTextLabel( vehicle3Dtext[ LSPDVehicles[0] ] );
return true;
}
Re: Attach3DTextLabeltoVehicle Help -
0B3Y - 06.07.2016
Thanks Mencent. I've tried your code but it compiles succesfully but the text doesn't appear in game. But i've figured it out.
Код:
new LSPDVehicles[1]//The limit of LSPD Vehicles
new Text3D:vehicle3Dtext[1]//The limit of vehicle's 3D texts
public OnGameModeInit()
{
LSPDVehicles[0] = AddStaticVehicleEx(596, 1602.5122, -1680.3663, 5.4630, 90.1200, 0, 1, FACTION_RESPAWN);
}
public OnVehicleSpawn()
{
vehicle3Dtext[1] = Create3DTextLabel("1-ADAM-2", COLOR_WHITE, 0.0, 0.0, 0.0, 50.0, 0, 1 );
Attach3DTextLabelToVehicle(vehicle3Dtext[1], LSPDVehicles[1], -0.7, -1.9, -0.3);
}
And it worked