multitheftauto/amx

ObjectMaterial

Disinterpreter opened this issue · 0 comments

Function name
SetObjectMaterial(objectid, materialindex, modelid, txdname[], texturename[], materialcolor)

SetObjectMaterialText(objectid, text[], materialindex = 0, materialsize = OBJECT_MATERIAL_SIZE_256x128, fontface[] = "Arial", fontsize = 24, bold = 1, fontcolor = 0xFFFFFFFF, backcolor = 0, textalignment = 0)

SetPlayerObjectMaterial(playerid, objectid, materialindex, modelid, txdname[], texturename[], materialcolor)

SetPlayerObjectMaterialText(playerid, objectid, text[], materialindex = 0, materialsize = OBJECT_MATERIAL_SIZE_256x128, fontface[] = "Arial", fontsize = 24, bold = 1, fontcolor = 0xFFFFFFFF, backcolor = 0, textalignment = 0)

  • playerid The ID of the player the object is associated to.
  • objectid The ID of the object to replace the texture of with text.
  • text The text to show on the object (MAX 2048 characters).
  • materialindex The object's material index to replace with text (default: 0) (0 to 15).
  • materialsize The size of the material (default: 256x128).
  • fontface The font to use (default: Arial).
  • fontsize The size of the text (default: 24) (MAX 255).
  • bold Bold text. Set to 1 for bold, 0 for not (default: 1).
  • fontcolor The color of the text, in ARGB format (default: White).
  • backcolor The background color, in ARGB format (default: None (transparent)).
  • textalignment The alignment of the text (default: left).

Describe the function
SetObjectMaterial - Replace the texture of an object with the texture from another model in the game.

SetObjectMaterialText - Replace the texture of an object with text.

SetPlayerObjectMaterial - Replace the texture of a player-object with the texture from another model in the game.

SetPlayerObjectMaterialText - Replace the texture of a player object with text.

Equivalent in MTA
I don't know how we can do it in MTA. Maybe We can change the texture via HLSL?

Additional information
SetObjectMaterial
SetObjectMaterialText
SetPlayerObjectMaterial
SetPlayerObjectMaterialText

https://forum.gamerxserver.com/forum/samp-server-188-165-219-63-8800/questions-and-answers/tutorials/2907-object-material-tutorial-spoma <- how it works.