FuriouZ Posted May 10, 2013 Posted May 10, 2013 Hey all ! I have problem 'failed to call' Here is one code: if exports['EGvehicles']:isElementFrozen(vehicle) then dxDrawImage(ax,ay,32,37,"images/hud/park.png") ax = ax - 34 end And where i need to call function(player, cmd) local vehicle = getPedOccupiedVehicle(player) if vehicle and getVehicleController(vehicle) == player then if isElementFrozen(vehicle) then setElementData(vehicle, "vehicle.handbrake", 0) setElementFrozen(vehicle, false) else setElementData(vehicle, "vehicle.handbrake", 1) setElementFrozen(vehicle, true) end end end ) And debug: What is problem ? Homepage @ http://rageresources.blogspot.com/ Offical Facebook @ https://www.facebook.com/pages/Rage-Scr ... fref=photo
Moderators IIYAMA Posted May 10, 2013 Moderators Posted May 10, 2013 (edited) if exports['EGvehicles']:isElementFrozen(vehicle) then It means that the script that receives this export does not accept these. The function isn't defined. Edited May 10, 2013 by Guest Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
FuriouZ Posted May 10, 2013 Author Posted May 10, 2013 No,it's running Homepage @ http://rageresources.blogspot.com/ Offical Facebook @ https://www.facebook.com/pages/Rage-Scr ... fref=photo
Moderators IIYAMA Posted May 10, 2013 Moderators Posted May 10, 2013 The function isn't defined. if exports['EGvehicles']: checkFrozen(player) then meta.xml <export function="checkFrozen" type="server"/> function checkFrozen(player) local vehicle = getPedOccupiedVehicle(player) if vehicle and getVehicleController(vehicle) == player then if isElementFrozen(vehicle) then setElementData(vehicle, "vehicle.handbrake", 0) setElementFrozen(vehicle, false) else setElementData(vehicle, "vehicle.handbrake", 1) setElementFrozen(vehicle, true) end end end Also calling onClientRender isn't a very good idea. Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
FuriouZ Posted May 10, 2013 Author Posted May 10, 2013 This is vehicle handbrake. Homepage @ http://rageresources.blogspot.com/ Offical Facebook @ https://www.facebook.com/pages/Rage-Scr ... fref=photo
Moderators IIYAMA Posted May 10, 2013 Moderators Posted May 10, 2013 If you can't be a little bit clearer I can't help you. Here a both you got a perfect caller. It your codes don't contain the correct information I will be very hard to help you. (script names etc.) Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
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