kuwalda Posted June 22, 2014 Share Posted June 22, 2014 Is it possible to add up two files? Like I have my checkpoints stored in tables and they take up way too many lines. Is it somehow possieble that I put all those tables in seperate file and use something like, in php function include? Or is there any other way? Link to comment
MTA Team botder Posted June 22, 2014 MTA Team Share Posted June 22, 2014 If you store your data tables in a seperate .lua file and write down the scriptfile in meta.xml then you should be fine. MTA does the "include" job for you. Link to comment
Moderators Citizen Posted June 22, 2014 Moderators Share Posted June 22, 2014 If you store your data tables in a seperate .lua file and write down the scriptfile in meta.xml then you should be fine. MTA does the "include" job for you. only if the variable is a global one and is in the same side. server1.lua local localTable = { 1, 2, 3 } globalTable = { 4, 5, 6 } server2.lua for k, i in ipairs (localTable) do --error, table undefined (nil value) outputChatBox(i) end for k, i in ipairs (globalTable) do -- works outputChatBox(i) -- prints 4, 5, 6 end client.lua for k, i in ipairs (localTable) do --error, table undefined (nil value) outputChatBox(i) end for k, i in ipairs (globalTable) do --error, table undefined (nil value) outputChatBox(i) end Link to comment
MTA Team botder Posted June 22, 2014 MTA Team Share Posted June 22, 2014 only if the variable is a global one and is in the same side. Basic Lua should be a minimum when you are going to script something. Link to comment
Moderators Citizen Posted June 22, 2014 Moderators Share Posted June 22, 2014 only if the variable is a global one and is in the same side. Basic Lua should be a minimum when you are going to script something. client and server is not lua specific, and it's really an abstract thing when you start scripting for MTA. So it's not as obvious as you think it was. Link to comment
Dealman Posted June 23, 2014 Share Posted June 23, 2014 Basic Lua should be a minimum when you are going to script something. This is possibly the most redundant statement I have seen on this forum thus far. 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