SGroup Condition Example
--[[ Squad Detection ]]
function Rule_DetectSquadCondition()
if SGroup_Exists("sgroup_name") then
if SGroup_IsEmpty("sgroup_name") == false then
if SGroup_Count(SGroup_FromName("sgroup_name")) > 1 then
local count = SGroup_Count(SGroup_FromName("sgroup_name"))
print("there are "..count.." squads in the sgroup")
else
if Squad_Count(SGroup_GetSpawnedSquadAt(SGroup_FromName("sgroup_name"), 1)) >1 then
local count = Squad_Count(SGroup_GetSpawnedSquadAt(SGroup_FromName("sgroup_name"), 1))
print("there are "..count.." squads members in the 1 squad in the sgroup")
else
if SGroup_GetAvgHealth("sgroup_name") < 0.5 then
local health = SGroup_GetAvgHealth("sgroup_name")
print("the Sgroup's health = "..health.." percent")
end
end
end
else
print("the Sgroup is empty")
end
else
print("the Sgroup does not exist")
end
end