#Paper Posted January 27, 2011 Posted January 27, 2011 how i can check if is the 1° time that a player join?
Castillo Posted January 27, 2011 Posted January 27, 2011 set a data on his account or something like that.
#Paper Posted January 27, 2011 Author 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?
Castillo Posted January 27, 2011 Posted January 27, 2011 account data uses player ACCOUNT not player ELEMENT. getPlayerAccount(source)
DakiLLa Posted January 27, 2011 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.
#Paper Posted January 28, 2011 Author 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
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