SA-MP Forums Archive
/siren not creating object specified +rep help please. - 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: /siren not creating object specified +rep help please. (/showthread.php?tid=653789)



/siren not creating object specified +rep help please. - insus100 - 13.05.2018

Hello guys, so I have a /siren cmd:
PHP код:
                    VehSirenState[vehicleid] = 1;
                    
VehSirenObject[vehicleid] = CreateDynamicObject(1864610.010.010.0000);
AttachDynamicObjectToVehicle(VehSirenObject[vehicleid], vehicleid0.225000,0.524999,0.375000,0.000000,0.000000,0.000000); Blah blah blah 
Note that this command worked good before I added an interior with mapping to the gamemode.

This command (it's not all in there) will activate, create and attach that object "18646", the lil siren. The problem is that when I use /siren, a random object gets spawned and attached to the vehicle, and it's so annoying. I thought it could be a problem with interiors or something, but I have no idea. Any help is appreciated, and I'll +rep for sure if you can help me. Thank you


Re: /siren not creating object specified +rep help please. - RoboN1X - 13.05.2018

Make sure you create the dynamic object near the vehicle and the player. so it streams correct object.

Get the coordinates from GetVehiclePos on vehicleid then use the x y z on CreateDynamicObject.

You can also check using Streamer_IsItemVisible to see if the created dynamic object is streamed for the player.


Re: /siren not creating object specified +rep help please. - insus100 - 13.05.2018

Hey man, thank you for your response, I found out what was happening, and it was that I was using AttachObjectToVehicle instead of AttachDynamicObjectToVehicle for an streamer object. Anyway thanks for your help.