Jump to content

Lock this


Anubhav

Recommended Posts

  • Replies 54
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted
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 ?

Posted

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.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

If you are using tables to store groups, then just store the memo content in the same table.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Post your groups script.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
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

Posted

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.

Posted

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.

Posted

How to get text from table? I did the information with table.insert but is thier any function for getting the info from table?

Posted
Its for text.

You need to loop through table.

  
for k,v in ipairs (table) do 
if v == "Text" then  
print (v) 
end 
      end 

Posted

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/

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

Posted

There is.

local myTable =  
    { 
  
        [ "text" ] = "This is the first text.", 
  
    } 
  
    myTable.text2 = "And here comes the second one." 
  
outputChatBox( myTable [ "text" ] ) 
outputChatBox( myTable [ "text2" ] ) 

Posted

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/

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...