25.03.2017, 19:00
Yeah, I saw examples for the InvokeNative function. Any example for variadic functions ? mysql_pquery, SetTimerEx or any other (for timers I'll try to implement Dan's plugin, with examples from sampGDK's timers). sampgdk.h:
I don't really get it, SetTimerEx would look like
? I don't know what to put in place of those question marks. Maybe nothing ?
Totally forgot about OnPublicCall ! Thanks. I guess that it will be required to use static_cast for params of other types.
--------
By the way, about timers:
sampGDK's timers are way too basic, it would be great if they would be extended to look like Dan's Timerfix Plugin.
Also, I saw that we need to specify a globally created struct for the params. std::tuple wouldn't be better for this, without the need to create such a struct, or Zeex wants to keep compatibility with C compilers too ? std::tuple would be a lot better, with the std::make_tuple function.
Код:
* \note In Pawn, variadic functions always take their variable arguments * (those represented by "...") by reference. This means that for such * functions you have to use the 'r' specifier where you would normally * use 'b', 'i' 'd' or 'f'.
Код:
const int SetTimerEx(const char * funcname, int interval, bool repeating, const char * format, ...) { static AMX_NATIVE Native = sampgdk::FindNative("SetTimerEx"); return sampgdk::InvokeNative(Native, "sibsr", funcname, interval, repeating, format, ???); }
Totally forgot about OnPublicCall ! Thanks. I guess that it will be required to use static_cast for params of other types.
--------
By the way, about timers:
sampGDK's timers are way too basic, it would be great if they would be extended to look like Dan's Timerfix Plugin.
Also, I saw that we need to specify a globally created struct for the params. std::tuple wouldn't be better for this, without the need to create such a struct, or Zeex wants to keep compatibility with C compilers too ? std::tuple would be a lot better, with the std::make_tuple function.