Skip to content
samp-incognito edited this page Apr 13, 2021 · 63 revisions

Language: English, Russian

Reference

Instructions

  • Create a directory called plugins inside of the server directory if one does not already exist.
  • Place the plugin file (streamer.dll or streamer.so) inside of the directory that was just created.
  • Add the following line to server.cfg so that the plugin will load the next time the server starts:
    • plugins streamer.dll (Windows)
    • plugins streamer.so (Linux)
  • On Windows, add streamer.inc to the pawno\include folder.
  • Add the following line to any of the scripts the server is running:
    • #include <streamer>

The Windows version requires the Microsoft Visual C++ 2015 Redistributable Package (x86).

Compilation

Initial Setup

  • Download and install the following:
    • CMake (3.0+)
    • C++ Compiler
  • Optionally, download and install the following (or, as explained below, download the latest versions automatically from GitHub):
  • Clone the repository:
    git clone https://github.com/samp-incognito/samp-streamer-plugin.git
    
  • Navigate to the cloned respository (cd samp-streamer-plugin).
  • Update the submodules:
    git submodule update --init --recursive
    
    • Note that Boost will take quite a while to initially download. If Boost is already installed elsewhere, this process can be skipped by entering the following command instead:
      git submodule update --init --recursive . ":(exclude)lib/boost"
      
  • Proceed to build the Boost.System library if Boost is not already installed somewhere else. Otherwise, skip the next section.

Boost Installation

  • Navigate to the Boost directory (cd lib/boost).
  • Enter ./bootstrap.sh if on Linux, or bootstrap if on Windows, to prepare the Boost.Build system.
  • Enter ./b2 --with-system if on Linux, or b2 --with-system if on Windows, to build the Boost.System library.
  • Navigate back to the repository (cd ../..) when done.

For more information, read the Getting Started guide on the Boost website.

Plugin Compilation

  • Enter the following commands:
    mkdir build && cd build
    
    If on Windows:
    cmake ..
    cmake --build . --config Release --target streamer_unity
    
    If on Linux:
    cmake .. -DCMAKE_BUILD_TYPE=Release
    make streamer_unity
    
    • Note that CMake will attempt to find Boost and Eigen automatically. If one or both cannot be located, then the correct path(s) will need to be specified manually by passing the BOOST_ROOT and/or EIGEN3_INCLUDE_DIR option(s) to CMake prior to building. For example, entering this command (rather than just cmake ..) would provide both of these paths to CMake:
      cmake .. -DBOOST_ROOT=/path/to/boost -DEIGEN3_INCLUDE_DIR=/path/to/eigen
      
  • Navigate to the bin directory (cd bin). The streamer.dll or streamer.so file should be placed here when the plugin has finished compiling.

sampgdk Support

samp-streamer-plugin-sampgdk-invoke can be used to invoke this plugin's natives as well as hook its callbacks from within another plugin that uses sampgdk.