Thread Rating:
  • 6 Vote(s) - 2.33 Average
  • 1
  • 2
  • 3
  • 4
  • 5
table help
#1
I need some help with the use of tables. I'm looking for a way to check if a value is in a table, and thought maybe there is a way without looping through the table? What I want to do is this (probably syntactically wrong):

Code:
function Summon.ClassCanSummon()
    local SummonerClasses {}
    SummonerClasses[1] = FFXIV.JOBS.SUMMONER
    SummonerClasses[2] = FFXIV.JOBS.ARCANIST
    if Player.classid is in SummonerClasses{} then
        return true
    end
    else
        return false
    end
end

so I build a table of jobs that can summon, and want to check if the players class is in that table, and then return a true/false.

Edit: I solved it by not using a table, isn't worth it for two values, I guess ;)
Reply
 


Messages In This Thread
table help - by TauTau - 10-30-2013, 02:01 PM
RE: table help - by z0mg - 10-30-2013, 02:32 PM
RE: table help - by TauTau - 10-30-2013, 02:36 PM
RE: table help - by z0mg - 10-30-2013, 02:44 PM
RE: table help - by KaWeNGoD - 10-30-2013, 02:57 PM
RE: table help - by TauTau - 10-30-2013, 03:17 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)

We help you win the game.

FFXIV Bot and More.

 

Products