Другое С/С++ Вопрос - Ответ

Loku

Известный
30
7
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
 

AdCKuY_DpO4uLa

Адский дрочер
Проверенный
303
608
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();
 
  • Нравится
Реакции: MLycoris и Loku

whyega52

Гений, миллионер, плейбой, долбаеб
Модератор
2,706
2,478
Как правильно работать с рендером через CSprite2D::Draw?
C++:
CRect rect;
rect.left = -0.5f;
rect.top = -0.5f;
rect.right = RsGlobal.maximumWidth;
rect.bottom = RsGlobal.maximumHeight;
sprite.Draw(rect, {0xFF, 0xFF, 0xFF, 0xFF});
Картинка рендерится, однако получается что-то не то:
1725176334028.png
 

ARMOR

kjor32 is legend клоун
Модератор
4,896
6,532
Как правильно работать с рендером через CSprite2D::Draw?
C++:
CRect rect;
rect.left = -0.5f;
rect.top = -0.5f;
rect.right = RsGlobal.maximumWidth;
rect.bottom = RsGlobal.maximumHeight;
sprite.Draw(rect, {0xFF, 0xFF, 0xFF, 0xFF});
Картинка рендерится, однако получается что-то не то:
Посмотреть вложение 250825
Потому что от 0.0 до 1.0 пробуй. Или от 0.0 до 640. 0.0 до 360.0
 

manukhov

Известный
123
131
Как правильно работать с рендером через CSprite2D::Draw?
C++:
CRect rect;
rect.left = -0.5f;
rect.top = -0.5f;
rect.right = RsGlobal.maximumWidth;
rect.bottom = RsGlobal.maximumHeight;
sprite.Draw(rect, {0xFF, 0xFF, 0xFF, 0xFF});
Картинка рендерится, однако получается что-то не то:
Посмотреть вложение 250825
А попробуй так
C++:
CRect rect;
rect.left = 1.0f;
rect.top = 0.5f;
rect.right = RsGlobal.maximumWidth + 1.0f;
rect.bottom = RsGlobal.maximumHeight  + 0.5f;
sprite.Draw(rect, {0xFF, 0xFF, 0xFF, 0xFF});
 

whyega52

Гений, миллионер, плейбой, долбаеб
Модератор
2,706
2,478
А попробуй так
C++:
CRect rect;
rect.left = 1.0f;
rect.top = 0.5f;
rect.right = RsGlobal.maximumWidth + 1.0f;
rect.bottom = RsGlobal.maximumHeight  + 0.5f;
sprite.Draw(rect, {0xFF, 0xFF, 0xFF, 0xFF});
дело, если правильно помню, было не в координатах, а в том, что рендерил не в том месте, не в то время (не в пресенте напрямую, а в хуке PlayerTags::DrawLabel)
 

xtngerr

Новичок
6
0
Как вообще работает антистан?
Я правильно понимаю, что есть состояния игрока, которые сервер получает?