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

  #7359  
Старый 23.08.2024, 20:48
AdCKuY_DpO4uLa
Постоянный
Регистрация: 05.08.2018
Сообщений: 372
С нами: 4091290

Репутация: 213
По умолчанию

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

as noob as it sounds how can i get health/armor of an enemy player using samp-api, because i get invalid info everytime:

C++:





Код:
samp
::
CPlayerInfo
*
pPlayer
=
playerPool
->
GetAt
(
i
)
;
auto
hp
=
remote_player
->
m_onfootData
.
m_nHealth
;
//does work sometimes i think people from that comes to your streamzone gives 0hp
auto
ap
=
remote_player
->
m_onfootData
.
m_nArmor
//does work sometimes i think people from that comes to your streamzone gives 0ap
auto
hpp
=
remote_player
->
m_pPed
->
GetHealth
(
)
;
//always 100
auto
app
=
remote_player
->
m_pPed
->
GetArmour
(
)
;
//always 100
auto
hpp
=
remote_player
->
m_pPed
->
m_pGamePed
->
m_fHealth
;
//always 100 or 0 dont renember
auto
app
=
remote_player
->
m_pPed
->
m_pGamePed
->
m_fArmour
;
//always 100 or 0 dont renember

C++:





Код:
sampapi
::
v037r3
::
RefNetGame
(
)
->
m_pPools
->
m_pPlayer
->
m_pObject
[
i
]
->
m_pPlayer
->
m_pPed
->
GetHealth
(
)
;
 
Ответить с цитированием