SkatCh Posted June 8, 2014 Share Posted June 8, 2014 guys please i need some help cn anyone tell me what's the problem here : In this part : function vehiclestatus ( ) if ( isPedInVehicle ( localPlayer ) == false ) then return false end local x, y, z = getElementPosition( localPlayer ) local car = getPedOccupiedVehicle ( localPlayer ) local sx, sy, sz = getElementVelocity(car) local kphSpeed = math.ceil (( ( sx^2 + sy^2 + sz^2 ) ^ ( 0.5 ) ) * 161 ) local mphSpeed = math.ceil (( ( ( sx^2 + sy^2 + sz^2 ) ^ ( 0.5 ) ) * 161 ) / 1.61 ) Error + warning : Link to comment
.:HyPeX:. Posted June 9, 2014 Share Posted June 9, 2014 Heres your problem: local car = getPedOccupiedVehicle ( localPlayer ) local sx, sy, sz = getElementVelocity(car) Go with this: local car = getPedOccupiedVehicle ( localPlayer ) if car then local sx, sy, sz = getElementVelocity(car) else local sx,sy,sz = getElementVelocity( localPlayer ) end Link to comment
SkatCh Posted June 9, 2014 Author Share Posted June 9, 2014 it didn't work please i need help . Error : Link to comment
MIKI785 Posted June 9, 2014 Share Posted June 9, 2014 The 'sx' variable is local inside the condition... either remove the local in front of it or add local sx, sy, sz above the if statement. 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