YashasSamaga

SAMPGDK Plugin Sample

May 12th, 2015
566
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.34 KB | None | 0 0
  1. #define PLUGIN_VERSION "1.0"
  2. #define PLUGIN_AUTHOR "Your Name"
  3.  
  4. extern void *pAMXFunctions;
  5. /**********************************************************************************************************************************/
  6. PLUGIN_EXPORT unsigned int PLUGIN_CALL Supports()
  7. {
  8.     return sampgdk::Supports() | SUPPORTS_VERSION | SUPPORTS_AMX_NATIVES | SUPPORTS_PROCESS_TICK;
  9. }
  10.  
  11. PLUGIN_EXPORT bool PLUGIN_CALL Load(void **ppData)
  12. {
  13.     pAMXFunctions = ppData[PLUGIN_DATA_AMX_EXPORTS];
  14.     sampgdk::logprintf("\n\n* [Your Plugin Name] %s by %s Loaded",PLUGIN_VERSION,PLUGIN_AUTHOR);   
  15.     return sampgdk::Load(ppData);
  16. }
  17. PLUGIN_EXPORT void PLUGIN_CALL Unload()
  18. {  
  19.     sampgdk::logprintf("\n\n* [Your Plugin Name] %s by %s Unloaded",PLUGIN_VERSION,PLUGIN_AUTHOR);
  20.     sampgdk::Unload();
  21. }
  22. /**********************************************************************************************************************************/
  23. PLUGIN_EXPORT void PLUGIN_CALL ProcessTick()
  24. {
  25.     sampgdk::ProcessTick();
  26. }
  27. /**********************************************************************************************************************************/
  28. AMX_NATIVE_INFO PluginNatives[] =
  29. {
  30.     {0, 0}
  31. };
  32. PLUGIN_EXPORT int PLUGIN_CALL AmxLoad( AMX *amx )
  33. {
  34.     return amx_Register(amx, PluginNatives, -1);
  35. }
  36. PLUGIN_EXPORT int PLUGIN_CALL AmxUnload( AMX *amx )
  37. {
  38.     return AMX_ERR_NONE;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment