Turbe$Z Posted February 11, 2017 Share Posted February 11, 2017 addEventHandler("onPlayerLogout", getRootElement(), function () local name = getPlayerName ( source ) if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Admin")) then exports[getResourceName(resource)]:addNotification(root, name.." kilépett a tulajdonos szolgálatból!", "success") end end ) what wrong? onPlayerLogin working with this.. wtf?! Link to comment
NeXuS™ Posted February 11, 2017 Share Posted February 11, 2017 Does it give you any error in debugscript? Link to comment
pa3ck Posted February 11, 2017 Share Posted February 11, 2017 (edited) Maybe because when they logout they are no longer in any team? (guest account). onPlayerLogout passes through 2 arguments, one of them is the oldAccount, use that instead. Edited February 11, 2017 by pa3ck Link to comment
Turbe$Z Posted February 12, 2017 Author Share Posted February 12, 2017 8 hours ago, Patrik91 said: Does it give you any error in debugscript? No Link to comment
Turbe$Z Posted February 12, 2017 Author Share Posted February 12, 2017 8 hours ago, pa3ck said: Maybe because when they logout they are no longer in any team? (guest account). onPlayerLogout passes through 2 arguments, one of them is the oldAccount, use that instead. Like this? function test() if (isGuestAccount(getPlayerAccount(v)) == false) then accountname = getAccountName (getPlayerAccount(v)) if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then exports[getResourceName(resource)]:addNotification(root, " logged out", "success") end end end Link to comment
WhoAmI Posted February 12, 2017 Share Posted February 12, 2017 (edited) Man, when player logs out he is no longer logged in. Look what argument onPlayerLogout event gives. account thePreviousAccount, account theCurrentAccount Do you see? So, addEventHandler("onPlayerLogout", getRootElement(), function (acc, _) local name = getPlayerName ( source ) if isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Admin")) then exports[getResourceName(resource)]:addNotification(root, name.." kilépett a tulajdonos szolgálatból!", "success") end end ) Edited February 12, 2017 by WhoAmI 1 Link to comment
Turbe$Z Posted February 12, 2017 Author Share Posted February 12, 2017 3 minutes ago, WhoAmI said: Man, when player logs out he is no longer logged in. Look what argument onPlayerLogout event gives. account thePreviousAccount, account theCurrentAccount Do you see? So, addEventHandler("onPlayerLogout", getRootElement(), function (acc, _) local name = getPlayerName ( source ) if isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Admin")) then exports[getResourceName(resource)]:addNotification(root, name.." kilépett a tulajdonos szolgálatból!", "success") end end ) thanks Link to comment
koragg Posted February 13, 2017 Share Posted February 13, 2017 Man, when player logs out he is no longer logged in. 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