09.05.2017, 01:45
Quote:
Hello,
I want to leave a response here about Streamer with SAMPGDK. You can use it as xeeZ said here, but you don't need to invoke Streamer_CallbackHook since it is deprecated in version 2.7.8. Why? Because Incognito decided to use SAMPGDK for OnPlayerConnect and OnPlayerDisconnect. All you need to do is to invoke CreateDynamicObject as xeeZ do in his gist. Code:
int CreateDynamicObject(int modelid, float x, float y, float z, float rx, float ry, float rz, int worldid = -1, int interiorid = -1, int playerid = -1, float streamdistance = 200.0, float drawdistance = 0.0) { static AMX_NATIVE native = sampgdk::FindNative("CreateDynamicObject"); return sampgdk::InvokeNative(native, "iffffffiiiff", modelid, x, y, z, rx, ry, rz, worldid, interiorid, playerid, streamdistance, drawdistance); } Now, I want to know your opinion. If we want to use Streamer with SAMPGDK it is better to invoke a native (like the method above) or to combine streamer plugin with our project (which will be a pain in the a** with plugin updates and with the combination)? By the way, can we register a Streamer's callback in our plugins? I tried this Code:
SAMPGDK_CALLBACK(bool, OnPlayerEditDynamicObject(int playerid, int objectid, int response, float x, float y, float z, float rx, float ry, float rz)); SAMPGDK_CALLBACK(bool, OnPlayerSelectDynamicObject(int playerid, int objectid, int modelid, float x, float y, float z)); PLUGIN_EXPORT bool PLUGIN_CALL OnPlayerEditDynamicObject(int playerid, int objectid, int response, float x, float y, float z, float rx, float ry, float rz) { sampgdk::logprintf("OnPlayerEditDynamicObject: %i | %f | %f | %f", objectid, x, y, z); return true; } PLUGIN_EXPORT bool PLUGIN_CALL OnPlayerSelectDynamicObject(int playerid, int objectid, int modelid, float x, float y, float z) { sampgdk::logprintf("OnPlayerSelectDynamicObject: %i | %f | %f | %f", objectid, x, y, z); return true; } |
you can use this streamer version that supports direct implementation of the streamer in the gamemode.
Then you just need to call the events in your gamemode.
All needed events are listed in the header file.
https://github.com/Sphinxila/samp-pl...r/streamer.hpp
I think its self explanatory.
Feel free to use it or just ignore it ^^.
I rewrote this just for my usage cause "InvokeNative"...
It's not the point of using the SampGDK.
Kind regards
Sphinx