
07.08.2024, 07:57
|
|
Участник форума
Регистрация: 27.05.2021
Сообщений: 140
С нами:
2614229
Репутация:
33
|
|
Почему крючок не работает?
C++:
[CODE]
#include
#include
#include
#include
using
CTimer__UpdateSignature
=
void
(
__cdecl
*
)
(
)
;
using
WndProcSignature
=
HRESULT
(
__stdcall
*
)
(
HWND
,
UINT
,
WPARAM
,
LPARAM
)
;
using
InitGameInstance
=
HWND
(
__cdecl
*
)
(
HINSTANCE
)
;
kthook
::
kthook_simple
CTimerHook
{
}
;
kthook
::
kthook_signal
hookGameInstanceInit
{
0x745560
}
;
kthook
::
kthook_simple
WndProcHook
{
}
;
HWND gameHwnd
=
[
]
(
)
{
HWND
*
pHwnd
=
*
reinterpret_cast
(
0xC17054
)
;
if
(
pHwnd
!=
nullptr
)
{
return
*
pHwnd
;
}
else
{
hookGameInstanceInit
.
after
+=
[
]
(
const
auto
&
hook
,
HWND
&
returnValue
,
HINSTANCE inst
)
{
gameHwnd
=
returnValue
;
}
;
return
HWND
(
0
)
;
}
}
(
)
;
HRESULT
hWndProc
(
const
decltype
(
WndProcHook
)
&
hook
,
HWND hwnd
,
UINT uMsg
,
WPARAM wParam
,
LPARAM lParam
)
{
std
::
cout
|
|
|

07.08.2024, 09:31
|
|
Флудер
Регистрация: 02.02.2019
Сообщений: 5,070
С нами:
3831395
Репутация:
183
|
|
[QUOTE="!Sam#0235"]
Почему крючок не работает?
C++:
[CODE]
#include
#include
#include
#include
using
CTimer__UpdateSignature
=
void
(
__cdecl
*
)
(
)
;
using
WndProcSignature
=
HRESULT
(
__stdcall
*
)
(
HWND
,
UINT
,
WPARAM
,
LPARAM
)
;
using
InitGameInstance
=
HWND
(
__cdecl
*
)
(
HINSTANCE
)
;
kthook
::
kthook_simple
CTimerHook
{
}
;
kthook
::
kthook_signal
hookGameInstanceInit
{
0x745560
}
;
kthook
::
kthook_simple
WndProcHook
{
}
;
HWND gameHwnd
=
[
]
(
)
{
HWND
*
pHwnd
=
*
reinterpret_cast
(
0xC17054
)
;
if
(
pHwnd
!=
nullptr
)
{
return
*
pHwnd
;
}
else
{
hookGameInstanceInit
.
after
+=
[
]
(
const
auto
&
hook
,
HWND
&
returnValue
,
HINSTANCE inst
)
{
gameHwnd
=
returnValue
;
}
;
return
HWND
(
0
)
;
}
}
(
)
;
HRESULT
hWndProc
(
const
decltype
(
WndProcHook
)
&
hook
,
HWND hwnd
,
UINT uMsg
,
WPARAM wParam
,
LPARAM lParam
)
{
std
::
cout
|
|
|

07.08.2024, 10:02
|
|
Участник форума
Регистрация: 27.05.2021
Сообщений: 140
С нами:
2614229
Репутация:
33
|
|
Сообщение от ARMOR
Где установка хука CTimer::Update?
C++:
Код:
BOOL APIENTRY
DllMain
(
HMODULE hModule
,
DWORD ul_reason_for_call
,
LPVOID lpReserved
)
{
switch
(
ul_reason_for_call
)
{
case
DLL_PROCESS_ATTACH
:
CTimerHook
.
set_dest
(
0x561B10
)
;
CTimerHook
.
set_cb
(
&
CTimer__Update
)
;
CTimerHook
.
install
(
)
;
break
;
case
DLL_PROCESS_DETACH
:
break
;
}
return
TRUE
;
}
|
|
|

10.08.2024, 22:36
|
|
Новичок
Регистрация: 31.07.2022
Сообщений: 7
С нами:
1994625
Репутация:
1
|
|
Как установить усталость игроку?
Т.е., установить stamina (выносливость) для игрока, у которого запущен данных SF скрипт.
И вопрос, при установке его скорость бега будет видна только ему, или всем игрокам? (быстро бежит/уставший)
Пробовал и через SF->getCleo->opcode, и через reinterpret_cast(0xB7CD84) = 0, и никак =(
если можно реализовать как то без участия SampFuncs, то, подтолкните в нужную сторону, пожалуйста
однако, установка усталости должна идти через мод (т.е. я передаю через ракнет пакет с пользовательской переменной Pawn, а на ее основе устанавливается стамина)
|
|
|

13.08.2024, 19:53
|
|
Участник форума
Регистрация: 27.05.2021
Сообщений: 140
С нами:
2614229
Репутация:
33
|
|
Is there a way to get the string from a textdraw in a loop using RakHook?
Есть ли способ получить строку из зацикленного текстового рисунка с помощью RakHook?
This only works the first time the textdraw is displayed, using while will cause the game to freeze.
Это работает только при первом отображении textdraw, использование while приведет к зависанию игры.
C++:
[CODE]
bool
PluginRPC
::
onShowTextDraw
(
unsigned
char
&
id
,
RakNet
::
BitStream
*
bs
)
{
if
(
id
!=
134
)
{
return
true
;
}
uint16_t
wTextDrawID
;
uint8_t
Flags
;
float
fLetterWidth
;
float
fLetterHeight
;
uint32_t
dLetterColor
;
float
fLineWidth
;
float
fLineHeight
;
uint32_t
dBoxColor
;
uint8_t
Shadow
;
uint8_t
Outline
;
uint32_t
dBackgroundColor
;
uint8_t
Style
;
uint8_t
Selectable
;
float
fX
;
float
fY
;
uint16_t
wModelID
;
float
fRotX
;
float
fRotY
;
float
fRotZ
;
float
fZoom
;
int16_t
wColor1
;
int16_t
wColor2
;
uint16_t
szTextLen
;
std
::
string szText
;
bs
->
Read
(
wTextDrawID
)
;
bs
->
Read
(
Flags
)
;
bs
->
Read
(
fLetterWidth
)
;
bs
->
Read
(
fLetterHeight
)
;
bs
->
Read
(
dLetterColor
)
;
bs
->
Read
(
fLineWidth
)
;
bs
->
Read
(
fLineHeight
)
;
bs
->
Read
(
dBoxColor
)
;
bs
->
Read
(
Shadow
)
;
bs
->
Read
(
Outline
)
;
bs
->
Read
(
dBackgroundColor
)
;
bs
->
Read
(
Style
)
;
bs
->
Read
(
Selectable
)
;
bs
->
Read
(
fX
)
;
bs
->
Read
(
fY
)
;
bs
->
Read
(
wModelID
)
;
bs
->
Read
(
fRotX
)
;
bs
->
Read
(
fRotY
)
;
bs
->
Read
(
fRotZ
)
;
bs
->
Read
(
fZoom
)
;
bs
->
Read
(
wColor1
)
;
bs
->
Read
(
wColor2
)
;
bs
->
Read
(
szTextLen
)
;
szText
.
resize
(
szTextLen
)
;
bs
->
Read
(
szText
.
data
(
)
,
szTextLen
)
;
if
(
wTextDrawID
==
2053
)
{
std
::
string gasolina
=
szText
;
std
::
string gasolinaValue
=
gasolina
;
size_t startPos
=
gasolina
.
find
(
"{"
)
;
size_t endPos
=
gasolina
.
find
(
"}"
)
;
if
(
startPos
!=
std
::
string
::
npos
&&
endPos
!=
std
::
string
::
npos
)
{
gasolinaValue
=
gasolina
.
substr
(
startPos
+
1
,
endPos
-
startPos
-
1
)
;
}
std
::
cout
|
|
|

14.08.2024, 01:31
|
|
Постоянный
Регистрация: 05.08.2018
Сообщений: 372
С нами:
4091290
Репутация:
213
|
|
[QUOTE="!Sam#0235"]
Is there a way to get the string from a textdraw in a loop using RakHook?
Есть ли способ получить строку из зацикленного текстового рисунка с помощью RakHook?
This only works the first time the textdraw is displayed, using while will cause the game to freeze.
Это работает только при первом отображении textdraw, использование while приведет к зависанию игры.
C++:
[CODE]
bool
PluginRPC
::
onShowTextDraw
(
unsigned
char
&
id
,
RakNet
::
BitStream
*
bs
)
{
if
(
id
!=
134
)
{
return
true
;
}
uint16_t
wTextDrawID
;
uint8_t
Flags
;
float
fLetterWidth
;
float
fLetterHeight
;
uint32_t
dLetterColor
;
float
fLineWidth
;
float
fLineHeight
;
uint32_t
dBoxColor
;
uint8_t
Shadow
;
uint8_t
Outline
;
uint32_t
dBackgroundColor
;
uint8_t
Style
;
uint8_t
Selectable
;
float
fX
;
float
fY
;
uint16_t
wModelID
;
float
fRotX
;
float
fRotY
;
float
fRotZ
;
float
fZoom
;
int16_t
wColor1
;
int16_t
wColor2
;
uint16_t
szTextLen
;
std
::
string szText
;
bs
->
Read
(
wTextDrawID
)
;
bs
->
Read
(
Flags
)
;
bs
->
Read
(
fLetterWidth
)
;
bs
->
Read
(
fLetterHeight
)
;
bs
->
Read
(
dLetterColor
)
;
bs
->
Read
(
fLineWidth
)
;
bs
->
Read
(
fLineHeight
)
;
bs
->
Read
(
dBoxColor
)
;
bs
->
Read
(
Shadow
)
;
bs
->
Read
(
Outline
)
;
bs
->
Read
(
dBackgroundColor
)
;
bs
->
Read
(
Style
)
;
bs
->
Read
(
Selectable
)
;
bs
->
Read
(
fX
)
;
bs
->
Read
(
fY
)
;
bs
->
Read
(
wModelID
)
;
bs
->
Read
(
fRotX
)
;
bs
->
Read
(
fRotY
)
;
bs
->
Read
(
fRotZ
)
;
bs
->
Read
(
fZoom
)
;
bs
->
Read
(
wColor1
)
;
bs
->
Read
(
wColor2
)
;
bs
->
Read
(
szTextLen
)
;
szText
.
resize
(
szTextLen
)
;
bs
->
Read
(
szText
.
data
(
)
,
szTextLen
)
;
if
(
wTextDrawID
==
2053
)
{
std
::
string gasolina
=
szText
;
std
::
string gasolinaValue
=
gasolina
;
size_t startPos
=
gasolina
.
find
(
"{"
)
;
size_t endPos
=
gasolina
.
find
(
"}"
)
;
if
(
startPos
!=
std
::
string
::
npos
&&
endPos
!=
std
::
string
::
npos
)
{
gasolinaValue
=
gasolina
.
substr
(
startPos
+
1
,
endPos
-
startPos
-
1
)
;
}
std
::
cout
|
|
|

13.08.2024, 20:51
|
|
Познающий
Регистрация: 23.07.2024
Сообщений: 90
С нами:
953273
Репутация:
13
|
|
1.Ваш вопрос: С чего лучше начать изучения языка , желательно видеоролики.
И да я мал по этому и спрашиваю за это так как имею интерес к этому но незнаю с чего начать . Благодарочка всем
|
|
|

13.08.2024, 23:31
|
|
Флудер
Регистрация: 19.06.2022
Сообщений: 2,997
С нами:
2055431
Репутация:
3
|
|
Сообщение от klyuchik
С чего лучше начать изучения языка , желательно видеоролики.
Для начала тебе стоит выучить базовый синтаксис языка, поэтому вписываешь в ютубе что-то вроде "курс C++ для новичка" и смотришь пару видео. Далее можешь начать читать книжку, лично я читал (но так и не дочитал) Лоспинозо - C++ для профи. Молниеносный старт (2021). Потом смотришь чужой код, на том же бластхаке и постепенно пишешь свои проекты
|
|
|

14.08.2024, 20:58
|
|
Познающий
Регистрация: 23.07.2024
Сообщений: 90
С нами:
953273
Репутация:
13
|
|
Сообщение от whyega52
Для начала тебе стоит выучить базовый синтаксис языка, поэтому вписываешь в ютубе что-то вроде "курс C++ для новичка" и смотришь пару видео. Далее можешь начать читать книжку, лично я читал (но так и не дочитал) Лоспинозо - C++ для профи. Молниеносный старт (2021). Потом смотришь чужой код, на том же бластхаке и постепенно пишешь свои проекты
Пишет что ссылка не доступна , скинь на гугл диск
|
|
|

15.08.2024, 15:59
|
|
Флудер
Регистрация: 19.06.2022
Сообщений: 2,997
С нами:
2055431
Репутация:
3
|
|
Сообщение от klyuchik
Пишет что ссылка не доступна , скинь на гугл диск
6.21 MB file on MEGA
mega.nz
|
|
|
|
 |
|
|
Здесь присутствуют: 1 (пользователей: 0 , гостей: 1)
|
|
|
|