flowz Posted September 21, 2014 Share Posted September 21, 2014 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 end 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"]) end addEventHandler("onResourceStart", getResourceRootElement(), resStart) I would really appreciate if you can help me so I can move on further. Link to comment
Callum Posted September 21, 2014 Share Posted September 21, 2014 You don't really need to run the code if your sole intention is to 'figure out the code' and create equivalent code from scratch. I don't see why we should help you to fix resources acquired without permission. Link to comment
Dealman Posted September 21, 2014 Share Posted September 21, 2014 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 Link to comment
flowz Posted September 22, 2014 Author Share Posted September 22, 2014 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. Link to comment
GhostXoP Posted September 22, 2014 Share Posted September 22, 2014 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
Mr_Moose Posted September 22, 2014 Share Posted September 22, 2014 The first error are found in the place where you call 'createDutyColShape', because you didn't passed the correct arguments there. The second error appears because you can't access your database. The only way to find out is by reading the code. 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