pejczi Posted August 31, 2013 Posted August 31, 2013 (edited) Problem solved. Edited September 3, 2013 by Guest
csiguusz Posted August 31, 2013 Posted August 31, 2013 For example you can bind a function to the "horn" GTA control with bindKey, wich attaches/removes the element.
pejczi Posted September 1, 2013 Author Posted September 1, 2013 but still dunno what should be the eventHandler for this function.
BieHDC Posted September 1, 2013 Posted September 1, 2013 you bind the function the the key with bindKey and if then the sirens are on(if veh has no it dont create) it creates the object
manawydan Posted September 1, 2013 Posted September 1, 2013 try local sirenObject = {} function objectSiren ( thePlayer ) local theVehicle = getVehicleController(thePlayer) if theVehicle then if (getVehicleSirensOn ( theVehicle ) == true) then sirenObject[thePlayer] = createObject ( 10000,0,0,4 ) attachElements ( sirenObject[thePlayer] , theVehicle, -0.4,-0.1,0.8 ) else destroyElement(sirenObject[thePlayer]) end end end function StartBindKey() bindKey(source,"h","down",objectSiren) end addEventHandler("onPlayerJoin",root,StartBindKey)
pejczi Posted September 1, 2013 Author Posted September 1, 2013 Still ain't add the object. Debugger outputs nothing.
BieHDC Posted September 1, 2013 Posted September 1, 2013 try to remove the siren check(if (getVehicleSirensOn ( theVehicle ) == true) then) and look what happens
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