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=511124)
[SOLVED]SetObjectMaterialText -
superrobot48 - 04.05.2014
here is my code
pawn Код:
object1 = CreateDynamicObject(4732, 2086.00854, 1577.93750, 23.95020, 0.00000, 0.00000, 321.63171);
SetObjectMaterialText(object1, "{33CC00}Las Venturas {0000FF}COPS {FF0099}AND {CC0000}ROBBERS", 2, OBJECT_MATERIAL_SIZE_256x128,
"Arial", 24, 0, 0xFF00FFFF, 0xFF00008B, OBJECT_MATERIAL_TEXT_ALIGN_LEFT);
it is not changing the text
and tried setting material index to 0

EVEN TRIED Setting object material first
Re: SetObjectMaterialText -
MaxBerger - 04.05.2014
Hey,
I am not really sure but I think it is not possible to use SetObjectMaterialText when you have created the Object with CreateDynamicObject. So you could try to use CreateObject instead of CreateDynamicObject (or SetDynamicObjectMaterialText when using CreateDynamicObject) and maybe it will work then.
Please show me your solution when it works
Regards,
Max
Re: SetObjectMaterialText -
Blast3r - 04.05.2014
Howdy mate, you've used CreateDynamicObject which is a function from the streamer, however you used the SetObjectMaterial which is the normal SA-MP function, therefore it won't work on dynamic objects. Anyways, in case you want to use the streamed objects with material text, this is the function:
pawn Код:
SetDynamicObjectMaterialText(objectid, materialindex, const text[], materialsize = OBJECT_MATERIAL_SIZE_256x128, const fontface[] = "Arial", fontsize = 24, bold = 1, fontcolor = 0xFFFFFFFF, backcolor = 0, textalignment = 0);
Hope that helped
Re: SetObjectMaterialText -
superrobot48 - 04.05.2014
Thank you guyz +repped