#Paper Posted January 27, 2011 Share Posted January 27, 2011 how i can check if is the 1° time that a player join? Link to comment
Castillo Posted January 27, 2011 Share Posted January 27, 2011 set a data on his account or something like that. Link to comment
#Paper Posted January 27, 2011 Author Share Posted January 27, 2011 set a data on his account or something like that. if getAccountData(source, "mspserver.newplayer") == "yes" then outputChatBox("No New Player!") else outputChatBox("No New Player!") end like this? but if the player join for 1° time the server can't find the accountData, and returns the errer, so? Link to comment
Castillo Posted January 27, 2011 Share Posted January 27, 2011 account data uses player ACCOUNT not player ELEMENT. getPlayerAccount(source) Link to comment
DakiLLa Posted January 27, 2011 Share Posted January 27, 2011 You could just do if not getAccountData( getPlayerAccount( player ), "dataNameYouWantToCheck" ) then outputChatBox( "Joined for the first time" ) setAccountData( getPlayerAccount( player ), "dataNameYouWantToCheck", "yes" ) else outputChatBox( "Welcome back on my server" ) end since getAccountData returns false if no data was found with such key. edit: and notice that thing that Solidsnake14 said. Link to comment
#Paper Posted January 28, 2011 Author Share Posted January 28, 2011 You could just do if not getAccountData( getPlayerAccount( player ), "dataNameYouWantToCheck" ) then outputChatBox( "Joined for the first time" ) setAccountData( getPlayerAccount( player ), "dataNameYouWantToCheck", "yes" ) else outputChatBox( "Welcome back on my server" ) end since getAccountData returns false if no data was found with such key. edit: and notice that thing that Solidsnake14 said. ty, it works 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