SA-MP Forums Archive
SetObjectMaterial + Weapon Objects - 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: SetObjectMaterial + Weapon Objects (/showthread.php?tid=567113)



SetObjectMaterial + Weapon Objects - CuervO - 11.03.2015

Hello there,

As I was working on the inventory script I wondered what would happen if I colored a weapon. Turns out that the weapon becomes invisible if you recolor it using SetObjectMaterial no matter what index or color you input:


I took an object, recolored it to red using parameters
Код:
0, -1, "none", "none", FFFF0000 
1, -1, "none", "none", FFFF0000
Result: http://i.imgur.com/lqzCT0Z.jpg

Using my script I swapped the object which retains the material information
Swap: http://i.imgur.com/SXb8h4p.jpg
Object ID: 355 (AK47 model)

Object became invisible
Result: http://i.imgur.com/f2Q4NmX.jpg

Then swapped the object back to something else to test the material
Result: http://i.imgur.com/tWWs6AP.jpg


So the materials were correctly set, but the object became invisible as soon as SetObjectMaterial was applied; oddly enough, recoloring them when on your hand does work:
Result: http://i.imgur.com/N3e4007.jpg
(This is the actual color that is stored in the db for the object, which is -10092289 (FF6600FF), and yes, I have an RGBA to ARGB)


So, how do you recolor a weapon object dropped on the ground, what parameters do you need exactly?


Respuesta: SetObjectMaterial + Weapon Objects - CuervO - 15.03.2015

Does anyone have a method or a solution to this problem? Am I doing something wrong? Should this be posted on bug reports?


Re: SetObjectMaterial + Weapon Objects - Pottus - 15.03.2015

Some objects have this effect unfortunately your not doing anything wrong but there is nothing you can do about it.