SA-MP Forums Archive
Object Color - 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: Object Color (/showthread.php?tid=605704)



Object Color - MonSterLikeHD - 23.04.2016

Can you edit the color of an object ? and if you can, someone can give me an example ?


Re: Object Color - Vince - 23.04.2016

Yes, with SetObjectMaterial. However, it should be noted that the color is "overlaid", so to speak. This means you can only make a color darker. This works best on white objects and not at all on black objects.


Re: Object Color - MonSterLikeHD - 23.04.2016

Quote:
Originally Posted by Vince
Посмотреть сообщение
Yes, with SetObjectMaterial. However, it should be noted that the color is "overlaid", so to speak. This means you can only make a color darker. This works best on white objects and not at all on black objects.
So, if i want, let's say make a green color, i need to use SetObjectMaterial ? can you give me an example pls ?


Re: Object Color - povargek - 23.04.2016

The SAMP Wiki: SetObjectMaterial

Example - Pink Demorgan:

Код:
new Float:X, Float:Y, Float:Z;
new myobject;
GetPlayerPos(playerid, X, Y, Z);
myobject = CreateObject(18759, X, Y, Z+0.5, 0.0, 0.0, 0.0, 300.0);
SetObjectMaterial(myobject, 0, -1, "none", "none", 0xFFFF7E93);