Quited Posted May 19, 2013 Share Posted May 19, 2013 Event "OnPlayerCommand" and ACL not support "space" Example : i want to add in ACL "command.stop admin" and set to false If i type in console "stop admin" the resource stopped succesfuly and no denied by ACL because "space" between stop and admin Can someone help me and i don't need to protect admin panel in mtaserver.conf Link to comment
Quited Posted May 20, 2013 Author Share Posted May 20, 2013 Please move this topic to "Scripting forum" Link to comment
Castillo Posted May 20, 2013 Share Posted May 20, 2013 The event "onPlayerCommand" only has one argument which is the command name, it doesn't include parameters. Plus, you can't use spaces on commands. Link to comment
Quited Posted May 20, 2013 Author Share Posted May 20, 2013 Yes , but i need to block more commands and words (in chatbox or console) with spaces Link to comment
Jacob Lenn Posted May 20, 2013 Share Posted May 20, 2013 I think you didn't understand Solidsnake. He meant that commands don't include parameters. It means that command is only 1st word that you are writing on chatbox. Link to comment
Moderators IIYAMA Posted May 20, 2013 Moderators Share Posted May 20, 2013 Why not use addCommandHandler? I have never added acl rights with scripts so I may made a mistake. local trueOrFalse = {["true"]=true,["false"]=true} local setTrueOrFalse = {["true"]=true,["false"]=false} function changeAcl (player,CMD,pointer1,pointer2) if pointer1 = "admin" and trueOrFalse[pointer2] then local acl = aclGet (CMD) if acl then aclSetRight (acl, "admin",setTrueOrFalse[pointer2]) aclSave () end end end addCommandHandler ( "command.stop", changeAcl) This may also works: local trueOrFalse = {["true"]=true,["false"]=true} addCommandHandler ( "command.stop", function (player,CMD,pointer1,pointer2) if pointer1 = "admin" and trueOrFalse[pointer2] then local acl = aclGet (CMD) if acl then aclSetRight (cal, "admin",(pointer2 == "true" and true or false)) aclSave () end end end) Link to comment
Quited Posted May 20, 2013 Author Share Posted May 20, 2013 thx all for reply but if i need to block "command.bind say" for spammers and more commands i don't remember it now Link to comment
iPrestege Posted May 20, 2013 Share Posted May 20, 2013 Make a table with the not a allowed commands and cancel it . "onPlayerCommand" -- Event Handler addEventHandler cancelEvent() table Link to comment
Castillo Posted May 20, 2013 Share Posted May 20, 2013 I think I get what does he want. He wants that you can use commands such as "bind", but he wants to disable some binds, example: say. 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