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.
|
||||
*
|
||||
|
||||
@@ -120,6 +120,7 @@ luaL_Reg GlobalMethods[] =
|
||||
|
||||
// Other
|
||||
{ "ReloadEluna", &LuaGlobalFunctions::ReloadEluna },
|
||||
{ "RunCommand", &LuaGlobalFunctions::RunCommand },
|
||||
{ "SendWorldMessage", &LuaGlobalFunctions::SendWorldMessage },
|
||||
{ "WorldDBQuery", &LuaGlobalFunctions::WorldDBQuery },
|
||||
{ "WorldDBExecute", &LuaGlobalFunctions::WorldDBExecute },
|
||||
|
||||
@@ -206,6 +206,7 @@ namespace LuaMap
|
||||
* Returns a [WorldObject] by its GUID from the map if it is spawned.
|
||||
*
|
||||
* @param ObjectGuid guid
|
||||
* @return WorldObject object
|
||||
*/
|
||||
int GetWorldObject(lua_State* L, Map* map)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user