SA-MP Forums Archive
Remove lights with SetObjectMaterial - 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: Remove lights with SetObjectMaterial (/showthread.php?tid=544144)



[Solved] Remove lights with SetObjectMaterial - ououdu94 - 31.10.2014

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.


Re: Remove lights with SetObjectMaterial - MasonSFW - 31.10.2014

Use

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



Re : Remove lights with SetObjectMaterial - ououdu94 - 31.10.2014

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.


Re : Remove lights with SetObjectMaterial - ououdu94 - 31.10.2014

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