mirror of
https://github.com/azerothcore/mod-ale
synced 2025-11-29 15:38:17 +08:00
add RunCommand()
This commit is contained in:
@@ -1210,6 +1210,22 @@ namespace LuaGlobalFunctions
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs a command.
|
||||
*
|
||||
* @param string command : the command to run
|
||||
*/
|
||||
int RunCommand(lua_State* L)
|
||||
{
|
||||
const char* command = Eluna::CHECKVAL<const char*>(L, 1);
|
||||
#if defined TRINITY || AZEROTHCORE
|
||||
eWorld->QueueCliCommand(new CliCommandHolder(nullptr, command, nullptr, nullptr));
|
||||
#elif defined MANGOS
|
||||
eWorld->QueueCliCommand(new CliCommandHolder(0, SEC_CONSOLE, nullptr, command, nullptr, nullptr));
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends a message to all [Player]s online.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user