[Mini-Release] Status HP in tausender

07/20/2014 11:20 randeljohnvalencia#16
PLsss Error for compile ?

[Only registered and activated users can see links. Click Here To Register...]

Error pplsss help Me
07/21/2014 04:54 Grabweachter#17
German:
Hab das ganze mal selber nach gebaut und hier ist es.
Ich find das ganze so besser sturkuriert und sauberer.
Ist der bis jetzige sauberste released Code hier.

English:
I've reconstructed the whole part of code.
In my opinion this looks much better.
It's the best released code since this thread was started.

PHP Code:
int x lpHP->rect.right 82;
int GetHitPointsGetMaxHitPoints;

GetHitPoints pMover->GetHitPoint();
GetMaxHitPoints pMover->GetMaxHitPoint();

nCharHP wsprintf(cbufHp"%d"GetHitPoints);
nCharMP wsprintf(cbufMp"%d"pMover->GetManaPoint());
nCharFP wsprintf(cbufFp"%d"pMover->GetFatiguePoint());
        
if( 
GetHitPoints 10000 )
    
nCharHP wsprintf(cbufHp"%dk"GetHitPoints 1000);
else if( 
GetHitPoints 1000000 )
    
nCharHP wsprintf(cbufHp"%dm"GetHitPoints 100000);

p2DRender->TextOut- (int)(((float)nCharHP 2.0f) * size.cx), lpHP->rect.top nTopGapcbufHpdwColor0xff000000 );    
p2DRender->TextOut- (int)(((float)nCharMP 2.0f) * size.cx), lpMP->rect.top nTopGapcbufMpdwColor0xff000000 );
p2DRender->TextOut- (int)(((float)nCharFP 2.0f) * size.cx), lpFP->rect.top nTopGapcbufFpdwColor0xff000000 );

nCharHP wsprintf(cbufHp"%d"GetMaxHitPoints);
nCharMP wsprintf(cbufMp"%d"pMover->GetMaxManaPoint());
nCharFP wsprintf(cbufFp"%d"pMover->GetMaxFatiguePoint());

if( 
GetMaxHitPoints 10000 )
    
nCharHP wsprintf(cbufHp"%dk"GetMaxHitPoints 1000);
else if( 
GetMaxHitPoints 1000000 )
    
nCharHP wsprintf(cbufHp"%dm"GetMaxHitPoints 100000);

lpHP->rect.right 30;
p2DRender->TextOut- (int)(((float)nCharHP 2.0f) * size.cx), lpHP->rect.top nTopGapcbufHpdwColor0xff000000 );
p2DRender->TextOut- (int)(((float)nCharMP 2.0f) * size.cx), lpMP->rect.top nTopGapcbufMpdwColor0xff000000 );
p2DRender->TextOut- (int)(((float)nCharFP 2.0f) * size.cx), lpFP->rect.top nTopGapcbufFpdwColor0xff000000 );
    
LPWNDCTRL lpHP GetWndCtrlWIDC_CUSTOM1 );
int nWidthCustom lpHP->rect.Width();
int nGap = (int)( ((nWidthCustom 2.0f) + (size.cx 2.0f)) );

p2DRender->TextOutlpHP->rect.right nGaplpHP->rect.top nTopGap"/"dwColor0xff000000 );
p2DRender->TextOutlpMP->rect.right nGaplpMP->rect.top nTopGap"/"dwColor0xff000000 );
p2DRender->TextOutlpFP->rect.right nGaplpFP->rect.top nTopGap"/"dwColor0xff000000 ); 
07/21/2014 07:07 randeljohnvalencia#18
Give Example For Put the Code plsssssssssss
10/15/2014 14:23 domine1#19
Wher I Can Make The Codes Give me Name Files
02/03/2016 12:46 flyff024#20
sir how to make it 1.5m instead of 1m only ?
02/03/2016 20:45 NoWay | Phoenix#21
Here we go :D
@randeljohnvalencia
@domine1


File: WndField

