The code necessary to invoke Incognito's Streamer Plugin functions/callbacks from within a plugin that uses Zeex's sampGDK.
- Incognito's Streamer Plugin v2.9.3 or later. (using an older plugin will throw "
Function not discovered" errors in the server console when using newer plugin functions, everything else will work fine). - Zeex's sampGDK Amalgamation.
- Preferably a compiler compatible with the C++14 standard.
- This repository can help GTA:SA-MP users who want to start using sampGDK while also being able to use the Streamer Plugin as a separate plugin, mainly to be able to update it easier for future versions.
-
streamer.hpplooks mostly likestreamer.inc, so it is pretty easy to use Streamer's functions with the definitions that are also available in the Pawn include. -
Functions declarations are available in
streamer.hpp. Each function type has its own namespace. For example, if in Pawn you didCreateDynamicObject( ... );now you can do it likePlugins::Streamer::Object::Create, it is still returning the object ID. -
To integrate it in your gamemode you may need to do small changes, such as changing sampGDK's include path or just renaming the
streamerfiles. -
You need to define Streamer Plugin's callbacks in your plugin, in
streamer.hppI provided only the declarations and instreamer.cppthey get called, but you have to seecallbacks.cppfor an example of how to create their definitions. -
Streamer Plugin-like callbacks are actually called in
streamer.cppunderOnPublicCall. If you want the callbacks to be actually executed, you need to addOnPublicCallin your definition file, as shown instreamer.def, so the main callback will get imported.
-
It may not work fine with an older Visual Studio compiler, I recommend Microsoft Visual Studio 2015/2017 with the latest updates.
-
It misses the extended item creation functions (excepting the alternative for
CreateDynamicMapIconEx[Plugins::Streamer::MapIcon::CreateEx] because I needed it once so I created it). I find these extended functions to be too big and I didn't need them, but I may add them if asked to in the future). Also, it may miss some defaultstreamer.incdefinitions. -
If you want anything missing to be added you can create an issue or send a pull request.