boro Posted August 2, 2013 Posted August 2, 2013 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
boro Posted August 2, 2013 Author Posted August 2, 2013 i mean. this is for join function, when player join on server and is team 1 and team 2 empety then start siteRound() event -(restart round)-
boro Posted August 2, 2013 Author Posted August 2, 2013 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 )
Castillo Posted August 2, 2013 Posted August 2, 2013 Debug the script, see what "team1Count" and "team2Count" returns.
boro Posted August 2, 2013 Author Posted August 2, 2013 yes i check it but debug is without erros or warnings i don't know why this dont work
Castillo Posted August 2, 2013 Posted August 2, 2013 I didn't say look for errors, I said see what these two variables return, their values.
bandi94 Posted August 2, 2013 Posted August 2, 2013 Bk you c+p the line 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 )
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now