Look for:
Quote:
Code:
void CWndStatus::OnDraw(C2DRender* p2DRender)
Change:
Quote:
Code:
else
		{
			nCharHP = wsprintf(cbufHp, "%d", pMover->GetHitPoint());
			nCharMP = wsprintf(cbufMp, "%d", pMover->GetManaPoint());
			nCharFP = wsprintf(cbufFp, "%d", pMover->GetFatiguePoint());

			int x = lpHP->rect.right - 82;
			p2DRender->TextOut( x - (int)(((float)nCharHP / 2.0f) * size.cx), lpHP->rect.top - nTopGap, cbufHp, dwColor, 0xff000000 );
			p2DRender->TextOut( x - (int)(((float)nCharMP / 2.0f) * size.cx), lpMP->rect.top - nTopGap, cbufMp, dwColor, 0xff000000 );
			p2DRender->TextOut( x - (int)(((float)nCharFP / 2.0f) * size.cx), lpFP->rect.top - nTopGap, cbufFp, dwColor, 0xff000000 );

			nCharHP = wsprintf(cbufHp, "%d", pMover->GetHitPoint());
			nCharMP = wsprintf(cbufMp, "%d", pMover->GetMaxManaPoint());
			nCharFP = wsprintf(cbufFp, "%d", pMover->GetMaxFatiguePoint());

			x = lpHP->rect.right - 30;
			p2DRender->TextOut( x - (int)(((float)nCharHP / 2.0f) * size.cx), lpHP->rect.top - nTopGap, cbufHp, dwColor, 0xff000000 );
			p2DRender->TextOut( x - (int)(((float)nCharMP / 2.0f) * size.cx), lpMP->rect.top - nTopGap, cbufMp, dwColor, 0xff000000 );
			p2DRender->TextOut( x - (int)(((float)nCharFP / 2.0f) * size.cx), lpFP->rect.top - nTopGap, cbufFp, dwColor, 0xff000000 );

			LPWNDCTRL lpHP = GetWndCtrl( WIDC_CUSTOM1 );
			int nWidthCustom = lpHP->rect.Width();
			int nGap = (int)( ((nWidthCustom / 2.0f) + (size.cx / 2.0f)) );

			p2DRender->TextOut( lpHP->rect.right - nGap, lpHP->rect.top - nTopGap, "/", dwColor, 0xff000000 );
			p2DRender->TextOut( lpMP->rect.right - nGap, lpMP->rect.top - nTopGap, "/", dwColor, 0xff000000 );
			p2DRender->TextOut( lpFP->rect.right - nGap, lpFP->rect.top - nTopGap, "/", dwColor, 0xff000000 );
		}
Code:

