SetPlayerObjectMaterialText

warning

This function was added in SA-MP 0.3e and will not work in earlier versions!

Description

Replace the texture of a player object with text.

NameDescription
playeridThe ID of the player whose player object to set the text of.
objectidThe ID of the object on which to place the text.
textThe text to set.
materialindexThe material index to replace with text (DEFAULT: 0).
materialsizeThe size of the material (DEFAULT: 256x128).
fontfaceThe font to use (DEFAULT: Arial).
fontsizeThe size of the text (DEFAULT: 24) (MAX 255).
boldBold text. Set to 1 for bold, 0 for not (DEFAULT: 1).
fontcolorThe color of the text (DEFAULT: White).
backcolorThe background color (DEFAULT: None (transparent)).
textalignmentThe alignment of the text (DEFAULT: Left).

Returns

This function does not return any specific values.

Examples

if (strcmp("/text", cmdtext, true) == 0)
{
new myObject = CreatePlayerObject(playerid, 19353, 0, 0, 10, 0.0, 0.0, 90.0); //create the object
SetPlayerObjectMaterialText(playerid, myObject, "SA-MP {FFFFFF}0.3{008500}e {FF8200}RC7", 0, OBJECT_MATERIAL_SIZE_256x128,\
"Arial", 28, 0, 0xFFFF8200, 0xFF000000, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
// write "SA-MP 0.3e RC7" on the object, with orange font color and black background
return 1;
}

Notes

tip

Color embedding can be used for multiple colors in the text.

Related Functions

Filterscripts with texturing/text support

  • Ultimate Creator by Nexius
  • Texture Studio by [uL]Pottus
  • Fusez's Map Editor by RedFusion
  • Map Editor I by adri1