Jump to content

Help with events


xXMADEXx

Recommended Posts

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...