#define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS 1 #include "imgui.h" #include #define DIRECTINPUT_VERSION 0x0800 #include #include #define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS 1 #include #include #include #include #include "SAMPFUNCS_API.h" #include "game_api\game_api.h" SAMPFUNCS *SF = new SAMPFUNCS(); SAMPFUNCS *SF = new SAMPFUNCS(); void CALLBACK cmd_show_info_player(std::string param) { if (param.empty()) return; int i = std::stoi(param); char buf[128]; stRemotePlayer *pPlayer = SF->getSAMP()->getPlayers()->pRemotePlayer[i]; if (!pPlayer) return; sprintf(buf, "Nickname - %s, Ping - %d, Score - %d, isNPC - %d, AFKState - %d", pPlayer->szPlayerName, pPlayer->iPing, pPlayer->iScore, pPlayer->iIsNPC, pPlayer->pPlayerData->iAFKState == 2); SF->getSAMP()->getChat()->AddChatMessage(-1, buf); }; 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; SF->getSAMP()->getChat()->AddChatMessage(D3DCOLOR_XRGB(0, 0xAA, 0), "SAMPFUNCS Plugin loaded."); SF->getSAMP()->registerChatCommand("showinfo", cmd_show_info_player); init = 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; }