SA-MP Forums Archive
SetObjectMaterialText - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: SetObjectMaterialText (/showthread.php?tid=358289)



SetObjectMaterialText - SnG.Scot_MisCuDI - 10.07.2012

For some reason its not setting the material text.. I used a in-game material text editor and it looked fine than i exported it and now its just showing the normal object.

pawn Code:
CMD:sabp(playerid, params[])
{
    new sabp = CreateDynamicObject(4230, 1597.9063, -1699.7500, 30.2109, 0.0000, 0.0000, 0.0000);
    SetObjectMaterialText(sabp, "SA-BP", 2, 50, "Arial", 24, 1, -32256, -16777216, 1);
    SendClientMessage(playerid, COLOR_ADMIN, "MADE A WALL LOL");
    return 1;
}
Its in a cmd for testing


Re: SetObjectMaterialText - coole210 - 10.07.2012

Have you tried testing it out using this FS?

https://sampforum.blast.hk/showthread.php?tid=336820


Re: SetObjectMaterialText - newbienoob - 10.07.2012

SetDynamicObjectMaterialText


Re: SetObjectMaterialText - SnG.Scot_MisCuDI - 10.07.2012

Quote:
Originally Posted by coole210
View Post
Have you tried testing it out using this FS?

https://sampforum.blast.hk/showthread.php?tid=336820
Yes i used that.

Quote:
Originally Posted by newbienoob
View Post
SetDynamicObjectMaterialText
pawn Code:
SetDynamicObjectMaterialText(sabp, 2, "SA-BP" , 50, "Arial", 24, 1, 0xFFFFFFFF, 0, 0);
testing now


Re: SetObjectMaterialText - newbienoob - 10.07.2012

pawn Code:
native SetDynamicObjectMaterialText(objectid, materialindex, const text[], materialsize = OBJECT_MATERIAL_SIZE_256x128, const fontface[] = "Arial", fontsize = 24, bold = 1, fontcolor = 0xFFFFFFFF, backcolor = 0, textalignment = 0);



Re: SetObjectMaterialText - SnG.Scot_MisCuDI - 10.07.2012

Quote:
Originally Posted by newbienoob
View Post
pawn Code:
native SetDynamicObjectMaterialText(objectid, materialindex, const text[], materialsize = OBJECT_MATERIAL_SIZE_256x128, const fontface[] = "Arial", fontsize = 24, bold = 1, fontcolor = 0xFFFFFFFF, backcolor = 0, textalignment = 0);
okay i fixed the code, but its still showing the normal object

I used removebuilding to remove that "guy" and nothing is there, than i use /sabp and it appears the normal object.




Re: SetObjectMaterialText - MP2 - 10.07.2012

Are you sure it's material index 2?


Re: SetObjectMaterialText - SnG.Scot_MisCuDI - 11.07.2012

Quote:
Originally Posted by MP2
View Post
Are you sure it's material index 2?
In the FS i used to create the object, when i set it to 2 it showed perfect. I will try other numbers.. But what is material index?


Re: SetObjectMaterialText - SnG.Scot_MisCuDI - 11.07.2012

Quote:
Originally Posted by [HLF]Southclaw
View Post
Some objects have multiple material indexes to show different textures on different parts.
In my editor I made a highlighter that shows up different indexes and you can flick through them to find the right one.

I'm pretty sure that sign object only has one material index (I used a sign very similar to put up a custom billboard in SF)


its showing red background and purple letters but this is the code

pawn Code:
SetDynamicObjectMaterialText(sabp, 1, "SA-BP" , 50, "Arial", 24, 1, 0xFFA500FF, 0x000000FF, 1);
                                                                        //orange       black



Re: SetObjectMaterialText - MP2 - 11.07.2012

it's AARRGGBB.