samp.directory
← Скрипты и библиотеки

mateusware/samp-plugin-template

samp plugin template for VS (.sln)

Плагин★ 0обновлён сент. 2026 г.Без лицензииC
Открыть на GitHub

В этом репозитории нет файла лицензии. Код открыт для чтения, но само по себе это не даёт права использовать его.

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

Страница собрана из того, что GitHub публикует о репозитории. samp.directory не хранит этот код. Сообщить о проблеме с этой записью