24.12.2014, 17:04
Here is an example source code I've just made. It gives the same error:
http://s27.postimg.org/pkclb06iq/example_plugin.jpg
Using project settings:
SAMPGDK_AMALGAMATION is globally defined
.def file is defined
additional include directories defined
Код:
#include ".\SDK\plugin.h" #include ".\sampgdk\sampgdk.h" // extern void * pAMXFunctions; // typedef void (*logprintf_t)(char* format, ...); logprintf_t logprintf; cell AMX_NATIVE_CALL test(AMX * amx, cell * params){ char test[] = "test message"; SendClientMessage(params[1], 0xFFFFFFFF, test); return 0; } AMX_NATIVE_INFO PluginNatives[] = { {"test", test}, {0, 0} }; PLUGIN_EXPORT unsigned int PLUGIN_CALL Supports(){ return sampgdk::Supports() | SUPPORTS_VERSION | SUPPORTS_AMX_NATIVES | SUPPORTS_PROCESS_TICK; } PLUGIN_EXPORT bool PLUGIN_CALL Load(void **ppData){ pAMXFunctions = ppData[PLUGIN_DATA_AMX_EXPORTS]; logprintf = (logprintf_t)ppData[PLUGIN_DATA_LOGPRINTF]; return sampgdk::Load(ppData); } PLUGIN_EXPORT void PLUGIN_CALL Unload(){ sampgdk::Unload(); } PLUGIN_EXPORT int PLUGIN_CALL AmxLoad(AMX *amx){ return amx_Register(amx, PluginNatives, -1); } PLUGIN_EXPORT int PLUGIN_CALL AmxUnload(AMX *amx){ return AMX_ERR_NONE; } PLUGIN_EXPORT void PLUGIN_CALL ProcessTick(){ sampgdk::ProcessTick(); }
Using project settings:
SAMPGDK_AMALGAMATION is globally defined
.def file is defined
additional include directories defined