#include "main.hpp"
LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg)
{
case WM_KEYUP:
{
switch (wParam)
{
case 0x31: {
*reinterpret_cast<unsigned __int16*>(0xC81320) += 1;
/*
sprintf(buffer, "weatherID: %d", *(unsigned __int16*)0xC81320);
printStringNow(buffer, 1000, NULL, false);
*/
break;
}
case 0x32: {
*reinterpret_cast<unsigned __int16*>(0xC81320) -= 1;
/*
sprintf(buffer, "weatherID: %d", *(unsigned __int16*)0xC81320);
printStringNow(buffer, 1000, NULL, false);
*/
break;
}
case 0x33: {
set_pos();
printStringNow("spawn", 1000, NULL, false);
}
}
}
}
return CallWindowProcA(WNDPROC(wHandle), hwnd, uMsg, wParam, lParam);
}
BOOL APIENTRY DllMain(HMODULE hModule, DWORD fdwReason, LPVOID lpReserved)
{
switch (fdwReason)
{
case DLL_PROCESS_ATTACH: {
DisableThreadLibraryCalls(hModule);
wHandle = SetWindowLongA(FindWindowA(NULL, "GTA:SA:MP"), GWL_WNDPROC, LONG(WindowProc));
break;
}
case DLL_PROCESS_DETACH: {
break;
}
}
return TRUE;
}