SjoerdPSV Posted August 19, 2015 Posted August 19, 2015 function disableLogin(command) if (command == "login") then cancelEvent() end end addEventHandler("onPlayerCommand", root, disableLogin) There you go
SkittlesAreFalling Posted August 19, 2015 Posted August 19, 2015 It is a command that was added by the MTA team, so I don't think you can. https://wiki.multitheftauto.com/wiki/Server_Commands removeCommandHandler("login"); -- Would only work in the resource it was created in, so this won't work. Try: HandleCommand = function(name) if name == "login" then cancelEvent(); end end addEventHandler("onPlayerCommand", getRootElement(), HandleCommand);
JR10 Posted August 21, 2015 Posted August 21, 2015 You could always disable access to the command with acl.
Walid Posted August 21, 2015 Posted August 21, 2015 (edited) Also you can use sth like this Example local commands = { -- Add all your commands here eg : login } local access = { [" Add your serial here (admin) "] = true, } function stopAccessToCommands(command) if (commands[command]) then -- check if it's a blocked command local serial = getPlayerSerial(source) -- get the player serial if (not access[serial]) then -- if he is not an admin cancel the event cancelEvent() return end end end addEventHandler("onPlayerCommand", root, stopAccessToCommands) Edited August 21, 2015 by Guest
JR10 Posted August 21, 2015 Posted August 21, 2015 I don't think it's possible to remove the /login command by cancelling onPlayerCommand.
Walid Posted August 21, 2015 Posted August 21, 2015 I don't think it's possible to remove the /login command by cancelling onPlayerCommand. You can try it.
Walid Posted August 21, 2015 Posted August 21, 2015 ^ You can't remove login command using removeCommandHandler.
JR10 Posted August 21, 2015 Posted August 21, 2015 This function removes a command handler, that is one that has been added using addCommandHandler.
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