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

  #8  
Старый 05.07.2018, 02:27
Dark_Knight
Флудер
Регистрация: 18.03.2013
Сообщений: 4,080
С нами: 6921957

Репутация: 183


По умолчанию

Цитата:
Сообщение от Sasiko1  

Хочу выводить квадрат по команде, но чёт делаю не правильное укажите на ошибки))
C++:





Код:
#include 
#include 
#include 
#include 
#include "SAMPFUNCS_API.h"
#include "game_api\game_api.h"
SAMPFUNCS
*
SF
=
new
SAMPFUNCS
(
)
;
bool
render
=
false
;
bool
CALLBACK
Present
(
CONST RECT
*
pSourceRect
,
CONST RECT
*
pDestRect
,
HWND hDestWindowOverride
,
CONST RGNDATA
*
pDirtyRegion
)
{
if
(
SUCCEEDED
(
SF
->
getRender
(
)
->
BeginRender
(
)
)
&&
render
)
{
SF
->
getRender
(
)
->
DrawBox
(
500
,
500
,
25
,
25
,
D3DCOLOR_ARGB
(
255
,
0
,
255
,
0
)
)
;
SF
->
getRender
(
)
->
EndRender
(
)
;
}
;
return
true
;
}
;
void
CALLBACK
cmd_show_info_player
(
std
::
string param
)
{
render
=
!
render
;
}
;
void
CALLBACK
mainloop
(
)
{
static
bool
init
=
false
;
if
(
!
init
)
{
if
(
!
GAME
)
return
;
if
(
GAME
->
GetSystemState
(
)
!=
eSystemState
::
GS_PLAYING_GAME
)
return
;
if
(
!
SF
->
getSAMP
(
)
->
IsInitialized
(
)
)
return
;
SF
->
getRender
(
)
->
registerD3DCallback
(
eDirect3DDeviceMethods
::
D3DMETHOD_PRESENT
,
Present
)
;
SF
->
getSAMP
(
)
->
registerChatCommand
(
"ren"
,
cmd_show_info_player
)
;
}
}
BOOL APIENTRY
DllMain
(
HMODULE hModule
,
DWORD dwReasonForCall
,
LPVOID lpReserved
)
{
switch
(
dwReasonForCall
)
{
case
DLL_PROCESS_ATTACH
:
SF
->
initPlugin
(
mainloop
,
hModule
)
;
break
;
}
return
TRUE
;
}
 
Ответить с цитированием