azerothcore / mod-eluna

Eluna Lua Engine © for WoW Emulators
https://elunaluaengine.github.io/
GNU General Public License v3.0
96 stars 126 forks source link

add player:RunCommand #176

Closed Tralenor closed 2 months ago

Tralenor commented 3 months ago

Adds a possibility to run a command from Script as if the player typed it into the chat himself. This differs from Global:RunCommand in the sense that Global:RunCommand executes Command as if it was typed into the server console, thus ignoring command permissions and also "loosing information" like target, player, position etc. By using player:RunCommand this can be preserved.

In player:RunCommand all permissions checks are asserted as normal.

My usecase for this was that I wanted to create a simple UI for the IndividualXP module by using a gossip menu where players can select their prefered expirience rate.

55Honey commented 2 months ago

Thanks for the PR and sorry for the delay in handling it!

Tralenor commented 2 months ago

No Problem at all :)