RDNWiki: DOWScar/Tutorials/Advanced/SGroupConditionExample ...

RDN Wiki Home | Page Index | Recent Changes | Recently Commented | Users | Registration | Login:  Password:  

SGroup Condition Example


Contents


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

Links


SCAR
Wiki Home

End of Page


Referring pages: DOWScar
DOWScar/Tutorials
DOWScar/Tutorials/Advanced

There are no files on this page. [Display files/form]
There is no comment on this page. [Display comments/form]