SetObjectMaterial
#1

Hi Guys,

I need some help, I've tried the new function SetObjectMaterial();

When I first tested it I got it to work, but I the second time I didn't, can anyone tell me whats wrong with this since the Texture won't change on this object?

pawn Код:
TestObject = CreateObject(19449, 969.92, -1419.15, 14.26,   0.00, 0.00, 90.00);
SetObjectMaterial(TestObject, 0, 19449, "carshow_sfse", "concpanel_la", 0xFFFFFFFF);
Reply
#2

pawn Код:
TestObject = CreateObject(19449, 969.92, -1419.15, 14.26,   0.00, 0.00, 90.00);
SetObjectMaterial(TestObject, 0, 11317, "carshow_sfse", "concpanel_la", 0xFFFFFFFF);
Try that
Reply
#3

Quote:
Originally Posted by Infamous
Посмотреть сообщение
pawn Код:
TestObject = CreateObject(19449, 969.92, -1419.15, 14.26,   0.00, 0.00, 90.00);
SetObjectMaterial(TestObject, 0, 11317, "carshow_sfse", "concpanel_la", 0xFFFFFFFF);
Try that
Thanks mate, works perfect.

But some how I get this werd error on the texture.
Anyone knows how to fix this or what I have done wrong with it?

Reply
#4

Replace 0xFFFFFFFF with 0, from SetObjectMaterial.
Reply
#5

Quote:
Originally Posted by costel_nistor96
Посмотреть сообщение
Replace 0xFFFFFFFF with 0, from SetObjectMaterial.
Thanks man, but it didn't help still the same color...
Reply
#6

Well, just remove that 0xFFFFFFFF and don't add anything there:

pawn Код:
TestObject = CreateObject(19449, 969.92, -1419.15, 14.26,   0.00, 0.00, 90.00);
SetObjectMaterial(TestObject, 0, 11317, "carshow_sfse", "concpanel_la");
Reply
#7

Quote:
Originally Posted by Libra_PL
Посмотреть сообщение
Well, just remove that 0xFFFFFFFF and don't add anything there:

pawn Код:
TestObject = CreateObject(19449, 969.92, -1419.15, 14.26,   0.00, 0.00, 90.00);
SetObjectMaterial(TestObject, 0, 11317, "carshow_sfse", "concpanel_la");
I said the same, if you don't complete the color parameter, it will be 0, so this don't work (he already said).

Try to remake again SetObjectMaterial, looking at wiki:
https://sampwiki.blast.hk/wiki/SetObjectMaterial
Reply
#8

Quote:
Originally Posted by costel_nistor96
Посмотреть сообщение
I said the same, if you don't complete the color parameter, it will be 0, so this don't work (he already said).

Try to remake again SetObjectMaterial, looking at wiki:
https://sampwiki.blast.hk/wiki/SetObjectMaterial
Yeah well thats what I did, first I tried removing 0xFFFFFFF to 0, now I've even tried removing it like he said, so I doesn't have anything on the color, still the same.

And If I'm not incorrect 0xFFFFFF is white...
Reply
#9

You used the wrong objectid:
Код:
TestObject = CreateObject(19449, 969.92, -1419.15, 14.26,   0.00, 0.00, 90.00);
SetObjectMaterial(TestObject, 0, 19449, "carshow_sfse", "concpanel_la", 0xFFFFFFFF);
The modelid which is used in SetObejctMaterial is the ID of the object which has the texture.
You used the same objectid. Thats why it didn't work.
Reply
#10

Quote:
Originally Posted by olaf137
Посмотреть сообщение
You used the wrong objectid:
Код:
TestObject = CreateObject(19449, 969.92, -1419.15, 14.26,   0.00, 0.00, 90.00);
SetObjectMaterial(TestObject, 0, 19449, "carshow_sfse", "concpanel_la", 0xFFFFFFFF);
The modelid which is used in SetObejctMaterial is the ID of the object which has the texture.
You used the same objectid. Thats why it didn't work.
If you read the first post thats what I did, but when I did that it didn't change the texture, now it have but the color on the object is not white like the texture are it's gray...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)