Add servertime lua function

This commit is contained in:
Tixx
2026-08-07 01:33:44 +02:00
parent a8dfa4b004
commit cd4cc3e630
+4
View File
@@ -1012,6 +1012,10 @@ TLuaEngine::StateThreadData::StateThreadData(const std::string& Name, TLuaStateI
} }
MPTable.set_function("Get", &LuaAPI::MP::Get); MPTable.set_function("Get", &LuaAPI::MP::Get);
MPTable.set_function("GetServerTimeMS", [this](const sol::this_state ts) {
return make_object(sol::state_view(ts), this->mEngine->Server().GetServerTimeMS());
});
auto UtilTable = StateView.create_named_table("Util"); auto UtilTable = StateView.create_named_table("Util");
UtilTable.set_function("LogDebug", [this](sol::variadic_args args) { UtilTable.set_function("LogDebug", [this](sol::variadic_args args) {
std::string ToPrint = ""; std::string ToPrint = "";