All Projects → katursis → samp-ptl

katursis / samp-ptl

Licence: MIT license
SA:MP Plugin Template Library (C++17)

Programming Languages

C++
36643 projects - #6 most used programming language
c
50402 projects - #5 most used programming language
CMake
9771 projects

Projects that are alternatives of or similar to samp-ptl

protection
Flexible server protection system (development)
Stars: ✭ 23 (+43.75%)
Mutual labels:  sa-mp, samp
amx assembly
Interesting #emit stuff
Stars: ✭ 49 (+206.25%)
Mutual labels:  sa-mp, amx
gta-samp-mouse-only
Play GTA San Andreas Multiplayer with mouse only and no keyboard
Stars: ✭ 22 (+37.5%)
Mutual labels:  sa-mp, samp
code-parse.inc
Pre-processor macros for analysing PAWN functions.
Stars: ✭ 23 (+43.75%)
Mutual labels:  sa-mp, samp
PacPaw
Pawn package manager for SA-MP
Stars: ✭ 14 (-12.5%)
Mutual labels:  sa-mp, samp
Pawn.CMD
🚀 Plugin-powered command processor for SA:MP server
Stars: ✭ 80 (+400%)
Mutual labels:  sa-mp, samp
samp-foreach
foreach standalone include (non y_iterate version)
Stars: ✭ 20 (+25%)
Mutual labels:  sa-mp, samp
samp-plugin-jit
JIT plugin for SA-MP server (JIT compiler for Pawn 3.2)
Stars: ✭ 52 (+225%)
Mutual labels:  sa-mp, amx
Open-GTO
RPG gamemode for SA-MP
Stars: ✭ 45 (+181.25%)
Mutual labels:  sa-mp, samp
GWRP-0.3
Игровой режим для San Andreas Multiplayer
Stars: ✭ 22 (+37.5%)
Mutual labels:  sa-mp, samp
SS-Gang-System-SQLITE
SS Gang System for SA-MP
Stars: ✭ 23 (+43.75%)
Mutual labels:  sa-mp, samp
samp-node-lib
NodeJS library for Scripting San Andreas Multiplayer:SAMP depends on samp-node plugin
Stars: ✭ 23 (+43.75%)
Mutual labels:  sa-mp, samp
Pawn.Regex
🔎 Plugin that adds support for regular expressions in Pawn
Stars: ✭ 34 (+112.5%)
Mutual labels:  sa-mp, samp
samp-rs
SA:MP SDK written in Rust
Stars: ✭ 36 (+125%)
Mutual labels:  samp, amx
eSelection
Dynamic model selection library for SA-MP servers
Stars: ✭ 28 (+75%)
Mutual labels:  sa-mp, samp
samp-discord-plugin
SA:MP Discord Rich Presence plugin
Stars: ✭ 63 (+293.75%)
Mutual labels:  sa-mp, samp
rustext
Fix Russian text plugin for SA-MP: GameText's, TextDraw's and Menu's
Stars: ✭ 15 (-6.25%)
Mutual labels:  sa-mp, samp
cppcombinator
parser combinator and AST generator in c++17
Stars: ✭ 20 (+25%)
Mutual labels:  cpp17-library
godothub
Multiplayer and network messaging for Godot.
Stars: ✭ 19 (+18.75%)
Mutual labels:  server-side
pawn-stdlib
The Pawn Standard Library Package, not including any files related to SA:MP - designed for the sampctl package management system.
Stars: ✭ 13 (-18.75%)
Mutual labels:  sa-mp

SA:MP Plugin Template Library

C++17 template library that allows you to create your own plugins for SA:MP server very easy and fast

Main features

  • Safe C++ AMX API with errors handling
  • Queue of AMX scripts (gamemode at the end)
  • Easy executing the callbacks (publics) with optional caching
  • Easy registration of natives: auto-conversion parameters from cell type to common C++ types. You may also define your own conversions by extending Script::NativeParam struct
  • Logging
  • Optional checking for a version match between the plugin and scripts

Example

#include "samp-ptl/ptl.h"

class Script : public ptl::AbstractScript<Script> {
 public:
  // native ExampleNative(int_number, Float:float_number, &ref, const text[]);
  cell n_ExampleNative(int int_number, float float_number, cell *ref,
                       std::string text) {
    Log("int_number = %d, float_number = %.2f, text = '%s'", int_number,
        float_number, text.c_str());

    *ref = 23;

    return 1;
  }
};

class Plugin : public ptl::AbstractPlugin<Plugin, Script> {
 public:
  const char *Name() { return "samp-example-plugin"; }

  bool OnLoad() {
    RegisterNative<&Script::n_ExampleNative>("ExampleNative");

    Log("plugin loaded");

    return true;
  }
};

PLUGIN_EXPORT unsigned int PLUGIN_CALL Supports() {
  return SUPPORTS_VERSION | SUPPORTS_AMX_NATIVES;
}

PLUGIN_EXPORT bool PLUGIN_CALL Load(void **ppData) {
  return Plugin::DoLoad(ppData);
}

PLUGIN_EXPORT void PLUGIN_CALL Unload() {
  Plugin::DoUnload();
}

PLUGIN_EXPORT void PLUGIN_CALL AmxLoad(AMX *amx) {
  Plugin::DoAmxLoad(amx);
}

PLUGIN_EXPORT void PLUGIN_CALL AmxUnload(AMX *amx) {
  Plugin::DoAmxUnload(amx);
}

More examples

Simple plugin

Pawn.RakNet

Pawn.CMD

Pawn.Regex

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].