To:
Quote:
Code:
else
		{
			//HP
			if ( pMover->GetHitPoint() >= 10000 && pMover->GetHitPoint() <= 999999 )
			{
				nCharHP = wsprintf(cbufHp, "%dk", pMover->GetHitPoint() / 1000 );
			}
			else
			if ( pMover->GetHitPoint() >= 1000000 && pMover->GetHitPoint() <= 999999999 )
			{
				nCharHP = wsprintf(cbufHp, "%dm", pMover->GetHitPoint() / 1000000 );
			}
			else
			if ( pMover->GetHitPoint() >= 1000000000 )
			{
				nCharHP = wsprintf(cbufHp, "%db", pMover->GetHitPoint() / 1000000000 );
			}
			else
				nCharHP = wsprintf(cbufHp, "%d", pMover->GetHitPoint());


			//MP
			if ( pMover->GetManaPoint() >= 10000 && pMover->GetManaPoint() <= 999999 )
			{
				nCharMP = wsprintf(cbufMp, "%dk", pMover->GetManaPoint() / 1000 );
			}
			else
			if ( pMover->GetManaPoint() >= 1000000 && pMover->GetManaPoint() <= 999999999 )
			{
				nCharMP = wsprintf(cbufMp, "%dm", pMover->GetManaPoint() / 1000000 );
			}
			else
			if ( pMover->GetManaPoint() >= 1000000000 )
			{
				nCharMP = wsprintf(cbufMp, "%db", pMover->GetManaPoint() / 1000000000 );
			}
			else
			nCharMP = wsprintf(cbufMp, "%d", pMover->GetManaPoint());



			//FP
			if ( pMover->GetFatiguePoint() >= 10000 && pMover->GetFatiguePoint() <= 999999 )
			{
				nCharFP = wsprintf(cbufFp, "%dk", pMover->GetFatiguePoint() / 1000 );
			}
			else
			if ( pMover->GetFatiguePoint() >= 1000000 && pMover->GetFatiguePoint() <= 999999999 )
			{
				nCharFP = wsprintf(cbufFp, "%dm", pMover->GetFatiguePoint() / 1000000 );
			}
			else
			if ( pMover->GetFatiguePoint() >= 1000000000 )
			{
				nCharFP = wsprintf(cbufFp, "%db", pMover->GetFatiguePoint() / 1000000000 );
			}
			else
			nCharFP = wsprintf(cbufFp, "%d", pMover->GetFatiguePoint());
			
			int x = lpHP->rect.right - 82;
			p2DRender->TextOut( x - (int)(((float)nCharHP / 2.0f) * size.cx), lpHP->rect.top - nTopGap, cbufHp, dwColor, 0xff000000 );
			p2DRender->TextOut( x - (int)(((float)nCharMP / 2.0f) * size.cx), lpMP->rect.top - nTopGap, cbufMp, dwColor, 0xff000000 );
			p2DRender->TextOut( x - (int)(((float)nCharFP / 2.0f) * size.cx), lpFP->rect.top - nTopGap, cbufFp, dwColor, 0xff000000 );



			//HP
			if ( pMover->GetMaxHitPoint() >= 10000 && pMover->GetMaxHitPoint() <= 999999 )
			{
				nCharHP = wsprintf(cbufHp, "%dk", pMover->GetMaxHitPoint() / 1000 );
			}
			else
			if ( pMover->GetMaxHitPoint() >= 1000000 && pMover->GetMaxHitPoint() <= 999999999 )
			{
				nCharHP = wsprintf(cbufHp, "%dm", pMover->GetMaxHitPoint() / 1000000 );
			}
			else
			if ( pMover->GetMaxHitPoint() >= 1000000000 )
			{
				nCharHP = wsprintf(cbufHp, "%db", pMover->GetMaxHitPoint() / 1000000000 );
			}
			else
				nCharHP = wsprintf(cbufHp, "%d", pMover->GetHitPoint());



			//MP
			if ( pMover->GetMaxManaPoint() >= 10000 && pMover->GetMaxManaPoint() <= 999999 )
			{
				nCharMP = wsprintf(cbufMp, "%dk", pMover->GetMaxManaPoint() / 1000 );
			}
			else
			if ( pMover->GetMaxManaPoint() >= 1000000 && pMover->GetMaxManaPoint() <= 999999999 )
			{
				nCharMP = wsprintf(cbufMp, "%dm", pMover->GetMaxManaPoint() / 1000000 );
			}
			else
			if ( pMover->GetMaxManaPoint() >= 1000000000 )
			{
				nCharMP = wsprintf(cbufMp, "%db", pMover->GetMaxManaPoint() / 1000000000 );
			}
			else
				nCharMP = wsprintf(cbufMp, "%d", pMover->GetMaxManaPoint());



			//FP
			if ( pMover->GetMaxFatiguePoint() >= 10000 && pMover->GetMaxFatiguePoint() <= 999999 )
			{
				nCharFP = wsprintf(cbufFp, "%dk", pMover->GetMaxFatiguePoint() / 1000 );
			}
			else
			if ( pMover->GetMaxFatiguePoint() >= 1000000 && pMover->GetMaxFatiguePoint() <= 999999999 )
			{
				nCharFP = wsprintf(cbufFp, "%dm", pMover->GetMaxFatiguePoint() / 1000000 );
			}
			else
			if ( pMover->GetMaxFatiguePoint() >= 1000000000 )
			{
				nCharFP = wsprintf(cbufFp, "%db", pMover->GetMaxFatiguePoint() / 1000000000 );
			}
			else
				nCharFP = wsprintf(cbufFp, "%d", pMover->GetMaxFatiguePoint());

			x = lpHP->rect.right - 30;
			p2DRender->TextOut( x - (int)(((float)nCharHP / 2.0f) * size.cx), lpHP->rect.top - nTopGap, cbufHp, dwColor, 0xff000000 );
			p2DRender->TextOut( x - (int)(((float)nCharMP / 2.0f) * size.cx), lpMP->rect.top - nTopGap, cbufMp, dwColor, 0xff000000 );
			p2DRender->TextOut( x - (int)(((float)nCharFP / 2.0f) * size.cx), lpFP->rect.top - nTopGap, cbufFp, dwColor, 0xff000000 );

			LPWNDCTRL lpHP = GetWndCtrl( WIDC_CUSTOM1 );
			int nWidthCustom = lpHP->rect.Width();
			int nGap = (int)( ((nWidthCustom / 2.0f) + (size.cx / 2.0f)) );

			p2DRender->TextOut( lpHP->rect.right - nGap, lpHP->rect.top - nTopGap, "/", dwColor, 0xff000000 );
			p2DRender->TextOut( lpMP->rect.right - nGap, lpMP->rect.top - nTopGap, "/", dwColor, 0xff000000 );
			p2DRender->TextOut( lpFP->rect.right - nGap, lpFP->rect.top - nTopGap, "/", dwColor, 0xff000000 );
		}
