25.11.2015, 17:57
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.
And then call it.
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
And this functions aren't called, instead OnPlayerEditObject is called. If I edit an object.
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.
Код:
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
Код:
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; }