xXMADEXx Posted April 23, 2013 Share 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) Link to comment
DNL291 Posted April 23, 2013 Share Posted April 23, 2013 You have "riggerClientEvent" instead of triggerClientEvent in serverside. Link to comment
xXMADEXx Posted April 24, 2013 Author Share 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. Link to comment
DNL291 Posted April 24, 2013 Share 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. Link to comment
Moderators IIYAMA Posted April 24, 2013 Moderators Share Posted April 24, 2013 Maybe you should check the car height instead? Link to comment
xXMADEXx Posted April 24, 2013 Author Share Posted April 24, 2013 Maybe you should check the car height instead? maybe, ill try it. 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