Jump to content

Check


#Paper

Recommended Posts

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? :S

Link to comment

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
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 :D

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