Franky Posted September 14, 2008 Share Posted September 14, 2008 what does this error mean? attempt to call global (a nil value) ERROR: ...ver/mods/deathmatch/resources/script/asd.lua:8: attempt to call global 'getVehicleEngineState' (a nil value) Link to comment
Simbad de Zeeman Posted September 14, 2008 Share Posted September 14, 2008 umm. yea. that functions doesn't exist. but it is on the wiki, it should be in DP3 i thought. Link to comment
Franky Posted September 14, 2008 Author Share Posted September 14, 2008 but how to i get to know then if the engine is on or off? Link to comment
Gamesnert Posted September 14, 2008 Share Posted September 14, 2008 what does this error mean?attempt to call global (a nil value) ERROR: ...ver/mods/deathmatch/resources/script/asd.lua:8: attempt to call global 'getVehicleEngineState' (a nil value) You might have used it in a way of which MTA thought it was a variable? Like you need to do (arguments) behind it. =/ It should work fine, since there are enough resources containing this... Link to comment
Franky Posted September 14, 2008 Author Share Posted September 14, 2008 function engineOnOff ( thePlayer ) local playerVehicle = getPlayerOccupiedVehicle ( thePlayer ) if ( playerVehicle ) == false then outputChatBox ( "You need to be in a vehicle!",thePlayer, 225, 1, 1 ) else local playerseat = getPlayerOccupiedVehicleSeat ( thePlayer ) if ( playerseat ) == 0 then local enginestate = getVehicleEngineState ( playerVehicle ) if ( enginestate ) == true then setVehicleEngineState ( playerVehicle, false ) else setVehicleEngineState ( playerVehicle, true ) end else outputChatBox ( "You need to be the driver!", thePlayer, 255, 1, 1 ) end end end addCommandHandler ( "engine", engineOnOff ) Can someone fix what i did wrong? Link to comment
Mr.Hankey Posted September 14, 2008 Share Posted September 14, 2008 The category for getVehicleEngineState at the wiki says "Category: Changes in DP3" This function does not exist in DP2. Link to comment
Gamesnert Posted September 14, 2008 Share Posted September 14, 2008 The category for getVehicleEngineState at the wiki says "Category: Changes in DP3"This function does not exist in DP2. So in that case, you'll need setElementData to do it, right? Link to comment
Michael_Sund Posted September 16, 2008 Share Posted September 16, 2008 It says in the wiki if a function/event is only in DP3 Link to comment
churchill Posted September 16, 2008 Share Posted September 16, 2008 I think we've established that already Link to comment
Michael_Sund Posted September 16, 2008 Share Posted September 16, 2008 I think we've established that already just telling him Link to comment
Franky Posted September 16, 2008 Author Share Posted September 16, 2008 It says in the wiki if a function/event is only in DP3 it doesn't say if it comes in DP3 or not.. check it yourself http://development.mtasa.com/index.php? ... ngineState Link to comment
50p Posted September 16, 2008 Share Posted September 16, 2008 http://development.mtasa.com/index.php? ... ges_in_DP3 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