Lestat Posted July 13, 2015 Share Posted July 13, 2015 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
tosfera Posted July 13, 2015 Share Posted July 13, 2015 I would say; add a function in one of your files that gets executed when a player does a command at the client. If the function returns false, he'll cancel the command. MTA currently doesn't have onClientPlayerCommand event, sadly enough. 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