Показать сообщение отдельно

  #8  
Старый 28.12.2018, 22:56
Cake_
Участник форума
Регистрация: 04.04.2017
Сообщений: 263
С нами: 4793630

Репутация: 133
По умолчанию

upload_2018-12-28_19-52-15.pngCake_ · 28 Дек 2018 в 21:56' data-fancybox="lb-post-284009" data-lb-caption-extra-html="" data-lb-sidebar-href="" data-single-image="1" data-src="https://www.blast.hk/attachments/23143/" style="cursor: pointer;" title="upload_2018-12-28_19-52-15.png">


В чём ошибка?

C++:





Код:
#define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS 1
#include 
#include 
#include 
#include 
#include "SAMPFUNCS_API.h"
#include "game_api\game_api.h"
#include "imgui.h"
#include "imgui_impl_dx9.h"
#include "imgui_impl_win32.h"
#include 
#define DIRECTINPUT_VERSION 0x0800
#include 
#include 
extern
LRESULT
ImGui_ImplWin32_WndProcHandler
(
HWND hWnd
,
UINT msg
,
WPARAM wParam
,
LPARAM lParam
)
;
SAMPFUNCS
*
SF
=
new
SAMPFUNCS
(
)
;
bool
CALLBACK
Present
(
CONST RECT
*
pSourceRect
,
CONST RECT
*
pDestRect
,
HWND hDestWindowOverride
,
CONST RGNDATA
*
pDirtyRegion
)
{
bool
activew
=
true
;
if
(
SUCCEEDED
(
SF
->
getRender
(
)
->
BeginRender
(
)
)
)
{
if
(
activew
)
{
ImGui_ImplDX9_NewFrame
(
)
;
ImGui_ImplWin32_NewFrame
(
)
;
ImGui
::
NewFrame
(
)
;
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
)
{
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
;
ImGui
::
CreateContext
(
)
;
ImGuiIO
&
io
=
ImGui
::
GetIO
(
)
;
(
void
)
io
;
ImGui_ImplWin32_Init
(
GetActiveWindow
(
)
)
;
ImGui_ImplDX9_Init
(
SF
->
getRender
(
)
->
getD3DDevice
(
)
)
;
SF
->
getSAMP
(
)
->
getChat
(
)
->
AddChatMessage
(
D3DCOLOR_XRGB
(
0
,
0xAA
,
0
)
,
"SAMPFUNCS Plugin loaded."
)
;
SF
->
getRender
(
)
->
registerD3DCallback
(
eDirect3DDeviceMethods
::
D3DMETHOD_PRESENT
,
Present
)
;
SF
->
getRender
(
)
->
registerD3DCallback
(
eDirect3DDeviceMethods
::
D3DMETHOD_RESET
,
Reset
)
;
SF
->
getGame
(
)
->
registerWndProcCallback
(
SFGame
::
MEDIUM_CB_PRIORITY
,
WndProcHandler
)
;
SF
->
getGame
(
)
->
registerGameDestructorCallback
(
PluginFree
)
;
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
;
}
LRESULT
ImGui_ImplWin32_WndProcHandler
(
HWND hWnd
,
UINT msg
,
WPARAM wParam
,
LPARAM lParam
)
{
return
LRESULT
(
)
;
}
 
Ответить с цитированием