02/05/2016 06:28 xTwiLightx#22
Quote:
Originally Posted by NoWay | Phoenix View Post
Here we go :D
@randeljohnvalencia
@domine1


File: WndField

Look for:


Change:



To:
Was ist denn daran so schwer, Code wie jeder andere hier auch in den CODE-Tag zu packen?
02/06/2016 10:24 sebariio#23
For noobs useless:
Quote:
#ifdef __HP_MP_FP
if ( pMover->GetMaxHitPoint() >= 10000 && pMover->GetMaxHitPoint() < 1000000 )
{
nCharHP = wsprintf(cbufHp, "%dk", pMover->GetMaxHitPoint() / 1000 );
}
else if ( pMover->GetMaxHitPoint() >= 1000000 && pMover->GetMaxHitPoint() < 1000000000 )
{
nCharHP = wsprintf(cbufHp, "%dm", pMover->GetMaxHitPoint() / 1000000 );
}
else if ( pMover->GetMaxHitPoint() >= 1000000000 )
{
nCharHP = wsprintf(cbufHp, "%db", pMover->GetMaxHitPoint() / 1000000000 );
}
else
nCharHP = wsprintf(cbufHp, "%d", pMover->GetMaxHitPoint());
#else // __HP_MP_FP
nCharHP = wsprintf(cbufHp, "%d", pMover->GetMaxHitPoint());
#endif // __HP_MP_FP

#ifdef __HP_MP_FP
if( pMover->GetMaxManaPoint() >= 10000 && pMover->GetMaxManaPoint() < 1000000 )
{
nCharMP = wsprintf(cbufMp, "%dk", pMover->GetMaxManaPoint() / 1000 );
}
else if( pMover->GetMaxManaPoint() >= 1000000 && pMover->GetMaxManaPoint() < 1000000000 )
{
nCharMP = wsprintf(cbufMp, "%dm", pMover->GetMaxManaPoint() / 1000000 );
}
else if( pMover->GetMaxManaPoint() >= 1000000000 )
{
nCharMP = wsprintf(cbufMp, "%db", pMover->GetMaxManaPoint() / 1000000000 );
}
else
nCharMP = wsprintf(cbufMp, "%d", pMover->GetMaxManaPoint());
#else // __HP_MP_FP
nCharMP = wsprintf(cbufMp, "%d", pMover->GetMaxManaPoint());
#endif // __HP_MP_FP

