_Marco_ Posted October 21, 2020 Share Posted October 21, 2020 Hello guys is it possible to give a person access to a command? Syntax : /givecommand [command] [playername] Link to comment
Moderators IIYAMA Posted October 21, 2020 Moderators Share Posted October 21, 2020 (edited) 5 hours ago, _Marco_ said: Hello guys is it possible to give a person access to a command? Syntax : /givecommand [command] [playername] Commands are set based on the Account Control List (ACL). Admin panel does have an user interface to modify this, that can be found under resources: click on the right top to modify the ACL. For creating the exact thing you want, modify the example on this page: https://wiki.multitheftauto.com/wiki/AclSetRight <right name="command.givecommand" access="true" /> <right name="command.YOUR COMMAND NAME" access="true" /> Note, this works only for Groups. Else you will have to create something custom. Edited October 21, 2020 by IIYAMA Link to comment
_Marco_ Posted October 21, 2020 Author Share Posted October 21, 2020 I do not want to use the ACL I want to use the database to do this, is it possible? If possible, send materials or training in this regard Link to comment
Moderators IIYAMA Posted October 21, 2020 Moderators Share Posted October 21, 2020 (edited) 2 hours ago, _Marco_ said: If possible, send materials or training in this regard Then here you are: https://wiki.multitheftauto.com/wiki/OnPlayerCommand https://wiki.multitheftauto.com/wiki/CancelEvent Database stuff etc. can be found on the wiki. Keep in mind that A-sync database requests with cancelled commands are not possible. Edited October 21, 2020 by IIYAMA Link to comment
_Marco_ Posted October 25, 2020 Author Share Posted October 25, 2020 Can you give me an example of how to do this? How to give a command to a multiplexer so that it is stored in the database? Link to comment
Moderators IIYAMA Posted October 25, 2020 Moderators Share Posted October 25, 2020 1 hour ago, _Marco_ said: Can you give me an example of how to do this? local commandObject = { collection = { ["fly"] = true }, playerAccess = { ["<playerserial>"] = { -- put your serial in here. ["fly"] = true } } } addEventHandler("onPlayerCommand", root, function(command) if commandObject.collection[command] then local serial = getPlayerSerial(source) local playerAccess = commandObject.playerAccess[serial] if playerAccess and playerAccess[command] then return end cancelEvent() end end ) Sure. 1 hour ago, _Marco_ said: How to give a command to a multiplexer so that it is stored in the database? I am not going to teach you stuff that is beyond your current level, for obvious reasons. 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