Skocz do zawartości
  • 👋 Witaj na MPCForum!

    Przeglądasz forum jako gość, co oznacza, że wiele świetnych funkcji jest jeszcze przed Tobą! 😎

    • Pełny dostęp do działów i ukrytych treści
    • Możliwość pisania i odpowiadania w tematach
    • System prywatnych wiadomości
    • Zbieranie reputacji i rozwijanie swojego profilu
    • Członkostwo w jednej z największych społeczności graczy

    👉 Dołączenie zajmie Ci mniej niż minutę – a zyskasz znacznie więcej!

    Zarejestruj się teraz

Rekomendowane odpowiedzi

Opublikowano

witam mam taki kod ktory robi wh do bad company 2. tylko nie wiem co mam z nim zrobic. wklejam kod.

void PlayersToRadar(dice::ClientPlayer* TargetPlayer)

{

float RadarPos_X = ScreenWidth/2 - 500.0;

float RadarPos_Y = ScreenHeight/2 - 100;

 

float RadarSizeX = 180.0;

float RadarSizeY = 180.0;

 

float Middle_X = RadarPos_X+90;

float Middle_Y = RadarPos_Y+90;

 

D3DXVECTOR3 RadarPOS;

GetZ(&RadarPOS, g_pLocalPlayer->GetParent()->GetPlayerMatrix() );

 

DrawRect(RadarPos_X, RadarPos_Y, RadarSizeX + 1, RadarSizeY + 1, D3DCOLOR_ARGB(255,0,0,255));

FillRectD3D( RadarPos_X ,RadarPos_Y,RadarSizeX,RadarSizeY,D3DCOLOR_ARGB( 10, 112, 112, 112 ));

FillRectD3D( RadarPos_X,RadarPos_Y+90,RadarSizeX,1,D3DCOLOR_ARGB(255,0,0,255));//x line

FillRectD3D( RadarPos_X+90,RadarPos_Y,1,RadarSizeY,D3DCOLOR_ARGB(255,0,0,255));//y line

 

D3DXVECTOR3 OrigToRadar;

 

GetOrigin(&OrigToRadar, TargetPlayer->GetParent()->GetPlayerMatrix());

 

float drawx = ( OrigToRadar.x - g_pLocalPlayer->GetParent()->GetPlayerMatrix()->_41 ) / 2;

float drawy = ( OrigToRadar.z - g_pLocalPlayer->GetParent()->GetPlayerMatrix()->_43 ) / 2;

 

float first_yaw;

 

if (RadarPOS.z == 0 && RadarPOS.x == 0)

{

first_yaw = 0;

}

else

{

first_yaw = (atan2(RadarPOS.z, -RadarPOS.x) * 180 / M_PI);

if (first_yaw < 0)

first_yaw += 360;

}

 

float yaw = ((first_yaw) * (M_PI*2 / 360));

 

float rotx = drawy * cos(yaw) + drawx * sin(yaw);

float roty = drawx * cos(yaw) - drawy * sin(yaw);

 

RadarPOS.x += Middle_X;

RadarPOS.y += Middle_Y;

 

if(RadarPOS.x + rotx-2 < RadarPos_X) return;

else if(RadarPOS.x + rotx+2 > (RadarPos_X+160) ) return;

if(RadarPOS.y + roty-2 < RadarPos_Y) return;

else if(RadarPOS.y + roty+2 > (RadarPos_Y+160) ) return;

 

BOOL ISVIS = IsVisible(&OrigToRadar, 0x7A);

 

D3DCOLOR EtagColor = ISVIS ? D3DCOLOR_ARGB(255,0,50,255) : D3DCOLOR_ARGB(255,50,255,0);

 

FillRectD3D(RadarPOS.x + rotx-2, RadarPOS.y + roty-2, 4, 4, EtagColor );

  • 1 miesiąc temu...
Opublikowano (edytowane)

Yyyyy skompilowac ?

PS. Kod nie jest pełny, brakuje include i inych rzeczy jak nie znasz sie na programowaniu to tego nie zroibsz :)

Edytowane przez Isith

Zbieeeram ++++luśiki ^^

10 Postów [x]

50 postow [x]

100 postow [x]

200 postow [ ]

500 postow [ ]

1000 postow [ ]

×
×
  • Dodaj nową pozycję...