- 1,400
- 749
Описание: Отображает, сколько стамины ( быстрый бег ) осталось у вашего персонажа.
Код:
C++:
#include "main.h"
int get_screen_resolution();
int GetSprintLevel();
bool CALLBACK Present(CONST RECT* pSourceRect, CONST RECT* pDestRect, HWND hDestWindowOverride, CONST RGNDATA* pDirtyRegion)
{
if (SUCCEEDED(SF->getRender()->BeginRender()))
{
int x, y = get_screen_resolution();
SF->getRender()->DrawBox(x - 15, y - 18, 104, 15, D3DCOLOR_ARGB(255, 255, 255, 255));
SF->getRender()->DrawBox(x - 13, y - 18, (340 / 175) * GetSprintLevel(), 15, D3DCOLOR_ARGB(255, 88, 156, 204));
SF->getRender()->EndRender();
};
return true;
};
void __stdcall mainloop()
{
static bool initialized = false;
if (!initialized)
{
if (GAME && GAME->GetSystemState() == eSystemState::GS_PLAYING_GAME && SF->getSAMP()->IsInitialized())
{
initialized = true;
SF->getRender()->registerD3DCallback(eDirect3DDeviceMethods::D3DMETHOD_PRESENT, Present);
}
}
}
BOOL APIENTRY DllMain(HMODULE hModule, DWORD dwReasonForCall, LPVOID lpReserved)
{
if (dwReasonForCall == DLL_PROCESS_ATTACH)
SF->initPlugin(mainloop, hModule);
return TRUE;
}
Вложения
Последнее редактирование: