kecskebeka Posted November 20, 2016 Share Posted November 20, 2016 Hy, please help. function enterInterior(dim,withFront,intTypeID) local veh = getPedOccupiedVehicle(source) if not veh then setElementPosition(source, tonumber(interiors[intTypeID][2]),tonumber(interiors[intTypeID][3]),tonumber(interiors[intTypeID][4])) setElementInterior(source, interiors[intTypeID][1]) setElementDimension(source, dim) end end addEvent("enterInterior", true) addEventHandler("enterInterior", getRootElement(), enterInterior) Link to comment
Addlibs Posted November 20, 2016 Share Posted November 20, 2016 Is the table interiors even defined? Link to comment
kecskebeka Posted November 20, 2016 Author Share Posted November 20, 2016 (edited) ? Edited November 20, 2016 by kecskebeka Link to comment
Addlibs Posted November 20, 2016 Share Posted November 20, 2016 setElementPosition(source, tonumber(interiors[intTypeID][2]),tonumber(interiors[intTypeID][3]),tonumber(interiors[intTypeID][4])) setElementInterior(source, interiors[intTypeID][1]) You're attempting to index the table interiors which is undefined, that is, a 'nil' value. You should define the table first, through something like this interiors = { [1] = {interiorWorldID, posX, posY, posZ}, -- of couse, substitute interiorWoldID, posX, posY, posZ with actual values [2] = {interiorWorldID, posX, posY, posZ}, [3] = {interiorWorldID, posX, posY, posZ}, } 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