Jump to content

count player in radar area


JuniorMelo

Recommended Posts

local areanumber = getElementData (source,"areanumber")

for i,k in ipairs (getElementsByType ( "radararea" )) do
	local number = getElementData ( k, "areanumber" )
	if ( number == areanumber ) then
		for i, v in ipairs(getElementsByType ( "player" )) do
			outputChatBox ( ''..i..'', thePlayer, 255, 255, 255, true )
		end
	end
end

such that ?

Edited by JuniorMelo
Link to comment
local areanumber = getElementData (source,"areanumber")
local ganginfo = getgangInfo(getPlayergang(hitElement))
local gangname = ganginfo['gangname']
local dbName = "VOLT_3" .. gangname .. "_members2"
local players = executeSQLQuery("SELECT * FROM ?", dbName)
maxPlayers = 2
for i,k in ipairs (getElementsByType ( "radararea" )) do
	local number = getElementData ( k, "areanumber" )
	if ( number == areanumber ) then
		for t, k in ipairs(players) do
     		 if tonumber(t) <= tonumber(maxPlayers) then outputChatBox ( '#ff4444[ERROR]#ffffff It is necessary ' .. maxPlayers ..'',thePlayer, 255, 255, 255, true ); return end
		end
	end
end

I'm trying to do this, But I'm not sure if it will work properly.

 

(It takes a number of players within the area to initiate an attack on the area)

 

 

Sorry for my English, I'm brazilian :D

 

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...