• 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!

Script problem

Xleniz

New Member
Joined
Jul 6, 2009
Messages
178
Reaction score
3
Location
Sweden
In arena I need to check how many players are dead in 2 teams. The 2 teams are identified by storage value 1 and 2. Any ideas? (Tried change storage value on login, then check how many storage values are 0 and not 0, but what if they go offline?)

Thx.
 
This is how i use it for my CTF:

LUA:
		local players = getPlayersOnline()
		local intRed = 0
		local intBlue = 0
		for _, pid in ipairs(players) do
				if isInArea(getPlayerPosition(pid), BlueTeam.fromPos, BlueTeam.toPos) then
					intBlue = intBlue + 1
				elseif isInArea(getPlayerPosition(pid), RedTeam.fromPos, RedTeam.toPos) then
					intRed = intRed + 1
				end
		end

Edit: You will just need to add the storage arguments...
 
Last edited:
This is how i use it for my CTF:

LUA:
		local players = getPlayersOnline()
		local intRed = 0
		local intBlue = 0
		for _, pid in ipairs(players) do
				if isInArea(getPlayerPosition(pid), BlueTeam.fromPos, BlueTeam.toPos) then
					intBlue = intBlue + 1
				elseif isInArea(getPlayerPosition(pid), RedTeam.fromPos, RedTeam.toPos) then
					intRed = intRed + 1
				end
		end

Edit: You will just need to add the storage arguments...

Where do you add this?
 
This wont work if you want teleport back, when all players in one team are dead? (And you are somewhere else than red team area). Thx anyway. xd
 
doesn't work, because when I set playerstoragevalue(1405, kills), then I need global variable kills that can change, and I don't know how to make a global variable that can change. ( should it be declared in another file? )
 
Back
Top