samp.directory
← Scripts et bibliothèques

mateusware/samp-plugin-template

samp plugin template for VS (.sln)

Plugin★ 0mis à jour sept. 2026Pas de licenceC
Ouvrir sur GitHub

Ce dépôt n’a pas de fichier de licence. Il est public en lecture, mais cela ne donne pas à lui seul le droit de le réutiliser.

L’essayer dans le compilateur Pawn →

Ajoute ses fichiers include, avec les bibliothèques dont il dépend, au compilateur Pawn de ton navigateur, prêts à être inclus dans un script.

README.md

samp-plugin-template

samp plugin template for VS (.sln).

template.inc

This file is responsible for telling the server which functions were added using the include.


1. define

#if defined _𝙔𝙊𝙐𝙍𝙄𝙉𝘾𝙇𝙐𝘿𝙀_included
    #endinput
#endif
#define _𝙔𝙊𝙐𝙍𝙄𝙉𝘾𝙇𝙐𝘿𝙀_included

Well, this is just a definition, that is, as the name itself says, it's a DEFINITION. It doesn't add or subtract anything important from your code. However, its use may be useful in the future, since by clarifying to the compiler that your include is included, it's possible to know if it's present in the code or not.

Example:

#if !defined _TEMPLATE_PLUGIN_included
    #error To use "native HelloWorld()" you need to use "template.inc"
#endif

There are several ways to declare this; there is no standard. Let's use some examples of includes:

a_samp.inc
#if defined _samp_included
	#endinput
#endif
#define _samp_included
PawnPlus.inc
#if defined _inc_PawnPlus
#undef _inc_PawnPlus
#endif

#if defined _PawnPlus_included
#endinput
#endif
#define _PawnPlus_included

2. native

Native functions are provided by the SA-MP server itself or by external plugins. Native functions are provided by the SA-MP server itself or by external plugins. In other words: if you create a function for a plugin, you need to explain to the server that you wrote it and that the function exists... and you explain this to the server using:

main.inc

⚠️ Documentation for the "main.cpp" and "main.h" files

template.inc

native HelloWorld();

pluginplugin-samp-templatesa-mpsamp

Cette page est construite à partir de ce que GitHub publie sur le dépôt. samp.directory n’héberge pas le code. Signaler un problème avec cette fiche

mateusware/samp-plugin-template : Plugin SA-MP | samp.directory