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):
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 ;)
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 ;)