• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

[function]CountPlayersInArea

Scooty

Enemia.EU
Joined
Jul 24, 2010
Messages
564
Reaction score
14
Location
Kraków
Hi, i want simple function

CountPlayersInArea(frompos,topos)

function will return number of players in this area.

Thanks for help
 
LUA:
function t(k, i) --fromPosition, toPosition
local v = 0
	for _, pid in ipairs(getPlayersOnline()) do
		if isInRange(getCreaturePosition(pid), k, i) then
			v = v+1
		end
	end
return v
v = 0
end
how to use:
LUA:
function ssadfsadfsad(asd)
	if t({x=1000, y=1000, z=7}, {x=1005, y=1005, z=7}) < 5 then
		print("There's not enough players to start xx event!")
	else
		blabla
	end
end
 
Back
Top