Advertisement
Guest User

Untitled

a guest
Dec 18th, 2014
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. #include <cstdio>
  2. #include <cstring>
  3.  
  4. #include <sampgdk/a_players.h>
  5. #include <sampgdk/a_samp.h>
  6. #include <sampgdk/core.h>
  7. #include <sampgdk/sdk.h>
  8.  
  9. extern void *pAMXFunctions;
  10.  
  11. void SAMPGDK_CALL PrintTickCountTimer(int timerid, void *params) {
  12. sampgdk::logprintf("Tick count: %d", GetTickCount());
  13. }
  14.  
  15. SAMPGDK_CALLBACK(bool, OnGameModeInit())
  16. {
  17. SetGameModeText("Hello, World!");
  18. AddPlayerClass(0, 1958.3783f, 1343.1572f, 15.3746f, 269.1425f, 0, 0, 0, 0, 0, 0);
  19. SetTimer(1000, true, PrintTickCountTimer, 0);
  20.  
  21. sampgdk::logprintf("sampgdk in ongamemodeinit!");
  22. return true;
  23. }
  24.  
  25. PLUGIN_EXPORT unsigned int PLUGIN_CALL Supports()
  26. {
  27. return sampgdk::Supports() | SUPPORTS_VERSION | SUPPORTS_AMX_NATIVES | SUPPORTS_PROCESS_TICK;
  28. }
  29.  
  30. PLUGIN_EXPORT bool PLUGIN_CALL Load(void **ppData)
  31. {
  32. pAMXFunctions = ppData[PLUGIN_DATA_AMX_EXPORTS];
  33. bool load = sampgdk::Load(ppData);
  34. sampgdk::logprintf("loading...........");
  35. return load;
  36. }
  37.  
  38. PLUGIN_EXPORT void PLUGIN_CALL Unload()
  39. {
  40. sampgdk::Unload();
  41. }
  42.  
  43. AMX_NATIVE_INFO natives[] =
  44. {
  45. // Settings
  46. { NULL, NULL }
  47. };
  48.  
  49. PLUGIN_EXPORT int PLUGIN_CALL AmxLoad(AMX *amx)
  50. {
  51. return amx_Register(amx, natives, -1);
  52. }
  53.  
  54. PLUGIN_EXPORT int PLUGIN_CALL AmxUnload(AMX *amx)
  55. {
  56. return AMX_ERR_NONE;
  57. }
  58.  
  59. PLUGIN_EXPORT void PLUGIN_CALL ProcessTick()
  60. {
  61. sampgdk::ProcessTick();
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement