Notsu Posted January 25, 2012 Author Share Posted January 25, 2012 I'm trying to do it by changing draw party health bars code but I don't know what I can replace as partyIndex to get it work for all players not only party members.Here's the code of draw party mini hp bars:``` ' draw party health bars If Party.Leader > 0 Then For i = 1 To MAX_PARTY_MEMBERS partyIndex = Party.Member(i) If (partyIndex > 0) And (partyIndex <> MyIndex) And (GetPlayerMap(partyIndex) = GetPlayerMap(MyIndex)) Then ' player exists If GetPlayerVital(partyIndex, Vitals.HP) > 0 And GetPlayerVital(partyIndex, Vitals.HP) < GetPlayerMaxVital(partyIndex, Vitals.HP) Then ' lock to Player tmpX = GetPlayerX(partyIndex) * PIC_X + Player(partyIndex).XOffset + 16 - (sWidth / 2) tmpY = GetPlayerY(partyIndex) * PIC_X + Player(partyIndex).YOffset + 35 ' calculate the width to fill barWidth = ((GetPlayerVital(partyIndex, Vitals.HP) / sWidth) / (GetPlayerMaxVital(partyIndex, Vitals.HP) / sWidth)) * sWidth ' draw bar background With sRECT .top = sHeight * 1 ' HP bar background .Left = 0 .Right = .Left + sWidth .Bottom = .top + sHeight End With Engine_BltFast ConvertMapX(tmpX), ConvertMapY(tmpY), DDS_Bars, sRECT, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY ' draw the bar proper With sRECT .top = 0 ' HP bar .Left = 0 .Right = .Left + barWidth .Bottom = .top + sHeight End With Engine_BltFast ConvertMapX(tmpX), ConvertMapY(tmpY), DDS_Bars, sRECT, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY End If End If Next End If```Thanks for reply. Link to comment Share on other sites More sharing options...
blkcrow Posted January 29, 2012 Share Posted January 29, 2012 you need to replace the partyindex with the index of the players in the map 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