Undercover Police
#1

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.
Reply
#2

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

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

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

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.
Reply
#5

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

Only if you destroy the object.
Reply
#7

What if I use the 19419 sirens can I toggle those?
Reply
#8

Yes, object 19419 is on, 19420 is off.
Reply
#9

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
Reply
#10

Maybe HERE to destroy

And HERE to create again
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)