Jump to content

countPlayersInTeam, Teamcounter


Alex1002

Recommended Posts

Answere:

It WORKS

addEventHandler ( "onPlayerQuit", root, function ( ) 
     local team = getPlayerTeam ( source )    
     if team then 
          local teamname = getTeamName ( team ) 
          if teamname == "TeamOne" or teamname == "TeamTwo" then 
               if countPlayersInTeam ( team ) - 1 == 0 then 
                    if isTimer ( timerCount ) then 
                         killTimer ( timerCount ) 
                    end 
               end 
          end 
     end 
end ) 

Old- Question

Hello,

how I leave with

  
countPlayersInTeam  
  

the number of the players determine and with too low number in a team, time kill ¿¿¿

M.f.G

Alex.W

Edited by Guest
Link to comment

Thank you very much @CodyL:

So how i can cancel the Timer, if the Team less than one¿¿¿

  
function teamMemberGroup () 
  if (countPlayersInTeam(getTeamFromName("TeamEins")) >= 1) and (countPlayersInTeam(getTeamFromName("TeamZwei")) >= 1) then 
    if not isTimer(timerPlayGame) then 
    timerPlayGame = setTimer (function() outputChatBox("Es funktioniert") end, 6000, 9) 
    elseif (countPlayersInTeam(getTeamFromName("TeamEins")) < 1) or (countPlayersInTeam(getTeamFromName("TeamZwei")) < 1) then 
      if isTimer(timerPlayGame) then 
        outputChatBox("ALLES NUR KASE") 
        killTimer(timerPlayGame) 
      end 
    end 
  end 
end 
  

this doesn't work with killTimer, because the TeamCount is not less 1…

M.f.G

Alex.W

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...