Dzsozi (h03) Posted March 20, 2014 Share Posted March 20, 2014 Hey guys, today I made custom sirens for police cars, but my problem is that I don't know how to attach it to all police cars, not a specified one. I made something like that (I think), but it's not working. Heres my code: function policeSirens( ) local occveh = getPedOccupiedVehicle ( localPlayer ) local id = getElementModel ( theVehicle ) if id == 596 or id == 597 then setVehicleSirens ( occveh, 7, -0.800, -2.849, 0.050, 60, 118, 224, 255, 255 ) addVehicleSirens ( occveh, 7, 3, true, false, true, false ) end end So how can I attach these sirens to all police cars with id 596 and 597? I hope someone could help me in this, I would be grateful. Thank you! Link to comment
Anubhav Posted March 20, 2014 Share Posted March 20, 2014 Any errors? If no errors then: Note: Although you may be able to add sirens to any vehice, this function may not work. This function fails on the Buffalo for example. Link to comment
Moderators IIYAMA Posted March 20, 2014 Moderators Share Posted March 20, 2014 client -- client -- function policeSirens( ) local occveh = getPedOccupiedVehicle ( localPlayer ) if occveh then local id = getElementModel ( occveh ) -- theVehicle if id == 596 or id == 597 then triggerServerEvent("vehicleSirens",occveh) end end end server -- server -- addEvent("vehicleSirens",true) addEventHandler("vehicleSirens",root, function () if isElement(source) then setVehicleSirens ( source, 7, -0.800, -2.849, 0.050, 60, 118, 224, 255, 255 ) addVehicleSirens ( source, 7, 3, true, false, true, false ) end end) @Dzsozi There are warnings. /debugscript 3 to see them. And next time put them at your post. Link to comment
Dzsozi (h03) Posted March 20, 2014 Author Share Posted March 20, 2014 Okay, sorry about debugscript But it's not working as well. I tried it. Is this worked for you? Link to comment
WhoAmI Posted March 20, 2014 Share Posted March 20, 2014 When you are calling this function? Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now