Jump to content

Variable question


Snoozy

Recommended Posts

Posted

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 :D

I don't really know why, but is there a work around?

Posted

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)

Posted

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

  • MTA Team
Posted

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...