Simon54 Posted August 13 Share Posted August 13 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 xLive Posted August 13 Scripting Moderators Share Posted August 13 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
Moderators IIYAMA Posted August 14 Moderators Share Posted August 14 When saving the userdata of an element inside of a variable and delete the element afterwards, it's userdata type becomes generic/something else. This might also be the case for accounts. https://wiki.multitheftauto.com/wiki/GetUserdataType 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