Attach3DTextLabelToVehicle
Description:
Function Attach3DTextLabelToVehicle attaches a 3D Text Label to a specific vehicle.
Function Attach3DTextLabelToVehicle was added in 0.3a and will not work in earlier versions! |
Parameters:
(Text3D:id, vehicleid, Float:OffsetX, Float:OffsetY, Float:OffsetZ)
int | Text3D:id | The 3D Text Label you want to attach. |
int | vehicleid | The vehicle you want to attach the 3D Text Label to. |
float | Float:OffsetX | The Offset-X coordinate of the player vehicle (the vehicle is 0.0,0.0,0.0). |
float | Float:OffsetY | The Offset-Y coordinate of the player vehicle (the vehicle is 0.0,0.0,0.0). |
float | Float:OffsetZ | The Offset-Z coordinate of the player vehicle (the vehicle is 0.0,0.0,0.0). |
Return Values:
- 1: The function was executed successfully.
- 0: The function failed to execute. This means the vehicle and/or label do not exist.
Examples:
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( "Example Text", 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; }
Related Functions
The following functions may be useful, as they are related to this function in one way or another.
- Create3DTextLabel: Create a 3D text label.
- CreatePlayer3DTextLabel: Create A 3D text label for one player.
- Delete3DTextLabel: Delete a 3D text label.
- DeletePlayer3DTextLabel: Delete a player's 3D text label.
- Attach3DTextLabelToPlayer: Attach a 3D text label to a player.
- Update3DTextLabelText: Change the text of a 3D text label.
- UpdatePlayer3DTextLabelText: Change the text of a player's 3D text label.