xXMADEXx Posted April 23, 2013 Posted April 23, 2013 Hey guys, im making basic script, and for some reason the event "onClientRender" isn't getting the players height... ClientCode: function checkHight() local x,y,z = getElementPosition(localPlayer) if (z < 35) and (z > 50) then stopBummperCarsHeightChecker() end end function startHeightChecking() addEventHandler("onClientRender", root, checkHight) end addEvent("events:startBummperCarsHeightChecker", true) addEventHandler("events:startBummperCarsHeightChecker", root, startHeightChecking) function stopBummperCarsHeightChecker() removeEventHandler("onClientRender", root, checkHight) triggerServerEvent("events:bummperCars.PlayerOverHeightLimit", localPlayer) end ServerCode *Not All*: addCommandHandler("bump", function (p) riggerClientEvent(p, "events:startBummperCarsHeightChecker", p) end ) function killPedReasonLeftPlatform() local car = getPedOccupiedVehicle(source) setElementHealth(source, 0) destroyElement(car) end addEvent("events:bummperCars.PlayerOverHeightLimit",true) addEventHandler("events:bummperCars.PlayerOverHeightLimit", root, killPedReasonLeftPlatform) The Ultimate Lua Tutorial! | MTA PHP SDK
DNL291 Posted April 23, 2013 Posted April 23, 2013 You have "riggerClientEvent" instead of triggerClientEvent in serverside. Please do not PM me with scripting related question nor support, use the forums instead.
xXMADEXx Posted April 24, 2013 Author Posted April 24, 2013 You have "riggerClientEvent" instead of triggerClientEvent in serverside. wow, yes. But, this is an edit of my real code, and that mistake isn't there, in main code good eye. The Ultimate Lua Tutorial! | MTA PHP SDK
DNL291 Posted April 24, 2013 Posted April 24, 2013 Oh. I don't see another error in your code, just that. Maybe the condition at line 3 makes no sense. Please do not PM me with scripting related question nor support, use the forums instead.
Moderators IIYAMA Posted April 24, 2013 Moderators Posted April 24, 2013 Maybe you should check the car height instead? 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
xXMADEXx Posted April 24, 2013 Author Posted April 24, 2013 Maybe you should check the car height instead? maybe, ill try it. The Ultimate Lua Tutorial! | MTA PHP SDK
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