Remove lights with SetObjectMaterial
#1

Hi guys,
I'm trying to remove lights of the object : 14776 with SetObjectMaterial but I didn't manage to find the material number.


I tried each, but some time, the object become completely dark, and some other time, there is no modification on any part of the object.
(For example :
Код:
ggarage = CreateObject(14776, 619.7891, -9.3125, 1006.4297, 0, 0, 270, 0.25);
SetObjectMaterial(ggarage, 5, 9362, "sfn_byofficeint", "CJ_WOOD5", 0);
-> I changed the material number 5, the object (the entire object (14776))
Other example :
If I do the same with materials number 17,18,19,20,21,22,23,24,25,26,27,28,29,30,31
There are no modification, the object remain the same..

Thanks.
Reply
#2

Use

pawn Код:
RemoveBuildingForPlayer(playerid, light object here, position, position, position, radius);
Reply
#3

Thank you for your response.

Lights are part of a bigger object : Number 14776
And I only want to remove the light, not the whole object.
That's why I tryied to use SetObjectMaterial.
Reply
#4

I notice that it worked, SetObjectMaterial doesn't work with Rotation Z different of 0.
So instead of :
Код:
ggarage = CreateObject(14776, 619.7891, -9.3125, 1006.4297, 0, 0, 270, 0.25);
I wrote :
Код:
ggarage = CreateObject(14776, 619.7891, -9.3125, 1006.4297, 0, 0, 0, 0.25);
And the material number of the light is 23.
If someone knows if there is a solution to keep RotationZ to 270°, I'll be happy
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)