karlis Posted May 26, 2011 Share Posted May 26, 2011 for example don't do var=tbl1[tbl2].tbl3 but local ltbl=tbl1[tbl2] var=ltbl.tbl3 but that would help only, if error is in improper calling of arrays Link to comment
Snoozy Posted May 26, 2011 Author Share Posted May 26, 2011 well that didn't work but the problem is that the one table wont accept the other table inside to access some of the other information inside the first table I don't really know why, but is there a work around? Link to comment
karlis Posted May 27, 2011 Share Posted May 27, 2011 first access the 1st table in one line, then propably try to tonumber/tostring, depends what the key is, and on 2nd line acess 2nd table. Link to comment
Snoozy Posted May 27, 2011 Author Share Posted May 27, 2011 Yea I realized that it was tonumber that was required tho now I've come across a similar problem on like a few lines later. The whole thing I'm currently having trouble with in case you don't know yet is a enter and exit system, the enter system works now and you can enter. However now theres a problem in exiting. local int = BizInfo[getElementData(source,"BizEntered")].interior if getDistanceBetweenPoints3D(x,y,z,IntInfo[int].X,IntInfo[int].Y,IntInfo[int].Z) <= 3 then I've tried there with tonumber, tostring and toboolean but it wont work I just always get the: [2011-05-27 08:53:29] ERROR: boulevard\business\server.lua:67: attempt to index field '?' (a nil value) Link to comment
karlis Posted May 27, 2011 Share Posted May 27, 2011 you could check public "interiors" resource for a bit of alternative ways of doing so. and, maybe attach the x,y,z to marker as element data, so you don't need to use the table? Link to comment
Snoozy Posted May 27, 2011 Author Share Posted May 27, 2011 Okay now after some testing again and changing I came to a new error which is: [2011-05-27 10:45:58] WARNING: boulevard\business\server.lua:72: Bad argument @ 'getDistanceBetweenPoints3D' [2011-05-27 10:45:58] ERROR: boulevard\business\server.lua:72: attempt to compare boolean with number local b = tonumber(getElementData(source,"BizEntered")) local int = tonumber(BizInfo[b].Interior) local x,y,z = getElementPosition(source) local pX = getElementData(IntInfo[int].Pickup,"PosX") local pY = getElementData(IntInfo[int].Pickup,"PosY") local pZ = getElementData(IntInfo[int].Pickup,"PosZ") if getDistanceBetweenPoints3D(x,y,z,pX,pY,pZ) <= 3 then That is the code used for line 72 which is the last shown the getDistanceBetween Link to comment
karlis Posted May 27, 2011 Share Posted May 27, 2011 pX, pY, and/or pZ is false note that if its not nil it means syncing variables works, just one function in the other side returned false, not number(this mostly appears when trying to get some number out of function with invalid object pointer, or trying to get some ped's vehicle info while ped is on foot.) Link to comment
Snoozy Posted May 27, 2011 Author Share Posted May 27, 2011 Yea okay I figured it out now thanks for the help bro. Link to comment
qaisjp Posted May 27, 2011 Share Posted May 27, 2011 Oh and remember if you have example = {} and you try example.chatbox.help = "Help!!" it won't work since you need example = { chatbox = {} } or example = {} example.chatbox = {} :3 Link to comment
Snoozy Posted May 28, 2011 Author Share Posted May 28, 2011 Yea I know that but that wasn't the problem. 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