Brad96 Posted September 5, 2013 Posted September 5, 2013 i want unbindkey fx nitro how ? pls help function FxNitro(player) local veh = getPedOccupiedVehicle(player) if veh then triggerClientEvent("fxNitro",player, veh) end end addEventHandler("onPlayerJoin",getRootElement(),function() bindKey(source,"vehicle_fire", "down", FxNitro) end)
yannickboy15 Posted September 5, 2013 Posted September 5, 2013 https://wiki.multitheftauto.com/wiki/UnbindKey: unbindKey ( player, "F1", "down", goMoo ) -- this function will no longer be triggered by the player, after removing the bind. end function playerSpawn ( ) bindKey ( source, "F1", "down", goMoo ) -- bind the player's F1 key to the 'goMoo' function defined above
Brad96 Posted September 5, 2013 Author Posted September 5, 2013 Might it apply to the script? I've tried a lot esque
ZL|LuCaS Posted September 5, 2013 Posted September 5, 2013 i want unbindkey fx nitro how ? pls help function FxNitro(player) local veh = getPedOccupiedVehicle(player) if veh then triggerClientEvent("fxNitro",player, veh) end end addEventHandler("onPlayerJoin",getRootElement(),function() bindKey(source,"vehicle_fire", "down", FxNitro) end) exemple addEventHandler("onPlayerWasted",getRootElement(),function() unbindKey(source,"vehicle_fire", "down", FxNitro) end)
Brad96 Posted September 5, 2013 Author Posted September 5, 2013 addEvent("fxNitro",true) local nitro = {} function FxNitro(veh) if getVehicleController(veh) then local x,y,z = getElementPosition(veh) local rx,ry,rz = getElementRotation(veh) rz = math.rad(rz-180) local dx,dy = math.cos(rz)*1,math.sin(rz)*1 fxAddGlass ( x, y, z, 0 , 0 , 255 , 18 , 2.0 , 2 ) --color1 nitro[veh] = setTimer(FxNitro,50,1,veh) end end addEventHandler("fxNitro",getRootElement(),FxNitro)
TAPL Posted September 5, 2013 Posted September 5, 2013 You want to stop it, you don't need unbindKey? killTimer
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