SA-MP Forums Archive
Undercover Police - 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: Undercover Police (/showthread.php?tid=417272)



Undercover Police - lramos15 - 20.02.2013

Im trying to add flashing lights and the siren noise to when I press H onto any car. Can someone tell me how? I have this but it doesn't work.
Код:
SetVehicleNumberPlate(AddStaticVehicle(541,1545.4624,-1605.9409,13.3828,358.5618,0,1), " ");//HISU PD
That spawns the vehicle all fine but when I put this under it the sirens isn't there
Код:
    CreateObject(18646,  0.449999, 0.389999, 0.384000, 0.0, 0.0, 0.0);
AttachObjectToVehicle(18646, 6, 0.449999, 0.389999, 0.384000, 0.000000, 0.000000, 0.000000);
Please help me fix it.


Re: Undercover Police - Scenario - 20.02.2013

https://sampwiki.blast.hk/wiki/AttachObjectToVehicle

You aren't attaching the object correctly, click the link above for the wiki page about the function.


Re: Undercover Police - lramos15 - 20.02.2013

I see but how would I make the light flash and make siren noises.


Re: Undercover Police - Scenario - 20.02.2013

Well, that object is an always-on object- so, when you create it, it's going to "flash." However, depending on the time of day (in the server), you may not be able to see it very well.

And siren noises, that's a little different. Basically, you're going to use this function to play an audio stream- but that's a bit more advanced and I doubt you'll be able to do it. I could, but I don't have time right now.


Re: Undercover Police - lramos15 - 20.02.2013

So there is no way I would go about turning it off.


Re: Undercover Police - Scenario - 20.02.2013

Only if you destroy the object.


Re: Undercover Police - lramos15 - 20.02.2013

What if I use the 19419 sirens can I toggle those?


Re: Undercover Police - Scenario - 20.02.2013

Yes, object 19419 is on, 19420 is off.


Re: Undercover Police - lramos15 - 20.02.2013

Ok so how would I make it so when I press h if the car has 18646 then destroy it but when h is pressed again put it back. Also how would I make it so that when I press h with a car with 19419 it turns to 19420 and then back again when h is pressed


Re: Undercover Police - PabloDiCostanzo - 21.02.2013

Maybe HERE to destroy

And HERE to create again