CodX Posted May 24, 2020 Share Posted May 24, 2020 Hi ! It's possible to excute server command as admin using executeCommandHandler ? For example, i want give some game points using sql for a player that have 10 hours, but he doesn't have access to game point's command. Link to comment
Moderators IIYAMA Posted May 24, 2020 Moderators Share Posted May 24, 2020 (edited) 40 minutes ago, CodX said: It's possible to excute server command as admin using executeCommandHandler ? Not likely, since that only will work when there is an admin online which you can use as executor. https://wiki.multitheftauto.com/wiki/Element/Console It is better to solve that at the source: local console = getElementChildren ( root, "console")[1] addCommandHandler ( "somecommand", function ( playerSource, commandName ) if console == playerSource or --[[ ACL check]] then end end) Option A local console = getElementChildren ( root, "console")[1] if console == playerSource then end Option B if getElementType(playerSource) == "console" then end Edited May 24, 2020 by IIYAMA Link to comment
CodX Posted May 25, 2020 Author Share Posted May 25, 2020 21 hours ago, IIYAMA said: Not likely, since that only will work when there is an admin online which you can use as executor. https://wiki.multitheftauto.com/wiki/Element/Console It is better to solve that at the source: local console = getElementChildren ( root, "console")[1] addCommandHandler ( "somecommand", function ( playerSource, commandName ) if console == playerSource or --[[ ACL check]] then end end) Option A local console = getElementChildren ( root, "console")[1] if console == playerSource then end Option B if getElementType(playerSource) == "console" then end So, at server side i can use that function like "executeCommandHandler("give", "console", "money", 5000) 'give' is the command and the executor is 'console', rest of them are arguments. Link to comment
Moderators IIYAMA Posted May 25, 2020 Moderators Share Posted May 25, 2020 1 minute ago, CodX said: 'give' is the command and the executor is 'console', rest of them are arguments. Maybe, there is no information about console being available here: https://wiki.multitheftauto.com/wiki/ExecuteCommandHandler So I am not sure if that is supported. But if you want to try that, you need to provide the element console and not the string "console". Link to comment
CodX Posted May 26, 2020 Author Share Posted May 26, 2020 14 hours ago, IIYAMA said: Maybe, there is no information about console being available here: https://wiki.multitheftauto.com/wiki/ExecuteCommandHandler So I am not sure if that is supported. But if you want to try that, you need to provide the element console and not the string "console". Ah, i understand. Ok, thank you for help ! 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