diff --git a/Pools.hpp b/Pools.hpp index ac5c631..27c2c36 100644 --- a/Pools.hpp +++ b/Pools.hpp @@ -66,6 +66,20 @@ namespace rage } } + template + void CallFor(std::vector const& players, const std::string& eventName, Args&&... args) + { + const int count = sizeof...(Args); + + if (count == 0) + this->_CallFor(players, eventName); + else + { + arg_t arguments[count] = { arg_t(std::forward(args))... }; + this->_CallFor(players, eventName, arguments, count); + } + } + template void Invoke(uint64_t hash, Args&&... args) { @@ -107,6 +121,20 @@ namespace rage this->_InvokeInDimension(dimension, hash, arguments, count); } } + + template + void InvokeFor(std::vector const& players, uint64_t hash, Args&&... args) + { + const int count = sizeof...(Args); + + if (count == 0) + this->_InvokeFor(players, hash); + else + { + arg_t arguments[count] = { arg_t(std::forward(args))... }; + this->_InvokeFor(players, hash, arguments, count); + } + } }; class IVehiclePool