Jump to content

Use get in Setting


RekZ

Recommended Posts

Posted

How i can use the get function in a string in the meta.xml or use multiple options in the meta ,

i dont know if I'm explaining well xD , I think not.

get("Option")  

 <setting name="*Option" value="1,2" friendlyname="Numbers" examples="1,2,3" desc="" />  

Posted

jajaja and what i can use that to help me ? i dont need to learn about xml i quest other thing that include lua and xml , i dont know why you send me that web is not usesfull for this question

  • Moderators
Posted

My bad,

  
<settings> 
<setting name="*Option" value="1,2" friendlyname="Numbers" examples="1,2,3" desc="" />  
<setting name="*Option2" value="1,2" friendlyname="Numbers" examples="1,2,3" desc="" />  
<setting name="*Option3" value="1,2" friendlyname="Numbers" examples="1,2,3" desc="" />  
</settings> 

  
local valueOfoption1 = get("Option") 
local valueOfoption2 = get("Option2")  
local valueOfoption3 = get("Option3") 

Posted
My bad,
  
<settings> 
<setting name="*Option" value="1,2" friendlyname="Numbers" examples="1,2,3" desc="" />  
<setting name="*Option2" value="1,2" friendlyname="Numbers" examples="1,2,3" desc="" />  
<setting name="*Option3" value="1,2" friendlyname="Numbers" examples="1,2,3" desc="" />  
</settings> 
  
local valueOfoption1 = get("Option") 
local valueOfoption2 = get("Option2")  
local valueOfoption3 = get("Option3") 

i see the other message whit photo jajaja no problem >.< is my fault i dont know how to explain, yeah i know is this form of use get but i test some scripts and i tried to do a multiples options whit get but if i use this i cant put others numbers.. like this if i use..

  
<settings> 
<setting name="*Numbers" value="1,2,3,4" friendlyname="Numbers" examples="1,2,3,4" desc="" />  
</settings> 

addCommandHandler('randomnumber', function() 
        outputChatBox( get("Numbers") ) 
    end) 

when i use the command dont put me in the chat a random number , it give me 1,2,3,4 values , i want to get one number of the list not all the setting , is difficult to explain sorry for my english >.<

  • Moderators
Posted
local valueOfoption1 = get("Option") 
local firstNumber = gettok ( valueOfoption1, 1, string.byte(',') ) 
local secondNumber = gettok ( valueOfoption1, 2, string.byte(',') ) 

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...