#ifdef __HP_MP_FP
if ( pMover->GetMaxFatiguePoint() >= 10000 && pMover->GetMaxFatiguePoint() < 1000000 )
{
nCharFP = wsprintf(cbufFp, "%dk", pMover->GetMaxFatiguePoint() / 1000 );
}
else if ( pMover->GetMaxFatiguePoint() >= 1000000 && pMover->GetMaxFatiguePoint() < 1000000000 )
{
nCharFP = wsprintf(cbufFp, "%dm", pMover->GetMaxFatiguePoint() / 1000000 );
}
else if ( pMover->GetMaxFatiguePoint() >= 1000000000 )
{
nCharFP = wsprintf(cbufFp, "%db", pMover->GetMaxFatiguePoint() / 1000000000 );
}
else
nCharFP = wsprintf(cbufFp, "%d", pMover->GetMaxFatiguePoint());
#else // __HP_MP_FP
nCharFP = wsprintf(cbufFp, "%d", pMover->GetMaxFatiguePoint());
#endif // __HP_MP_FP
Quote:
#ifdef __HP_MP_FP
if ( pMover->GetHitPoint() >= 10000 && pMover->GetHitPoint() < 1000000 )
{
nCharHP = wsprintf(cbufHp, "%dk", pMover->GetHitPoint() / 1000 );
}
else if ( pMover->GetHitPoint() >= 1000000 && pMover->GetHitPoint() < 1000000000 )
{
nCharHP = wsprintf(cbufHp, "%dm", pMover->GetHitPoint() / 1000000 );
}
else if ( pMover->GetHitPoint() >= 1000000000 )
{
nCharHP = wsprintf(cbufHp, "%db", pMover->GetHitPoint() / 1000000000 );
}
else
nCharHP = wsprintf(cbufHp, "%d", pMover->GetHitPoint());
#else // __HP_MP_FP
nCharHP = wsprintf(cbufHp, "%d", pMover->GetHitPoint());
#endif // __HP_MP_FP

#ifdef __HP_MP_FP
if( pMover->GetManaPoint() >= 10000 && pMover->GetManaPoint() < 1000000 )
{
nCharMP = wsprintf(cbufMp, "%dk", pMover->GetManaPoint() / 1000 );
}
else if( pMover->GetManaPoint() >= 1000000 && pMover->GetManaPoint() < 1000000000 )
{
nCharMP = wsprintf(cbufMp, "%dm", pMover->GetManaPoint() / 1000000 );
}
else if( pMover->GetManaPoint() >= 1000000000 )
{
nCharMP = wsprintf(cbufMp, "%db", pMover->GetManaPoint() / 1000000000 );
}
else
nCharMP = wsprintf(cbufMp, "%d", pMover->GetManaPoint());
#else // __HP_MP_FP
nCharMP = wsprintf(cbufMp, "%d", pMover->GetManaPoint());
#endif // __HP_MP_FP

#ifdef __HP_MP_FP
if ( pMover->GetFatiguePoint() >= 10000 && pMover->GetFatiguePoint() < 1000000 )
{
nCharFP = wsprintf(cbufFp, "%dk", pMover->GetFatiguePoint() / 1000 );
}
else if ( pMover->GetFatiguePoint() >= 1000000 && pMover->GetFatiguePoint() < 1000000000 )
{
nCharFP = wsprintf(cbufFp, "%dm", pMover->GetFatiguePoint() / 1000000 );
}
else if ( pMover->GetFatiguePoint() >= 1000000000 )
{
nCharFP = wsprintf(cbufFp, "%db", pMover->GetFatiguePoint() / 1000000000 );
}
else
nCharFP = wsprintf(cbufFp, "%d", pMover->GetFatiguePoint());
#else // __HP_MP_FP
nCharFP = wsprintf(cbufFp, "%d", pMover->GetFatiguePoint());
#endif // __HP_MP_FP
02/13/2016 16:33 Dapanji#24
i dont like this realse its buggy if you get the 1m hp
02/13/2016 17:07 NoWay | Phoenix#25
Quote:
Originally Posted by Dapanji View Post
i dont like this realse its buggy if you get the 1m hp
What Bugg do you mean o.o
02/13/2016 19:46 sebariio#26
no bugs lol
100% working
02/17/2016 09:23 Kaev <3#27
I don't know why you guys still take the "bad" version when this guy posted a cleary better one (i had to puke mentally when i saw that they call GetHitPoints etc. like 100 times instead of just saving it in a variable. :facepalm:):

