iHero Posted July 15, 2012 Author Share Posted July 15, 2012 **Image**![](http://img217.imageshack.us/img217/6056/54195444.png)**Client~Side**> modDirectDraw7Search for:```Public DDS_Bars As DirectDrawSurface7```Below add:```Public DDS_Hud As DirectDrawSurface7```Search for:```Public DDSD_Bars As DDSURFACEDESC2```Below add:```Public DDSD_Hud As DDSURFACEDESC2```Search for:``` If FileExist(App.Path & "\data files\graphics\bars.bmp", True) Then Call InitDDSurf("bars", DDSD_Bars, DDS_Bars)```Below add:``` If FileExist(App.Path & "\data files\graphics\hud.bmp", True) Then Call InitDDSurf("hud", DDSD_Hud, DDS_Hud)```Search for:``` ' Render the bars BltBars```Below add:``` ' Render the hud BltHud```At the end of the module add:```Sub BltHud()Dim HealthRec As RECT, SpiritRec As RECT, ExperienceRec As RECT, SpriteRec As RECT ' Health With HealthRec .top = 0 .Bottom = 5 .Left = 0 .Right = ((GetPlayerVital(MyIndex, Vitals.HP) / DDSD_Hud.lWidth) / (GetPlayerMaxVital(MyIndex, Vitals.HP) / DDSD_Hud.lWidth)) * DDSD_Hud.lWidth End With Call DDS_BackBuffer.BltFast(Camera.Left + 40, Camera.top + 16, DDS_Hud, HealthRec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY) ' Spirit With SpiritRec .top = 5 .Bottom = 10 .Left = 0 .Right = ((GetPlayerVital(MyIndex, Vitals.mp) / DDSD_Hud.lWidth) / (GetPlayerMaxVital(MyIndex, Vitals.mp) / DDSD_Hud.lWidth)) * DDSD_Hud.lWidth End With Call DDS_BackBuffer.BltFast(Camera.Left + 40, Camera.top + 22, DDS_Hud, SpiritRec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY) ' Experience With ExperienceRec .top = 10 .Bottom = 15 .Left = 0 .Right = ((GetPlayerExp(MyIndex) / DDSD_Hud.lWidth) / (GetPlayerNextLevel / DDSD_Hud.lWidth)) * DDSD_Hud.lWidth End With Call DDS_BackBuffer.BltFast(Camera.Left + 40, Camera.top + 28, DDS_Hud, ExperienceRec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY) ' Sprite With SpriteRec .top = 0 .Bottom = DDSD_Character(GetPlayerSprite(MyIndex)).lHeight / 4 .Left = 0 .Right = DDSD_Character(GetPlayerSprite(MyIndex)).lWidth / 4 End With Call DDS_BackBuffer.BltFast(Camera.Left + 5, Camera.top + 5, DDS_Character(GetPlayerSprite(MyIndex)), SpriteRec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY) ' Error handler Exit Suberrorhandler: HandleError "BltHud", "modDirectDraw7", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit SubEnd Sub```> modGlobalsAt the end of the module add:```' experiencePublic GetPlayerNextLevel As Long```> modHandleDataChange _Sub HandlePlayerExp_ to:```Private Sub HandlePlayerExp(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)Dim Buffer As clsBufferDim i As Long ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler Set Buffer = New clsBuffer Buffer.WriteBytes Data() SetPlayerExp MyIndex, Buffer.ReadLong GetPlayerNextLevel = Buffer.ReadLong frmMain.lblEXP.Caption = GetPlayerExp(Index) & "/" & GetPlayerNextLevel ' mp bar frmMain.imgEXPBar.Width = ((GetPlayerExp(MyIndex) / EXPBar_Width) / (GetPlayerNextLevel / EXPBar_Width)) * EXPBar_Width ' Error handler Exit Suberrorhandler: HandleError "HandlePlayerExp", "modHandleData", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit SubEnd Sub```**Anexo**![](http://img339.imageshack.us/img339/3038/hudi.png)_Save the folder datafiles/graphics in the format. bmp_**Credits**iHero Link to comment Share on other sites More sharing options...
Wortel Angels Posted July 15, 2012 Share Posted July 15, 2012 Umm…For what is that now exactly?And HP / MP / EXP bar is already there Link to comment Share on other sites More sharing options...
iHero Posted July 15, 2012 Author Share Posted July 15, 2012 Some people prefer that. Link to comment Share on other sites More sharing options...
hb420 Posted July 18, 2012 Share Posted July 18, 2012 I assume this is not visible by other players? Link to comment Share on other sites More sharing options...
Whackeddie99 Posted July 18, 2012 Share Posted July 18, 2012 @hb420:> I assume this is not visible by other players?No, it shows you your player and your player's HP, MP, and EXP. Works fine, but the bars are really small and don't display actual numbers. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now