بنسبة ل
اكونت داتا الخاص باونلاين و اوف لاين
addEventHandler( 'onPlayerLogin', getRootElement( ),
function( _, theCurrentAccount )
if getUserName( getAccountName( theCurrentAccount ) ) and isHGAP( getAccountName( theCurrentAccount ) ) then
updateUserName( getAccountName( theCurrentAccount ), 'online' )
--out( ' 1 ' )
elseif not getUserName( getAccountName( theCurrentAccount ) ) and isHGAP( getAccountName( theCurrentAccount ) ) then
setUserName( getAccountName( theCurrentAccount ), 'online' )
--out( ' 2 ' )
elseif getUserName( getAccountName( theCurrentAccount ) ) and not isHGAP( getAccountName( theCurrentAccount ) ) then
destoryUserName( getAccountName( theCurrentAccount ) )
--out( ' 3 ' )
end
end
)
addEventHandler( 'onPlayerQuit', getRootElement( ),
function( )
local pAccount = getPlayerAccount( source )
if getUserName( getAccountName( pAccount ) ) and isHGAP( getAccountName( pAccount ) ) then
updateUserName( getAccountName( pAccount ), getTimeNow( ) )
--out( ' 1 ' )
elseif getUserName( getAccountName( pAccount ) ) and not isHGAP( getAccountName( pAccount ) ) then
destoryUserName( getAccountName( pAccount ) )
--out( ' 2 ' )
end
end
)
addEventHandler( 'onPlayerLogout', getRootElement( ),
function( thePreviousAccount )
if getUserName( getAccountName( thePreviousAccount ) ) and isHGAP( getAccountName( thePreviousAccount ) ) then
updateUserName( getAccountName( thePreviousAccount ), getTimeNow( ) )
--out( ' 1 ' )
elseif getUserName( getAccountName( thePreviousAccount ) ) and not isHGAP( getAccountName( thePreviousAccount ) ) then
destoryUserName( getAccountName( thePreviousAccount ) )
--out( ' 2 ' )
end
end
)