SNIPPET : isInTableRecurse
Operation Flashpoint Dragon Rising OFDR Forums :: OPERATION FLASHPOINT: DRAGON RISING :: OFDR EDITING
Page 1 of 1
SNIPPET : isInTableRecurse
should be self-explanatory. returns an array of the index names in tableName containing entity. feel free to improve.
- Code:
function isInTableRecurse(entity, tableName)
if entity == nil or tableName == nil then
return false;
end
local results = {}
for i, v in pairs(tableName) do
if type(v) == "string" and string.lower(entity) == string.lower(v) then
table.insert(results, i)
end
end
if #results > 0 then
return results
end
return false
end
Regg- Veteran
- Points : 143
Reputation : 10
Join date : 2013-02-22
Operation Flashpoint Dragon Rising OFDR Forums :: OPERATION FLASHPOINT: DRAGON RISING :: OFDR EDITING
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum