12p Posted December 12, 2010 Share Posted December 12, 2010 Sorry about this, guys. How can I save all the objects I have created in a LUA file? I mean, I want to create 1 line for each object in the map, so next time the resource start, every object will be respawned. This is the (not ready) code I have: addEventHandler ("onClientPlayerQuit",getRootElement(), function () for i,theBlock in ipairs (blocks) do --"blocks" is a table that returns all the objects I need. --What to do here? end end) Can anybody, at least, give me a clue? Link to comment
Aibo Posted December 12, 2010 Share Posted December 12, 2010 Lua file? why not XML map? Link to comment
12p Posted December 12, 2010 Author Share Posted December 12, 2010 I dont want to use XML Link to comment
dzek (varez) Posted December 12, 2010 Share Posted December 12, 2010 why? it's more efficient, and these functions will make things easy Link to comment
Aibo Posted December 12, 2010 Share Posted December 12, 2010 well if you want to store something client-side, your only option is XML really, file functions are server-side only as i recall. though you can export/create server-side Lua file which will create the objects, but then you'll need to figure a way for it to run. like some separate "lua-map" resource that you will update with your lua files and restart. that's first that comes to mind or something with runcode/loadstring. imo XML is the way, why create mapping system if there already is one. Link to comment
eAi Posted December 13, 2010 Share Posted December 13, 2010 Well said. You can save whatever objects or other elements you've created with a line or two of code, if you do things properly and use the MTA map format. 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