pejczi Posted August 31, 2013 Share Posted August 31, 2013 (edited) Problem solved. Edited September 3, 2013 by Guest Link to comment
csiguusz Posted August 31, 2013 Share Posted August 31, 2013 For example you can bind a function to the "horn" GTA control with bindKey, wich attaches/removes the element. Link to comment
pejczi Posted September 1, 2013 Author Share Posted September 1, 2013 but still dunno what should be the eventHandler for this function. Link to comment
BieHDC Posted September 1, 2013 Share 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 Link to comment
manawydan Posted September 1, 2013 Share 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) Link to comment
pejczi Posted September 1, 2013 Author Share Posted September 1, 2013 Still ain't add the object. Debugger outputs nothing. Link to comment
BieHDC Posted September 1, 2013 Share Posted September 1, 2013 try to remove the siren check(if (getVehicleSirensOn ( theVehicle ) == true) then) and look what happens 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