Solo usuarios registrados pueden comentar y agradecer, Logueate o Registrate

Autor Topic: Ayuda Modificar Source HPBAR (ProgressBar)  (Visto 1045 veces)

0 Miembros and 1 Guest are viewing this topic.

Offline reveage Posteado: May 05, 2020, 07:43:01 PM

  • 0 puntos por ventas
  • *
  • Rank: Usuario activo
  • Posts: 64
  • Gracias recibida: 28
  • cl
Hola, estoy tratando de aprender esto de las sources ya aprendi a dibujar o poner textos pero tengo problemas con las barras de progress pueden ayudarme?

intente cambiar este:
Code: [Select]
	float LifeBarWidth = 40.0f;
pero cambiandola solo se agranda la barra de vida pero no la barra que define el progreso de vida.

tambien intente cambiar:

Code: [Select]
		for(int i = 0; i < LifeProgress; i++)
{
pDrawBarForm((float)(i * 4 + PosX + 0), (float)(PosY + 2), 4.0, 2.0, 0.0, 0);
}
pero al hacerlo la barra de progress se agranda pero no hace el calculo correcto por lo cual el bicho muere estando la barra en 50%
 


Code: [Select]
void DrawNewHealthBar() // OK
{
int PosX, PosY, LifeProgress, ShieldProgress;
float LifeBarWidth = 40.0f;
char LifeDisplay[50];
VAngle Angle;
for(int n=0;n < MAX_MAIN_VIEWPORT;n++)
{
DWORD ViewportAddress = ((DWORD(__thiscall*)(void*,DWORD))0x0096A4C0)(((void*(*)())0x00402BC0)(),n);

gObjUser.m_Logo[n].Active = 0;

if(!ViewportAddress)
{
continue;
}

if(*(BYTE*)(ViewportAddress+0x30C) == 0)
{
continue;
}

Angle.X = *(float*)(ViewportAddress+0x404);

Angle.Y = *(float*)(ViewportAddress+0x408);

Angle.Z = *(float*)(ViewportAddress+0x40C) + *(float*)(ViewportAddress+0x3E8) + 200.0f;

pGetPosFromAngle(&Angle, &PosX, &PosY);

if (*(BYTE*)(ViewportAddress+0x320) == 1) //Check User Type
        {
            gObjUser.m_Logo[n].Active = 1;
gObjUser.m_Logo[n].X = PosX;
gObjUser.m_Logo[n].Y = PosY;
        }

PosX -= (int)floor(LifeBarWidth / (double)2.0);

PosY -= 16;

NEW_HEALTH_BAR* lpNewHealthBar = GetNewHealthBar(*(WORD*)(ViewportAddress+0x7E),*(BYTE*)(ViewportAddress+0x320));

if(lpNewHealthBar == 0)
{
continue;
}

int LifePercent = lpNewHealthBar->rate/10;
int ShieldPercent = lpNewHealthBar->rate2/10;

if((pCursorX >= PosX - 2) && ((float)pCursorX <= (float)PosX + LifeBarWidth + 2) && (pCursorY >= PosY - 2) && (pCursorY < PosY + 10))
{

if (ShieldPercent>0)
{
wsprintf(LifeDisplay, "HP : %d0%% | SD : %d0%%", LifePercent, ShieldPercent);
pSetTextColor(pTextThis(), 0xFF, 0xE6, 0xD2, 0xFF);
pDrawText(pTextThis(), PosX - 20, PosY - 10, LifeDisplay, 0, 0, (LPINT)1, 0);
}
else
{
wsprintf(LifeDisplay, "HP : %d0%%", LifePercent);
pSetTextColor(pTextThis(), 0xFF, 0xE6, 0xD2, 0xFF);
pDrawText(pTextThis(), PosX, PosY - 8, LifeDisplay, 0, 0, (LPINT)1, 0);
}

}

pSetBlend(true);

float Tamanho = (ShieldPercent>0)?Tamanho=10.0f:Tamanho=5.0f;

glColor4f(0.0, 0.0, 0.0, 0.5);
pDrawBarForm((float)(PosX - 2), (float)(PosY + 1), LifeBarWidth + 4.0f, Tamanho, 0.0f, 0);
pGLSwitchBlend();


glColor3f(0.2f, 0.0, 0.0);
pDrawBarForm((float)PosX, (float)PosY + 2, LifeBarWidth, 2.0f, 0.0, 0);

if (ShieldPercent>0)
{
glColor3f(0.22039216f, 0.239215688f, 0.0);
pDrawBarForm((float)PosX, (float)PosY + 6, LifeBarWidth, 2.0f, 0.0, 0);
}

if(LifePercent > 10)
{
LifeProgress = 10;
}
else
{
LifeProgress = LifePercent;
}

if(ShieldPercent > 10)
{
ShieldProgress = 10;
}
else
{
ShieldProgress = ShieldPercent;
}

glColor3f(0.98039216f, 0.039215688f, 0.0);

for(int i = 0; i < LifeProgress; i++)
{
pDrawBarForm((float)(i * 4 + PosX + 0), (float)(PosY + 2), 4.0, 2.0, 0.0, 0);
}

if (ShieldPercent>0)
{
glColor3f(0.98039216f, 5.039215688f, 0.0);

for(int i = 0; i < ShieldProgress; i++)
{
pDrawBarForm((float)(i * 4 + PosX + 0), (float)(PosY + 6), 4.0, 2.0, 0.0, 0);
}
}

pGLSwitch();
}
pGLSwitch();

glColor3f(1.0, 1.0, 1.0);
}

si alguien puede ayudarme y/o dejarme unos consejos lo agradesceria mucho.


Solo usuarios registrados pueden comentar y agradecer, Logueate o Registrate


 

Related Topics

  Subject / Started by Replies Last post
11 Replies
10147 Views
Last post June 27, 2020, 12:04:32 AM
by load_01
2 Replies
2747 Views
Last post September 21, 2018, 07:38:19 PM
by Cloud
19 Replies
10918 Views
Last post May 14, 2024, 09:50:19 PM
by chipcoidj
0 Replies
1508 Views
Last post October 26, 2021, 10:07:05 AM
by victhorinox
13 Replies
3372 Views
Last post September 13, 2024, 01:58:45 AM
by HaPKoTuK