SkatCh Posted June 8, 2014 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 : Failure is simply an opportunity to begin again more intelligently - Henry Ford
.:HyPeX:. Posted June 9, 2014 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 My ingame nick is ~HyPeX~ BF3 Gamemode Progress: ~30% - Currently working on AI & MapManager
SkatCh Posted June 9, 2014 Author Posted June 9, 2014 it didn't work please i need help . Error : Failure is simply an opportunity to begin again more intelligently - Henry Ford
MIKI785 Posted June 9, 2014 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. Lua Scripter Owner of mshost.cz MTA portal.
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