Jump to content

Setting team is being a biatch!


Xeno

Recommended Posts

I am so confused here, I cant seem to setPlayerTeam, I've done it before this way and for some reason its giving me a bad arugement error... Here's the code.

function evenTeams(player) 
    local ali = getTeamFromName ( "cheese" ) 
    local pred = getTeamFromName ( "bacon" ) 
    local aliCount = countPlayersInTeam ( ali ) 
    local predCount = countPlayersInTeam ( pred ) 
  
    if aliCount == predCount then 
setPlayerTeam ( player ,pred ) 
outputChatBox("Debug test 1" , 255,0,0) 
  elseif pred > ali then 
triggerClientEvent("evenTeamsMessage", getRootElement()) 
  elseif pred < ali then 
 setPlayerTeam ( player , pred ) 
end 
end 
addEvent("evenTeams", true) 
addEventHandler("evenTeams", getRootElement(), evenTeams) 

I've tried replacing "player" with "source" "thePlayer" and it still doesnt work...

When I replace it with "source" the error is changed to "bad player pointer", but with player and thePlayer, its changed to "Bad arguement"

Could you please help me? Thanks,

Xeno

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