 |
|

10.09.2017, 17:44
|
|
Постоянный
Регистрация: 13.02.2016
Сообщений: 532
С нами:
5392682
Репутация:
93
|
|
Кто может подсказать как считывать строку с чата?
Если он допустим видит строку в чате нажмет на кнопку...
|
|
|

10.09.2017, 19:20
|
|
Познающий
Регистрация: 13.09.2015
Сообщений: 94
С нами:
5613466
Репутация:
68
|
|
Сообщение от Спойлер
C++:
Код:
if
(
params
->
packetId
==
RPC_ScrClientMessage
)
{
DWORD chatLen
,
color
;
char
text
[
144
]
;
params
->
bitStream
->
ResetReadPointer
(
)
;
params
->
bitStream
->
Read
(
color
)
;
params
->
bitStream
->
Read
(
chatLen
)
;
params
->
bitStream
->
Read
(
text
,
chatLen
)
;
text
[
chatLen
]
=
'\0'
;
// Тут действие с текстом
params
->
bitStream
->
ResetWritePointer
(
)
;
params
->
bitStream
->
Write
(
color
)
;
params
->
bitStream
->
Write
(
strlen
(
text
)
)
;
params
->
bitStream
->
Write
(
text
,
strlen
(
text
)
)
;
}
return
true
;
}
Сообщение от Спойлер
C++:
Код:
if
(
params
->
packetId
==
RPC_ScrClientMessage
)
{
DWORD chatLen
,
color
;
char
text
[
144
]
;
params
->
bitStream
->
ResetReadPointer
(
)
;
params
->
bitStream
->
Read
(
color
)
;
params
->
bitStream
->
Read
(
chatLen
)
;
params
->
bitStream
->
Read
(
text
,
chatLen
)
;
text
[
chatLen
]
=
'\0'
;
// Тут действие с текстом
}
return
true
;
}
Подробнее: tutorials - api_lesson_raknet | BlastHack — DEV_WIKI (https://blast.hk/wiki/tutorials:api_lesson_raknet)
|
|
|

10.09.2017, 19:40
|
|
Постоянный
Регистрация: 13.02.2016
Сообщений: 532
С нами:
5392682
Репутация:
93
|
|
Сообщение от Тополиный.Пух
Сообщение от Спойлер
C++:
Код:
if
(
params
->
packetId
==
RPC_ScrClientMessage
)
{
DWORD chatLen
,
color
;
char
text
[
144
]
;
params
->
bitStream
->
ResetReadPointer
(
)
;
params
->
bitStream
->
Read
(
color
)
;
params
->
bitStream
->
Read
(
chatLen
)
;
params
->
bitStream
->
Read
(
text
,
chatLen
)
;
text
[
chatLen
]
=
'\0'
;
// Тут действие с текстом
params
->
bitStream
->
ResetWritePointer
(
)
;
params
->
bitStream
->
Write
(
color
)
;
params
->
bitStream
->
Write
(
strlen
(
text
)
)
;
params
->
bitStream
->
Write
(
text
,
strlen
(
text
)
)
;
}
return
true
;
}
Сообщение от Спойлер
C++:
Код:
if
(
params
->
packetId
==
RPC_ScrClientMessage
)
{
DWORD chatLen
,
color
;
char
text
[
144
]
;
params
->
bitStream
->
ResetReadPointer
(
)
;
params
->
bitStream
->
Read
(
color
)
;
params
->
bitStream
->
Read
(
chatLen
)
;
params
->
bitStream
->
Read
(
text
,
chatLen
)
;
text
[
chatLen
]
=
'\0'
;
// Тут действие с текстом
}
return
true
;
}
Подробнее: tutorials - api_lesson_raknet | BlastHack — DEV_WIKI (https://blast.hk/wiki/tutorials:api_lesson_raknet)
И как допустим произвести действие нажатия клавиши F
Если он увидит допустим текст "Садись"
|
|
|

11.09.2017, 01:25
|
|
Участник форума
Регистрация: 13.03.2016
Сообщений: 242
С нами:
5351007
Репутация:
0
|
|
Сообщение от Bazzl
И как допустим произвести действие нажатия клавиши F
Если он увидит допустим текст "Садись"
C++:
Код:
bool
IsDigited
=
false
;
// в начале плагина
bool
__stdcall
Hook
(
stRakNetHookParams
*
hook
)
{
if
(
hook
->
packetId
==
RPC_ScrClientMessage
)
{
DWORD color
,
strLen
;
char
msg
[
256
]
;
hook
->
bitStream
->
ResetReadPointer
(
)
;
hook
->
bitStream
->
Read
(
color
)
;
hook
->
bitStream
->
Read
(
strLen
)
;
hook
->
bitStream
->
Read
(
msg
,
strLen
)
;
hook
->
bitStream
->
ResetReadPointer
(
)
;
char
*
ptr
=
strstr
(
msg
,
"Садись уебок"
)
;
if
(
ptr
!=
nullptr
)
IsDigited
=
true
;
}
}
void
__stdcall
mainloop
(
void
)
{
static
bool
init
=
false
;
if
(
!
init
)
{
if
(
GAME
==
nullptr
)
return
;
if
(
GAME
->
GetSystemState
(
)
!=
eSystemState
::
GS_PLAYING_GAME
)
return
;
if
(
!
SF
->
getSAMP
(
)
->
IsInitialized
(
)
)
return
;
SF
->
getRakNet
(
)
->
registerRakNetCallback
(
RakNetScriptHookType
::
RAKHOOK_TYPE_INCOMING_RPC
,
Hook
)
;
init
=
true
;
}
else
{
if
(
SF
->
getGame
(
)
->
isKeyPressed
(
70
)
&&
isDigited
)
{
isDigited
=
false
;
// действие
}
}
}
Воздержись от удовольствия выразить свою благодарность.
|
|
|

11.09.2017, 09:39
|
|
Познавший АНТИЧАТ
Регистрация: 09.03.2013
Сообщений: 1,262
С нами:
6935116
Репутация:
183
|
|
Сообщение от Destructor
C++:
Код:
bool
IsDigited
=
false
;
// в начале плагина
bool
__stdcall
Hook
(
stRakNetHookParams
*
hook
)
{
if
(
hook
->
packetId
==
RPC_ScrClientMessage
)
{
DWORD color
,
strLen
;
char
msg
[
256
]
;
hook
->
bitStream
->
ResetReadPointer
(
)
;
hook
->
bitStream
->
Read
(
color
)
;
hook
->
bitStream
->
Read
(
strLen
)
;
hook
->
bitStream
->
Read
(
msg
,
strLen
)
;
hook
->
bitStream
->
ResetReadPointer
(
)
;
char
*
ptr
=
strstr
(
msg
,
"Садись уебок"
)
;
if
(
ptr
!=
nullptr
)
IsDigited
=
true
;
}
}
void
__stdcall
mainloop
(
void
)
{
static
bool
init
=
false
;
if
(
!
init
)
{
if
(
GAME
==
nullptr
)
return
;
if
(
GAME
->
GetSystemState
(
)
!=
eSystemState
::
GS_PLAYING_GAME
)
return
;
if
(
!
SF
->
getSAMP
(
)
->
IsInitialized
(
)
)
return
;
SF
->
getRakNet
(
)
->
registerRakNetCallback
(
RakNetScriptHookType
::
RAKHOOK_TYPE_INCOMING_RPC
,
Hook
)
;
init
=
true
;
}
else
{
if
(
SF
->
getGame
(
)
->
isKeyPressed
(
70
)
&&
isDigited
)
{
isDigited
=
false
;
// действие
}
}
}
Воздержись от удовольствия выразить свою благодарность.
для чего там
C++:
Код:
SF
->
getGame
(
)
->
isKeyPressed
(
70
)
?
|
|
|

11.09.2017, 11:49
|
|
Постоянный
Регистрация: 13.02.2016
Сообщений: 532
С нами:
5392682
Репутация:
93
|
|
upload_2017-9-11_11-48-47.pngRevalto · 11 Сен 2017 в 10:49' data-fancybox="lb-post-159065" data-lb-caption-extra-html="" data-lb-sidebar-href="" data-single-image="1" data-src="https://www.blast.hk/attachments/8965/" style="cursor: pointer;" title="upload_2017-9-11_11-48-47.png">
Вылазит такая ошибка...
|
|
|

11.09.2017, 15:26
|
|
Постоянный
Регистрация: 13.02.2017
Сообщений: 622
С нами:
4865730
Репутация:
163
|
|
Сообщение от Bazzl
Вылазит такая ошибка...
C++ регистрозависимый язык, объявлено IsDigited, а проверяется isDigited
|
|
|

11.09.2017, 15:48
|
|
Постоянный
Регистрация: 13.02.2016
Сообщений: 532
С нами:
5392682
Репутация:
93
|
|
Сообщение от asdzxcjqwe
C++ регистрозависимый язык, объявлено IsDigited, а проверяется isDigited
Не подскажешь где можно посмотреть ID всех клавишь на C++ ?
|
|
|

11.09.2017, 17:24
|
|
Постоянный
Регистрация: 13.02.2017
Сообщений: 622
С нами:
4865730
Репутация:
163
|
|
|
|
|

11.09.2017, 19:26
|
|
Участник форума
Регистрация: 13.03.2016
Сообщений: 242
С нами:
5351007
Репутация:
0
|
|
Сообщение от MISTER_GONWIK
для чего там
C++:
Код:
SF
->
getGame
(
)
->
isKeyPressed
(
70
)
?
Он просил чтобы срабатывало по нажатию кнопки F
|
|
|
|
 |
|
|
Здесь присутствуют: 1 (пользователей: 0 , гостей: 1)
|
|
|
|