Quote:
Originally Posted by Grabweachter View Post
German:
Hab das ganze mal selber nach gebaut und hier ist es.
Ich find das ganze so besser sturkuriert und sauberer.
Ist der bis jetzige sauberste released Code hier.

English:
I've reconstructed the whole part of code.
In my opinion this looks much better.
It's the best released code since this thread was started.

PHP Code:
int x lpHP->rect.right 82;
int GetHitPointsGetMaxHitPoints;

GetHitPoints pMover->GetHitPoint();
GetMaxHitPoints pMover->GetMaxHitPoint();

nCharHP wsprintf(cbufHp"%d"GetHitPoints);
nCharMP wsprintf(cbufMp"%d"pMover->GetManaPoint());
nCharFP wsprintf(cbufFp"%d"pMover->GetFatiguePoint());
        
if( 
GetHitPoints 10000 )
    
nCharHP wsprintf(cbufHp"%dk"GetHitPoints 1000);
else if( 
GetHitPoints 1000000 )
    
nCharHP wsprintf(cbufHp"%dm"GetHitPoints 100000);

p2DRender->TextOut- (int)(((float)nCharHP 2.0f) * size.cx), lpHP->rect.top nTopGapcbufHpdwColor0xff000000 );    
p2DRender->TextOut- (int)(((float)nCharMP 2.0f) * size.cx), lpMP->rect.top nTopGapcbufMpdwColor0xff000000 );
p2DRender->TextOut- (int)(((float)nCharFP 2.0f) * size.cx), lpFP->rect.top nTopGapcbufFpdwColor0xff000000 );

nCharHP wsprintf(cbufHp"%d"GetMaxHitPoints);
nCharMP wsprintf(cbufMp"%d"pMover->GetMaxManaPoint());
nCharFP wsprintf(cbufFp"%d"pMover->GetMaxFatiguePoint());

if( 
GetMaxHitPoints 10000 )
    
nCharHP wsprintf(cbufHp"%dk"GetMaxHitPoints 1000);
else if( 
GetMaxHitPoints 1000000 )
    
nCharHP wsprintf(cbufHp"%dm"GetMaxHitPoints 100000);

lpHP->rect.right 30;
p2DRender->TextOut- (int)(((float)nCharHP 2.0f) * size.cx), lpHP->rect.top nTopGapcbufHpdwColor0xff000000 );
p2DRender->TextOut- (int)(((float)nCharMP 2.0f) * size.cx), lpMP->rect.top nTopGapcbufMpdwColor0xff000000 );
p2DRender->TextOut- (int)(((float)nCharFP 2.0f) * size.cx), lpFP->rect.top nTopGapcbufFpdwColor0xff000000 );
    
LPWNDCTRL lpHP GetWndCtrlWIDC_CUSTOM1 );
int nWidthCustom lpHP->rect.Width();
int nGap = (int)( ((nWidthCustom 2.0f) + (size.cx 2.0f)) );

p2DRender->TextOutlpHP->rect.right nGaplpHP->rect.top nTopGap"/"dwColor0xff000000 );
p2DRender->TextOutlpMP->rect.right nGaplpMP->rect.top nTopGap"/"dwColor0xff000000 );
p2DRender->TextOutlpFP->rect.right nGaplpFP->rect.top nTopGap"/"dwColor0xff000000 ); 
02/17/2016 12:28 RaizouEPVP#28
n1 kriegst dafür ein thanks =)!
04/27/2023 09:44 gmnac#29
thankyou so much