Jump to content

players check


boro

Recommended Posts

Posted

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 

I'll help When I Can.

Posted

I don't get what do you mean.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

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

I'll help When I Can.

Posted

And what is the problem...?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

How are you executing that function?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
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 ) 

I'll help When I Can.

Posted

Debug the script, see what "team1Count" and "team2Count" returns.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

I didn't say look for errors, I said see what these two variables return, their values.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

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 ) 

Ingame Name : |DGT|Puma

DGT Clan Server 24/7 Owner/Scripter

MultiGameMode in progress :

n-560x95_FFFFFF_FFFFFF_0283C4_000000.png

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