Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS
- #include <windows.h>
- #include <string>
- #include <assert.h>
- #include <process.h>
- #include "SAMPFUNCS_API.h"
- #include "game_api\game_api.h"
- #include "ini_file.h"
- SAMPFUNCS *SF = new SAMPFUNCS();
- bool ActA;
- int a;
- void ActAs()
- {
- if (ActA)
- {
- for (a = 0; a < SAMP_MAX_PLAYERS; a++)
- {
- if (SF->getSAMP()->getPlayers()->IsPlayerDefined(a))
- SF->getSAMP()->getChat()->AddChatMessage(-1, "найден игрок с идом: %d", a);
- }
- ActA = false;
- }
- }
- void CALLBACK mainloop()
- {
- static bool init = false;
- if (!init)
- {
- if (GAME == nullptr)
- return;
- if (GAME->GetSystemState() != eSystemState::GS_PLAYING_GAME)
- return;
- if (!SF->getSAMP()->IsInitialized())
- return;
- init = true;
- }
- if (SF->getGame()->isKeyPressed(50))
- ActA = true;
- }
- BOOL APIENTRY DllMain(HMODULE hModule, DWORD dwReasonForCall, LPVOID lpReserved)
- {
- switch (dwReasonForCall)
- {
- case DLL_PROCESS_ATTACH:
- SF->initPlugin(mainloop, hModule);
- break;
- case DLL_THREAD_ATTACH:
- case DLL_THREAD_DETACH:
- case DLL_PROCESS_DETACH:
- break;
- }
- return TRUE;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement