[DKR]silverfang Posted December 31, 2008 Share Posted December 31, 2008 Right here's the bit of code function destroyVehicle () interior = getElementInterior ( source ) --outputConsole("interior: "..interior) if interior == 15 then destroyElement(source) end end addEventHandler("onVehicleExplode", getRootElement(), destroyVehicle) Before I commented out the outputConsole bit I kept getting errors "Attempt to concentrate interior (A boolean Value)" What I don't understand is why the line interior = getElementInterior ( source ) is returning a false value as the vehicle is the source of the event "onVehicleExplode" Cheers for your help and time Link to comment
50p Posted December 31, 2008 Share Posted December 31, 2008 Everything looks fine. What version of MTA are you using? Link to comment
[DKR]silverfang Posted January 1, 2009 Author Share Posted January 1, 2009 Running DP2 as it's a public server... I think the problem is with the source, as I get similar errors on a onVehicleDamage function. Link to comment
50p Posted January 1, 2009 Share Posted January 1, 2009 Then start debugging. outputChatBox/outputDebugString what source is (use tostring( source ) or type( source ) ), if it's "userdata" it means it's an element, then try getElementType( source ). 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