Anubhav Posted March 16, 2014 Author Share Posted March 16, 2014 But it will be laggy. Any other way without xml or sql or mysql? Link to comment
Saml1er Posted March 16, 2014 Share Posted March 16, 2014 But it will be laggy. Any other way without xml or sql or mysql? Dude, my lobby script load maps using XML functions and it doesn't lagg at all and about the gang thing, what do you use to save gang names, elementData or accountData ? Link to comment
Castillo Posted March 16, 2014 Share Posted March 16, 2014 You want the groups to remain once you restart the resource? because if that's so, you'll need to use either SQL, MySQL or XML. Link to comment
Anubhav Posted March 16, 2014 Author Share Posted March 16, 2014 No not that. I want to save a memo. How can i make a file for one group by file functions or maybe account data? Link to comment
Castillo Posted March 16, 2014 Share Posted March 16, 2014 If you are using tables to store groups, then just store the memo content in the same table. Link to comment
Anubhav Posted March 16, 2014 Author Share Posted March 16, 2014 So how should i get the data and set it? For only gang. And i told to give one example. Link to comment
Anubhav Posted March 16, 2014 Author Share Posted March 16, 2014 What part do want. Sorry but i can't post whole script. Link to comment
Saml1er Posted March 16, 2014 Share Posted March 16, 2014 What part do want. Sorry but i can't post whole script. The part where you are saving data. Link to comment
Anubhav Posted March 16, 2014 Author Share Posted March 16, 2014 I am saving in every function. Which part? Of tables or what/ Link to comment
Saml1er Posted March 16, 2014 Share Posted March 16, 2014 I am saving in every function. Which part? Of tables or what/ Just post a single function you are saving it. If you can't post it then only god can help you. ;D Link to comment
pa3ck Posted March 16, 2014 Share Posted March 16, 2014 You can save the groups, members, leaders and all that sort if things, but you cant save the memo? How come? Its pretty much the same thing... You probably have a table or something with the members of a given team, just insert your text there and retreive it whenever you need it. Link to comment
Tete omar Posted March 17, 2014 Share Posted March 17, 2014 XML - simple. SQL would be more suitable for his request in my opinion. Link to comment
Anubhav Posted March 17, 2014 Author Share Posted March 17, 2014 Ok i will try to. If it works with table.insert in memo's and its ok . I got how to do thanks guyz for putting alot of effort on me. Link to comment
Anubhav Posted March 17, 2014 Author Share Posted March 17, 2014 How to get text from table? I did the information with table.insert but is thier any function for getting the info from table? Link to comment
Noki Posted March 17, 2014 Share Posted March 17, 2014 table.concat, or is that for text? I can't remember. Link to comment
Saml1er Posted March 17, 2014 Share Posted March 17, 2014 Its for text. You need to loop through table. for k,v in ipairs (table) do if v == "Text" then print (v) end end Link to comment
Anubhav Posted March 17, 2014 Author Share Posted March 17, 2014 what is v == "Text" ? I will try it but it will take all info. I need for the one group only? Is account data possible for itt/ Link to comment
Saml1er Posted March 17, 2014 Share Posted March 17, 2014 what is v == "Text" ? I will try it but it will take all info. I need for the one group only? Is account data possible for itt/ its the text you inserted. for example, local myT = { } a = "Hello, MTA players" b = "Welcome to lua scripting" table.insert (myT, b) table.insert (myT, a) -- loop local Cash = tonumber ( getElementData (localPlayer, "cash") ) -- you must use setElementData before this ^^ for k,v in ipairs (myT) do if v == "Hello, MTA players" and Cash > 50 then -- some code here elseif v == "Welcome to lua scripting" and Cash < 50 then -- some code here end end Well if you're doing this client side then use setElementData. Link to comment
Anubhav Posted March 17, 2014 Author Share Posted March 17, 2014 I am not understanding. Is thier a way without loops? Link to comment
pa3ck Posted March 17, 2014 Share Posted March 17, 2014 There is. local myTable = { [ "text" ] = "This is the first text.", } myTable.text2 = "And here comes the second one." outputChatBox( myTable [ "text" ] ) outputChatBox( myTable [ "text2" ] ) Link to comment
Anubhav Posted March 17, 2014 Author Share Posted March 17, 2014 Wow. You gave me a perfect example. Thanks Man for solving my problem:) Question: How to add a column like [ "text" ] and its text? Using table.insert/ Link to comment
Recommended Posts