Jump to content

players check


boro

Recommended Posts

Hi i make player check script when round start but it for only when i am in team 1 and if i am in team 2 then it don't work why?

please help.ty..

function OnCheckRound () 
    local team1 = getTeamFromName ( "Team-1" ) 
    local team2 = getTeamFromName ( "Team-2" ) 
    local team1Count = countPlayersInTeam ( team1 ) 
    local team2Count = countPlayersInTeam ( team1 ) 
if team1Count == 0 and team2Count == 0 then 
outputChatBox ( "Not active players for start round", getRootElement(), 255, 255, 255, true ) 
siteRound() 
end 
end 

Link to comment
function processPlayerRespawn ( player ) 
    player = player or source 
    if not isElement(player) then return end 
       -- set player spectate team 
        setPlayerTeam(player, team3 ) 
        OnCheckRound () 
end 
end 
addEventHandler ( "onPlayerJoin", getRootElement(), processPlayerRespawn ) 

Link to comment

Bk you c+p the line :wink:

    local team1Count = countPlayersInTeam ( team1 ) --team1 
   local team2Count = countPlayersInTeam ( team1 ) -- and team1 again  

it think it should be

    local team1Count = countPlayersInTeam ( team1 ) 
    local team2Count = countPlayersInTeam ( team2 ) 

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