Xeno Posted January 2, 2012 Share Posted January 2, 2012 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
Castillo Posted January 2, 2012 Share Posted January 2, 2012 Mind posting the exact error you're getting? Link to comment
Xeno Posted January 2, 2012 Author Share Posted January 2, 2012 Bad arguement @ "setPlayerTeam" Link to comment
Castillo Posted January 2, 2012 Share Posted January 2, 2012 Are you sure that these teams exists? and the player is valid? Link to comment
Xeno Posted January 2, 2012 Author Share Posted January 2, 2012 Yeah the team exists. I change around the clientTrigger and then changed it too setPlayerTeam (source ,pred ) and now its saying it cant compare two user values. Link to comment
Castillo Posted January 2, 2012 Share Posted January 2, 2012 What do you mean? that error means you're trying to compare two userdata (like 2 teams, not their players). Link to comment
Xeno Posted January 2, 2012 Author Share Posted January 2, 2012 I dont know ... It just says: Attempt to compare two userdata values EDIT: NVM I fixed it! Thanks for your help Castiii :3 Link to comment
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