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.");
init = true;
}
}
bool APIENTRY DllMain(HMODULE hModule, DWORD dwReasonForCall, LPVOID lpReserved) {
switch (dwReasonForCall) {
case DLL_PROCESS_ATTACH:
SF->initPlugin(mainloop, hModule);
}
return true;
}