[SAMPGDK] Streamer Library (edited streamer plugin to be used with sampgdk)
#1

NOTE: All repositories moved from googlecode to Github: http://gpb.gz0.nl/
This is a edited version of the Streamer Plugin by Incognito, the streamer pawn-based natives are converted to C++ functions which can be called from SampGDK (not all natives are converted, like GetFloatData, you can add them )

So how do you use this?
First of all you need the Eigen and Boost libraries to compile this, if you don't have them, download them or download the original streamer plugin source code (2.6.1) which contains these libraries.

Then, you need to compile this project (on windows open the SLN and hit BUILD, on linux you need to tweak the makefile [because I didn't] to output a (static)library [.a] file, instead of a shared library).

After this include "streamerlib.h" from the package and link to the library you compiled.

Then you need to call the following functions at their respective call:

Code:
namespace StreamerCall
{
	bool Load();
	void Unload();
	void Tick(); 
	namespace Events
	{
		bool OnPlayerConnect(int playerid);
		bool OnPlayerDisconnect(int playerid, int reason);
		bool OnPlayerEditObject(int playerid, int playerobject, int objectid, int response, float x, float y, float z, float rx, float ry, float rz);
		bool OnPlayerSelectObject(int playerid, int type, int objectid, int modelid, float x, float y, float z);
		bool OnPlayerPickUpPickup(int playerid, int pickupid);
		bool OnPlayerEnterCheckpoint(int playerid);
		bool OnPlayerLeaveCheckpoint(int playerid);
		bool OnPlayerEnterRaceCheckpoint(int playerid);
		bool OnPlayerLeaveRaceCheckpoint(int playerid);
	};
};
(eg StreamerCall::Events::OnPlayerConnect in you sampgdk OnPlayerConnect callback, StreamerCall::Load() in you plugin Load call..)

NOTE: The Extensions Manager library automaticly calls all the functions already for you and creates the appropriate callbacks.

Then you must define all the callbacks which the streamer declares:

Code:
	bool OnPlayerEditDynamicObject(int playerid, int objectid, int response, float x, float y, float z, float rx, float ry, float rz);
	bool OnPlayerSelectDynamicObject(int playerid,int objectid,int modelid, float x, float y, float z);
	bool OnPlayerPickUpDynamicPickup(int playerid,int pickupid);
	bool OnPlayerEnterDynamicCP(int playerid,int checkpointid);
	bool OnPlayerLeaveDynamicCP(int playerid,int checkpointid);
	bool OnPlayerEnterDynamicRaceCP(int playerid,int checkpointid);
	bool OnPlayerLeaveDynamicRaceCP(int playerid,int checkpointid);
	bool OnPlayerEnterDynamicArea(int playerid, int areaid);
	bool OnPlayerLeaveDynamicArea(int playerid, int areaid);
	bool OnDynamicObjectMoved(int objectid);
And you are ready to use the library

Download: Click
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)