Jump to content

Question...


Xeno

Recommended Posts

For your first request.

function logoutHandler()--We define a function name 
    local accountname = getAccountName (getPlayerAccount(source))--we get an account 
    if (isGuestAccount(getPlayerAccount(source)) == true) then --if that accounts is guest ( in everyone's group(in ACL)) 
    cancelEvent()--then cancelEvent 
    outputChatBox("*Logout is not allowed!", source, 255,0,0)--output him to chatbox that logout is not allowed  
end 
end 
addEventHandler("onPlayerLogout",getRootElement(),logoutHandler)--we add a event handler which will handle the funciton 
  

For second, check Solid's post.

Link to comment

Oh, btw, this will work every time they try to logout, but also when logout is not coming from /logout command.

If you want it only for /logout command, try this:

addEventHandler("onPlayerCommand",root, 
function (cmd) 
if (tostring(cmd) == "logout") then 
        redirectPlayer(source, "serverIP", "serverPort") 
    end 
end) 

Link to comment
Oh, btw, this will work every time they try to logout.

Ofcourse it will, why not ?

You either got me wrong or just want to increase the post count.

His first post was:

"How would I disable the "logout" command?"

In my first reply I gave him the code to reconnect every time someone logs out (not just via /logout command), and then I supposed he wanted just for the /logout command, so I replied again.

Did you get me now?

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