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

  #6  
Старый 24.07.2022, 17:01
RedHolms
Постоянный
Регистрация: 04.06.2020
Сообщений: 620
С нами: 3127813

Репутация: 133


По умолчанию

г

[QUOTE="tr1ckster"]

Могу предложить вариант:

C++:





[CODE]
// Вначале получаем указатель на структуру SAMP или stSAMP, CNetGame, pSAMP, вообщем как удобнее
pSAMP
=
*
reinterpret_cast

(
samp
.
dll
+
0x21A0F8
)
;
// Потом из структуры сампа получаем указатель на структуру игровых пулов
ppPools
=
reinterpret_cast

(
(
size_t
)
pSAMP
+
0x3CD
)
;
// Потом из структуры игровых пулов в структуре самп получаем указатель на структуру игроков
ppPlayer
=
reinterpret_cast

(
(
size_t
)
pPools
+
0x18
)
;
// В итоге, из структуры игроков получаем ник и ид ЛОКАЛЬНОГО игрока. Смотри: https://gitlab.com/prime-hack/samp/plugins/templates/samp/-/blob/master/SAMP by SR_team
pLocalPlayerNickname
=
reinterpret_cast

(
(
size_t
)
pPlayerPool
+
0xA
)
;
pLocalPlayerId
=
reinterpret_cast

(
(
size_t
)
pPlayerPool
+
0x4
)
;
short
SAMP
::
PlayerPool
::
GetLocalPlayerId
(
)
{
if
(
pLocalPlayerId
)
return
*
pLocalPlayerId
;
return
-
1
;
}
std
::
string SAMP
::
PlayerPool
::
GetLocalPlayerNickname
(
)
{
struct
msvc_string
{
union
{
char
szString
[
0x10
]
;
char
*
pszString
;
}
;
std
::
size_t length
;
std
::
size_t allocated
;
}
;
auto
string
=
*
reinterpret_cast

(
pLocalPlayerNickname
)
;
if
(
string
.
allocated
 
Ответить с цитированием