
16.08.2018, 20:57
|
|
Постоянный
Регистрация: 13.02.2016
Сообщений: 532
С нами:
5392682
Репутация:
93
|
|
Сообщение от Musaigen
после инита ImplDX9 надо.
При выходе с игры, допустим через /q, такая же ошибка!
|
|
|

19.08.2018, 20:53
|
|
Новичок
Регистрация: 21.11.2017
Сообщений: 8
С нами:
4461009
Репутация:
0
|
|
how i can make it 'button toggleing'?
|
|
|

19.08.2018, 21:03
|
|
Постоянный
Регистрация: 28.03.2013
Сообщений: 495
С нами:
6908018
Репутация:
213
|
|
|
|
|

20.08.2018, 00:23
|
|
Новичок
Регистрация: 04.09.2015
Сообщений: 16
С нами:
5626315
Репутация:
58
|
|
Сообщение от CleanLegend
При выходе не вызывается GameDestructor, нужно перехватывать отправку /q, либо в DLL_PROCESS_DETACH добавить деинициализацию imgui:
C++:
Код:
case
DLL_PROCESS_DETACH
:
ImGui_ImplDX9_Shutdown
(
)
;
ImGui_ImplWin32_Shutdown
(
)
;
ImGui
::
DestroyContext
(
)
;
Не помогло, всё равно та же ошибка при /q.
И ещё, что тут не так?
C++:
Код:
void
CALLBACK
cmd_debug_info
(
std
::
string param
)
{
int
*
resX
,
*
resY
;
SF
->
getGame
(
)
->
getScreenResolution
(
resX
,
resY
)
;
snprintf
(
messageBuffer
,
128
,
"ResX - %i, ResY - %i"
,
*
resX
,
*
resY
)
;
SF
->
getSAMP
(
)
->
getChat
(
)
->
AddChatMessage
(
-
1
,
messageBuffer
)
;
}
|
|
|

12.09.2018, 19:34
|
|
Флудер
Регистрация: 03.08.2016
Сообщений: 2,363
С нами:
5145387
Репутация:
183
|
|
Сообщение от CleanLegend
SF>getGame()>registerGameDestructorCallback(Plugin Free);
исправь
C++:
Код:
SF
->
getGame
(
)
->
registerGameDestructorCallback
(
PluginFree
)
;
|
|
|

12.09.2018, 19:42
|
|
Постоянный
Регистрация: 24.01.2016
Сообщений: 566
С нами:
5421300
Репутация:
83
|
|
Цельный проект есть у кого?
|
|
|

13.09.2018, 08:06
|
|
Постоянный
Регистрация: 13.02.2016
Сообщений: 532
С нами:
5392682
Репутация:
93
|
|
Сообщение от mrdiimax
Цельный проект есть у кого?
Уже так сложно подставить?
Код:
Код:
#define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS 1
#include
#include
#include
#include
#include "ImGUI\imgui.h"
#include "ImGUI\imgui_impl_dx9.h"
#include "ImGUI\imgui_impl_win32.h"
#include
#define DIRECTINPUT_VERSION 0x0800
#include
#include
extern LRESULT ImGui_ImplWin32_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
#include "SAMPFUNCS_API.h"
#include "game_api\game_api.h"
SAMPFUNCS *SF = new SAMPFUNCS();
bool CALLBACK Present(CONST RECT *pSourceRect, CONST RECT *pDestRect, HWND hDestWindowOverride, CONST RGNDATA *pDirtyRegion)
{
if (SUCCEEDED(SF->getRender()->BeginRender()))
{
ImGui_ImplDX9_NewFrame();
ImGui_ImplWin32_NewFrame();
ImGui::NewFrame();
if (activew)
{
ImGui::Begin("ImGui меню", &activew, ImVec2(305, 160), 0.8f, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoResize);
{
ImGui::Checkbox("Aimbot", &bAimbot);
ImGui::Checkbox("WH", &bAimbot);
ImGui::Checkbox("SpeedHack", &bAimbot);
ImGui::Checkbox("Что-то крутое", &bAimbot);
}
ImGui::End();
}
ImGui::EndFrame();
ImGui::Render();
ImGui_ImplDX9_RenderDrawData(ImGui::GetDrawData());
SF->getRender()->EndRender();
}
return true;
}
HRESULT CALLBACK Reset(D3DPRESENT_PARAMETERS* pPresentationParameters)
{
ImGui_ImplDX9_InvalidateDeviceObjects();
return true;
}
bool CALLBACK WndProcHandler(HWND hwd, UINT msg, WPARAM wParam, LPARAM lParam)
{
ImGui_ImplWin32_WndProcHandler(hwd, msg, wParam, lParam);
return true;
}
void CALLBACK PluginFree()
{
ImGui_ImplDX9_Shutdown();
ImGui_ImplWin32_Shutdown();
ImGui::DestroyContext();
}
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>getGame()>registerGameDestructorCallback(PluginFree);
SF->getRender()->registerD3DCallback(eDirect3DDeviceMethods::D3DMETHOD_PRESENT, Present);
SF->getRender()->registerD3DCallback(eDirect3DDeviceMethods::D3DMETHOD_RESET, Reset);
SF->getGame()->registerWndProcCallback(SFGame::MEDIUM_CB_PRIORITY, WndProcHandler);
ImGui::CreateContext();
ImGuiIO& io = ImGui::GetIO(); (void)io;
ImGui_ImplWin32_Init(GetActiveWindow());
ImGui_ImplDX9_Init(SF->getRender()->getD3DDevice());
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;
}
|
|
|
|
 |
|
|
Здесь присутствуют: 1 (пользователей: 0 , гостей: 1)
|
|
|
|