DakiLLa Posted November 9, 2008 Posted November 9, 2008 hi. I have saved team name in player account data. And when i want to set player to this team, player switching to the nil value team. How to make that player will be switch to the saved team, not nil value? strings in accounts.xml <account name="PlayerOne" password="..." ip="..."> <data team="Cops"/> </account> script.lua function try (thePlayer, commandName) local account = getClientAccount ( thePlayer ) local guest = isGuestAccount ( account ) if ( guest ) then outputDebugString ( "Failed to load account data! Guest account" ) else local checkedTeam = getAccountData ( account, "team" ) if ( checkedTeam ) then setPlayerTeam ( thePlayer, checkedTeam ) outputDebugString ( "Setting player team to the saved team." ) else outputDebugString ( "Failed to load team!" ) end end end addCommandHandler ( "team", try )
Gamesnert Posted November 9, 2008 Posted November 9, 2008 ReturnsReturns a string containing the stored data or false if no data was stored under that key. You're setting the players team to a string... Try to do: local checkedTeam = getTeamFromName ( getAccountData ( account, "team" ) )
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