Jump to content

[HELP] Command /login


#meS

Recommended Posts

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); 

Link to comment

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