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
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
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/

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