SetObjectMaterial colour bug?
#1

http://gyazo.com/1fb60a43ade0857630fe00c428f07afc
I tried to change the color of these floors to blue, blue, blue and red, but only one of them showed up blue, and the rest are transparent.... dunno what I'm doing wrong here, or if it's a bug.

pawn Код:
new floor1 = CreateObject(19379, 1452.44470, -87.64349, 472.87067,   0.20000, 90.00000, 0.00000);
new floor2 = CreateObject(19379, 1452.42932, -97.25662, 472.83734,   0.20000, 90.00000, 0.00000);
new floor3 = CreateObject(19379, 1462.93970, -87.66008, 472.87579,   0.20000, 90.00000, 0.00000);
new floor4 = CreateObject(19379, 1462.92834, -97.16496, 472.84222,   0.20000, 90.00000, 0.00000);
SetObjectMaterial(floor1, 0, -1, "none", "none", 0x00D2F2FF);
SetObjectMaterial(floor2, 0, -1, "none", "none", 0xF70202FF);
SetObjectMaterial(floor3, 0, -1, "none", "none", 0x00D2F2FF);
SetObjectMaterial(floor4, 0, -1, "none", "none", 0x00D2F2FF);
Reply
#2

SetObjectMaterial uses a 'different' kind of order for hex values.
Normal hex values are in the order:
0xRRGGBBAA, where 'AA' are the transparency (alpha) values.

For SetObjectMaterial, it's in the order:
0xAARRGGBB, so alpha values move from the end to the front. Therefore, all you really need to do is move the current alpha values to the front.

pawn Код:
new floor1 = CreateObject(19379, 1452.44470, -87.64349, 472.87067,   0.20000, 90.00000, 0.00000);
new floor2 = CreateObject(19379, 1452.42932, -97.25662, 472.83734,   0.20000, 90.00000, 0.00000);
new floor3 = CreateObject(19379, 1462.93970, -87.66008, 472.87579,   0.20000, 90.00000, 0.00000);
new floor4 = CreateObject(19379, 1462.92834, -97.16496, 472.84222,   0.20000, 90.00000, 0.00000);
SetObjectMaterial(floor1, 0, -1, "none", "none", 0xFF00D2F2);
SetObjectMaterial(floor2, 0, -1, "none", "none", 0xFFF70202);
SetObjectMaterial(floor3, 0, -1, "none", "none", 0xFF00D2F2);
SetObjectMaterial(floor4, 0, -1, "none", "none", 0xFF00D2F2);
Sources:
https://sampwiki.blast.hk/wiki/SetObjectMaterial
https://sampwiki.blast.hk/wiki/Colors (https://sampwiki.blast.hk/wiki/Colors#Al...ransparency.29)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)