Jump to content

[HELP] Command /login


#meS

Recommended Posts

Posted
function disableLogin(command) 
    if (command == "login") then 
        cancelEvent() 
    end 
end 
addEventHandler("onPlayerCommand", root, disableLogin)    

There you go

Posted

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

Posted (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 by Guest

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

Posted
I don't think it's possible to remove the /login command by cancelling onPlayerCommand.

You can try it.

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

Posted

^ You can't remove login command using removeCommandHandler.

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

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