Vercetti1010 Posted April 13, 2008 Share Posted April 13, 2008 is there a way to restrict a command to only some people? we have our group of admins in our server but we often have to keep some commands secret, such as the opening of our gates at area 51 becasue we do not know how to restritct them. this question comes up becasue I have a perfect jail script, but this absolutley cannot be accessbile to anyone. how might i go about restricting the usage to admins only? just fyi, i do not own the server, i am a scripter for it, so it has to be a way that i can do it without editing the servers files. here is an example of the script i want to restrict. function jailPlayer(thePlayer, commandName, jailTarget) theNoob = getPlayerFromNick(jailTarget) if (theNoob) then setElementInterior ( theNoob, 10 ) setElementPosition (theNoob, 215.24324035645, 110.02223205566, 999.015625) setElementDimension ( theNoob, 10 ) toggleAllControls ( theNoob, false ) outputChatBox ( "You have been jailed", theNoob, 193, 13, 13 ) outputChatBox ( "You jailed a player", thePlayer, 193, 13, 13 ) else outputChatBox ("Error: This player doesn't exist", thePlayer, 193, 13, 13) end end function unJail (thePlayer, commandName, jailTarget) theNoob = getPlayerFromNick(jailTarget) if (theNoob) then setElementInterior ( theNoob, 0) setElementPosition (theNoob, 2290.2666015625, 2431.1103515625, 10.8203125) setElementDimension ( theNoob, 0 ) toggleAllControls (theNoob, true) outputChatBox ("You've been released, please behave next time", theNoob, 193, 13, 13) outputChatBox ("You released a player", thePlayer, 193, 13, 13) else outputChatBox ("Error: This player doesn't exist", thePlayer, 193, 13, 13 ) end end addCommandHandler("jail", jailPlayer) addCommandHandler("unjail", unJail ) Link to comment
Stevvo Posted April 13, 2008 Share Posted April 13, 2008 Use the ACL, search around for info on the ACL to find out how to use it. Link to comment
eAi Posted April 13, 2008 Share Posted April 13, 2008 You really have to use the ACL, that is what it is for. It's a matter of adding a line for each command in the admin group and specifying 'false' as the last argument for addCommandHandler for each of the commands you want to restrict. Link to comment
Vercetti1010 Posted April 14, 2008 Author Share Posted April 14, 2008 our admin system is not like a ususal one and i am not the maker of it nor do i understand it remotely. acl probably will not work for anyone except the top level admins. is there another way i could do this? Link to comment
eAi Posted April 14, 2008 Share Posted April 14, 2008 ACL works for any group of users - admins, half-admins, moderators, banned players, whatever. You can configure it with the acl.xml file or using the ACL scripting functions. Link to comment
Vercetti1010 Posted April 15, 2008 Author Share Posted April 15, 2008 ok, that sounds promising. i can ask for the xml from my fellow administrators. how does acl work? i checked on the wiki but it wasnt very comprehensive, it just showed what it does. say i never made an acl.xml file or looked at one ever. after looking at one, what do i do next? Link to comment
50p Posted April 16, 2008 Share Posted April 16, 2008 acl.xml is located in the same folder as mtaserver.conf and accounts.xml (...\server\mods\deathmatch) and you modify it, you don't create a new one (do you?). Link to comment
Vercetti1010 Posted April 18, 2008 Author Share Posted April 18, 2008 I would modify it. im guessing i can just follow the format of the commands already there. we definatley need this. our secret commands keep leaking out to the public somehow lol. nobody says a word and everyone in the server can get into area 51. i had a look at the acl.xml and i notice a pattern. i think i understanf how to add commands to a group. is there a way to have it look for an admins nickname. or more likely how do i add someone to a group. Link to comment
50p Posted April 18, 2008 Share Posted April 18, 2008 To add a used to a group you'll need just add one line: Just change from Console to the nickname you want to add. 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