Jump to content

(Help) Account / Logout


Recommended Posts

Hello everyone! I'm trying to check if the player's account still exists after the player has logged out, due to the account being deleted.
What I did to check will only return the 'true' message even though the account was deleted.
Question is, how can I actually make this check work using the 'onPlayerLogout' event?

addEventHandler( "onPlayerLogout", getRootElement( ), function( previousAccount, currentAccount ) 

	local playerName = getPlayerName( source )
	outputChatBox( playerName .. " logged out of account: '".. getAccountName( previousAccount ).."'", source ) -- info

	local does_previousAcc_still_exsist = getAccountName( previousAccount ) or "DELETED"
	if ( does_previousAcc_still_exsist ) then 
		outputChatBox( "account: true: " .. does_previousAcc_still_exsist )
	  else
		outputChatBox( "account: false: " .. does_previousAcc_still_exsist )
		-- trigger event here
	end
end)

 

Link to comment
  • Scripting Moderators

I don't think what you're doing will be reliable. It's better to trigger the event from the resource responsible for the deletion of the account and the player's log out

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