
21.04.2021, 16:41
|
|
Познавший АНТИЧАТ
Регистрация: 03.02.2015
Сообщений: 1,468
С нами:
5933080
Репутация:
183
|
|
Сообщение от PanSeek
SF. Как отлавливать, нажатие кнопок и какой пункт выбран?
C++:
Код:
#include
#include "main.h"
SAMPFUNCS
*
SF
=
new
SAMPFUNCS
(
)
;
bool
test
=
false
;
#define color_red "AA3333"
#define color_green "33AA33"
void
CALLBACK
hMenu
(
std
::
string param
)
{
char
outMenu
[
9
]
;
sprintf
(
outMenu
,
"{%s}test"
,
test
?
color_green
:
color_red
)
;
if
(
param
==
"1"
)
SF
->
getSAMP
(
)
->
getChat
(
)
->
AddChatMessage
(
-
1
,
"фаст выбор тест"
)
;
else
return
SF
->
getSAMP
(
)
->
getDialog
(
)
->
ShowDialog
(
8521
,
2
,
"Title test"
,
outMenu
,
"Выбрать"
,
"Закрыть"
)
;
}
;
void
__stdcall
mainloop
(
)
{
static
bool
initialized
=
false
;
if
(
!
initialized
)
{
if
(
GAME
&&
GAME
->
GetSystemState
(
)
==
eSystemState
::
GS_PLAYING_GAME
&&
SF
->
getSAMP
(
)
->
IsInitialized
(
)
)
{
SF
->
getSAMP
(
)
->
getChat
(
)
->
AddChatMessage
(
-
1
,
"Debug: {008000}SUCCESS"
)
;
SF
->
getSAMP
(
)
->
registerChatCommand
(
"cout"
,
hMenu
)
;
initialized
=
true
;
}
}
}
BOOL APIENTRY
DllMain
(
HMODULE hModule
,
DWORD dwReasonForCall
,
LPVOID lpReserved
)
{
if
(
dwReasonForCall
==
DLL_PROCESS_ATTACH
)
SF
->
initPlugin
(
mainloop
,
hModule
)
;
return
TRUE
;
}
ставить хук на диалог
|
|
|