SpecT Posted May 9, 2015 Posted May 9, 2015 Hello! Is it possible and if yes how can I block the login command. I remember that the register command is in the Admin panel, but is it possible to block the /login ? I tried to cancel the event onPlayerCommand when the command is login but didn't work. Thanks!
WhoAmI Posted May 9, 2015 Posted May 9, 2015 If onPlayerCommand event doesn't work, there isn't any solution, I guess.
SpecT Posted May 9, 2015 Author Posted May 9, 2015 If onPlayerCommand event doesn't work, there isn't any solution, I guess. Hmm, yeah but it doesn't cancel the event even when the cmd is register (from the admin panel).
Walid Posted May 9, 2015 Posted May 9, 2015 Hello!Is it possible and if yes how can I block the login command. I remember that the register command is in the Admin panel, but is it possible to block the /login ? I tried to cancel the event onPlayerCommand when the command is login but didn't work. Thanks! Yes you can try to use sth like this: local Commands = { ["login"] = true, -- login command } local SerialAccess = { [""] = true, -- maybe you can add your serial here only you will be able to use it } function noAccessCommands(command) if (Commands[command]) then local serial = getPlayerSerial(source) if (not SerialAccess[serial]) then cancelEvent() outputChatBox("You can't use this Command ("..command..")", source, 255, 0, 0) return end end end addEventHandler("onPlayerCommand", root, noAccessCommands) 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
SpecT Posted May 9, 2015 Author Posted May 9, 2015 I made something similar to Walid's code month ago for the "aexec" command and it worked. function banCommand(command) if command == "aexec" then if not getPlayerSerial(source) == "HIDDEN" then cancelEvent() end end if command =="login" then if not getPlayerSerial(source) == "HIDDEN" then cancelEvent() end end if command =="register" then if not getPlayerSerial(source) == "HIDDEN" then cancelEvent() end end end addEventHandler("onPlayerCommand",getRootElement(),banCommand) Or maybe i should use "elseif" .. lel I gotta try that later, because now I dont have time
Walid Posted May 9, 2015 Posted May 9, 2015 Or maybe i should use "elseif" .. lel I gotta try that later, because now I dont have time Use my code 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
MKH Posted May 9, 2015 Posted May 9, 2015 Idk but try this function login (plr) kickPlayer(plr, "this command not allowed") end addCommandHandler("login", login)
The Don Posted May 9, 2015 Posted May 9, 2015 -- Server YourSerial = "" -- the serial that allowed to use this commands cmd = { "login",-- add more commands in the table if you want "", "", } addEventHandler("onPlayerCommand",root, function(command) if getPlayerSerial(source) ~= YourSerial then for k,v in pairs(cmd) do if command == v then outputChatBox("You can't use this command /"..command.."",source,255,0,0) cancelEvent( ) end end end end ) آن يكون فكر المرء مختلآ , خيرآ من آن يكون فكره محتلآ ! my nick name in the game : =x=|DoN|=x= or 7eJAzZy- ( ͡° ͜ʖ ͡°) http://community.multitheftauto.com/ind ... &id=337164 my profile
Walid Posted May 9, 2015 Posted May 9, 2015 i Already gave him the solution wait till he 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
Enargy, Posted May 9, 2015 Posted May 9, 2015 addEventHandler("onPlayerCommand", getRootElement(), function(cmd) if (cmd == "login") then cancelEvent() end end) : - Inactivo.
SpecT Posted May 9, 2015 Author Posted May 9, 2015 Hello!Is it possible and if yes how can I block the login command. I remember that the register command is in the Admin panel, but is it possible to block the /login ? I tried to cancel the event onPlayerCommand when the command is login but didn't work. Thanks! Yes you can try to use sth like this: local Commands = { ["login"] = true, -- login command } local SerialAccess = { [""] = true, -- maybe you can add your serial here only you will be able to use it } function noAccessCommands(command) if (Commands[command]) then local serial = getPlayerSerial(source) if (not SerialAccess[serial]) then cancelEvent() outputChatBox("You can't use this Command ("..command..")", source, 255, 0, 0) return end end end addEventHandler("onPlayerCommand", root, noAccessCommands) Finally I got time to test it. It works perfectly! Thanks dude!
Walid Posted May 9, 2015 Posted May 9, 2015 Finally I got time to test it. It works perfectly! Thanks dude! you are welcome 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
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