Advertisement
Guest User

Untitled

a guest
Nov 19th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. #define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS
  2. #include <windows.h>
  3. #include <string>
  4. #include <assert.h>
  5. #include <process.h>
  6.  
  7. #include "SAMPFUNCS_API.h"
  8. #include "game_api\game_api.h"
  9.  
  10. #include "ini_file.h"
  11. SAMPFUNCS *SF = new SAMPFUNCS();
  12.  
  13. bool ActA;
  14. int a;
  15.  
  16. void ActAs()
  17. {
  18. if (ActA)
  19. {
  20. for (a = 0; a < SAMP_MAX_PLAYERS; a++)
  21. {
  22. if (SF->getSAMP()->getPlayers()->IsPlayerDefined(a))
  23. SF->getSAMP()->getChat()->AddChatMessage(-1, "найден игрок с идом: %d", a);
  24. }
  25. ActA = false;
  26. }
  27. }
  28.  
  29. void CALLBACK mainloop()
  30. {
  31. static bool init = false;
  32. if (!init)
  33. {
  34. if (GAME == nullptr)
  35. return;
  36. if (GAME->GetSystemState() != eSystemState::GS_PLAYING_GAME)
  37. return;
  38. if (!SF->getSAMP()->IsInitialized())
  39. return;
  40. init = true;
  41. }
  42. if (SF->getGame()->isKeyPressed(50))
  43. ActA = true;
  44. }
  45.  
  46. BOOL APIENTRY DllMain(HMODULE hModule, DWORD dwReasonForCall, LPVOID lpReserved)
  47. {
  48. switch (dwReasonForCall)
  49. {
  50. case DLL_PROCESS_ATTACH:
  51. SF->initPlugin(mainloop, hModule);
  52. break;
  53. case DLL_THREAD_ATTACH:
  54. case DLL_THREAD_DETACH:
  55. case DLL_PROCESS_DETACH:
  56. break;
  57. }
  58. return TRUE;
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement