Jump to content

2 Errors, HELP Urgent, Thanks.


Recommended Posts

Well I am working on some old scripts that I found and just trying to figure out the code,

I won't share I am just learning how the creator created the code and trying to solve everything and get it fully functioning so I can start working on something similar from scratch, the server is private and is localhost and can only be viewed by me.

[ Ports Status : Closed ]

My first error is this,

-- The Error -- 
[2014-09-21 22:20:10] WARNING: resource/resource.lua:4: Bad argument @ 'setElementDimension' [Expected number at argument 2, got nil] 
-- The code --  
function createDutyColShape(posX, posY, posZ, size, interior, dimension)  
    tempShape = createColSphere(posX, posY, posZ, size) 
    setElementDimension(tempShape, dimension) 
    setElementInterior(tempShape, interior) 
    return tempShape 

My second error is this,

-- The Error -- 
resource\s_resource.lua:918: attempt to index local 'result' (a nil value) 
-- The Code -- 
function resStart() 
    local result = mysql:query_fetch_assoc("SELECT value FROM settings WHERE name='globalsupplies' LIMIT 1") 
    globalSupplies = tonumber(result["value"]) 
addEventHandler("onResourceStart", getResourceRootElement(), resStart) 

I would really appreciate if you can help me so I can move on further.

Link to comment
Well, Callum you're trying to say that there are over 30 servers in MTA that aren't using the same modified resource and I even said I won't share it I am just learning the code.

You have absolutely no reason to use other code to learn it in my opinion. Learn Lua, then set a goal. Figure out what procedures and design it takes to achieve that goal, then if you need to, see how others did it. Reverse engineer your idea in your mind. If you have to move an arm, find procedures on bone animation. If you have to resize a car, figure out which procedures you would need to scale an element. Etc. Go through the wiki, and look at the tools you are offered.

You're wasting your time figuring out how a couple straight forward lines of code work.

Link to comment

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...