diff --git a/deps/GSL b/deps/GSL index 991fa668..c52bad36 160000 --- a/deps/GSL +++ b/deps/GSL @@ -1 +1 @@ -Subproject commit 991fa6682e819590c695f00c6b880548e55fa914 +Subproject commit c52bad36aa9d5ececcdf6be2d5cd2dce9daa4194 diff --git a/deps/asmjit b/deps/asmjit index 15a60366..8f2c237b 160000 --- a/deps/asmjit +++ b/deps/asmjit @@ -1 +1 @@ -Subproject commit 15a603661871b86c048e697f0e6cd17374dcecc0 +Subproject commit 8f2c237b8315a7d662e0e67d06807296a7bbe5ab diff --git a/deps/curl b/deps/curl index 3ccaddc9..a0d8a1aa 160000 --- a/deps/curl +++ b/deps/curl @@ -1 +1 @@ -Subproject commit 3ccaddc9fcaed6dfbce0f1cf14e5933141cddac6 +Subproject commit a0d8a1aa91073a87b3b996050aff66603f03873d diff --git a/deps/lua b/deps/lua index 26be2745..c954db39 160000 --- a/deps/lua +++ b/deps/lua @@ -1 +1 @@ -Subproject commit 26be27459b11feabed52cf40aaa76f86c7edc977 +Subproject commit c954db39241a8b21d7b32b42b87a066b4708f969 diff --git a/src/client/component/gsc/script_extension.cpp b/src/client/component/gsc/script_extension.cpp index d2278b54..cb164a72 100644 --- a/src/client/component/gsc/script_extension.cpp +++ b/src/client/component/gsc/script_extension.cpp @@ -464,6 +464,34 @@ namespace gsc // return 0 so the game doesn't override the cfg return 0; }); + + function::add("say", [](const function_args& args) + { + const auto message = args[0].as(); + game::SV_GameSendServerCommand(-1, game::SV_CMD_CAN_IGNORE, utils::string::va("%c \"%s\"", 84, message.data())); + + return scripting::script_value{}; + }); + + method::add("tell", [](const game::scr_entref_t ent, const function_args& args) + { + if (ent.classnum != 0) + { + throw std::runtime_error("Invalid entity"); + } + + const auto client = ent.entnum; + + if (game::mp::g_entities[client].client == nullptr) + { + throw std::runtime_error("Not a player entity"); + } + + const auto message = args[0].as(); + game::SV_GameSendServerCommand(client, game::SV_CMD_CAN_IGNORE, utils::string::va("%c \"%s\"", 84, message.data())); + + return scripting::script_value{}; + }); } }; }