waleedrt Posted May 11, 2016 Posted May 11, 2016 can anyone tell me why is this does not work?? function fanFunction() bindKey ( "lshift","down", function () local sx,sy,sz = getElementVelocity ( vehicle ) setElementVelocity( vehicle ,sx, sy, sz+0.5 ) end ) end addEventHandler("bindme",fanFunction)
MACIEKW89 Posted May 11, 2016 Posted May 11, 2016 Hi, Try with that : function fanFunction() bindKey ( "lshift","down", function () local vehicle = getPedOccupiedVehicle(localPlayer) local sx,sy,sz = getElementVelocity ( vehicle ) setElementVelocity( vehicle ,sx, sy, sz+0.5 ) end) end addEventHandler("bindme",fanFunction)
BEN. Posted May 12, 2016 Posted May 12, 2016 bindKey("lshift","down", function() if isPedInVehicle (localPlayer) then local vehicle = getPedOccupiedVehicle (localPlayer) local sx,sy,sz = getElementVelocity ( vehicle ) setElementVelocity( vehicle ,sx, sy, sz+0.5 ) end end)
Urban_West Posted May 13, 2016 Posted May 13, 2016 What are you trying to do? 0.5 in z won't change much (that's up and down btw), plus that getElementVelocity won't always get the exact speed of the element
waleedrt Posted May 13, 2016 Author Posted May 13, 2016 @BEN i want it to be a command @MACIEKW89 not working @Urban_West ye i know , i have try it and it "change much"
waleedrt Posted May 13, 2016 Author Posted May 13, 2016 function fanFunction() bindKey ( "lshift","down", function () local sx,sy,sz = getElementVelocity ( vehicle ) setElementVelocity( vehicle ,sx, sy, sz+0.5 ) end ) end addCommandHandler("bindme",fanFunction) still not working
Feher Posted May 13, 2016 Posted May 13, 2016 Type /bindme first after you can use left shift button function fanFunction ( player) bindKey ( player, "lshift", "down", function (player) local vehicle = getPedOccupiedVehicle(player) local sx,sy,sz = getElementVelocity ( vehicle ) setElementVelocity( vehicle ,sx, sy, sz+0.5 ) end ) end addCommandHandler ( "bindme", fanFunction )
Gravestone Posted May 14, 2016 Posted May 14, 2016 Try using event handler instead of command. function fanFunction ( player) local vehicle = getPedOccupiedVehicle(player) local sx,sy,sz = getElementVelocity ( vehicle ) setElementVelocity( vehicle ,sx, sy, sz+0.5 ) end addEventHandler("onClientResourceStart", getRootElement(), fanFunction) bindKey ( player, "lshift", "down", fanFunction)
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