mirror of
https://github.com/ErikasKontenis/SabrehavenServer.git
synced 2025-12-22 17:17:12 +01:00
finish guildwar system
This commit is contained in:
@@ -48,4 +48,35 @@ end
|
||||
|
||||
if not nextUseStaminaTime then
|
||||
nextUseStaminaTime = {}
|
||||
end
|
||||
|
||||
function isInArray(array, value, isCaseSensitive)
|
||||
local compareLowerCase = false
|
||||
if value ~= nil and type(value) == "string" and not isCaseSensitive then
|
||||
value = string.lower(value)
|
||||
compareLowerCase = true
|
||||
end
|
||||
if array == nil or value == nil then
|
||||
return (array == value), nil
|
||||
end
|
||||
local t = type(array)
|
||||
if t ~= "table" then
|
||||
if compareLowerCase and t == "string" then
|
||||
return (string.lower(array) == string.lower(value)), nil
|
||||
else
|
||||
return (array == value), nil
|
||||
end
|
||||
end
|
||||
for k,v in pairs(array) do
|
||||
local newV
|
||||
if compareLowerCase and type(v) == "string" then
|
||||
newV = string.lower(v)
|
||||
else
|
||||
newV = v
|
||||
end
|
||||
if newV == value then
|
||||
return true, k
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
Reference in New Issue
Block a user