From SA-MP Wiki
Description:
将文字嵌入进物件的相关函数,[0.3E新增功能].
Parameters:(objectid, text[], materialindex = 0, materialsize = OBJECT_MATERIAL_SIZE_256x128, fontface[] = "Arial", fontsize = 24, bold = 1, fontcolor = 0xFFFFFFFF, backcolor = 0, textalignment = 0)
bold | 设置加粗选项, 1 为加粗, 0 为不加粗. |
fontcolor | 输入 ARGB格式的字体前景色. |
backcolor | 输入 ARGB格式的字体背景色. |
textalignment | 设置字体文本 对齐格式 (默认为左). |
Return Values:
This function does not return any specific values.
if (strcmp("/text", cmdtext, true) == 0)
{
new myobject = CreateObject(19353, 0, 0, 10, 0.0, 0.0, 90.0); //物件名称
SetObjectMaterialText(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);
// 物件里将会显示 "SA-MP 0.3e RC7" , 字体前景色为橙色,背景色为黑色
return 1;
}
Related Functions
The following functions may be useful, as they are related to this function in one way or another.