Jump to content

cancelEvent() not working for


Lestat

Recommended Posts

I want to prevent users being able to execute commands while not logged in. (The moment they are presented with the login screen).

  
function preventCommand(command) 
    if isGuestAccount(getPlayerAccount(source)) then 
        outputChatBox("Guest using command", source) 
        cancelEvent() 
    end 
end 
addEventHandler("onPlayerCommand", root, preventCommand) 
  

The above code succesfully cancels commands handled in the server. But it doesnt cancel commands handled in the client. Both prints the message in the chatbox.

Any workaround?

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