Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Variable Required issue...
#1
Ok, well I'm trying to make it so they player's HP will be displayed above their heads in text. But I keep getting a error when I am running the client...It keeps highlighting "GetPlayerHP" in the TextX = GetPlayerX line...This is what the errors says "Variable required - can't assign to this expression". I've never gotten this error before, so I have no clue what to do.

Code:
Sub BltPlayerHP(ByVal Index As Long)
Dim TextX As Long
Dim TextY As Long
Dim Color As Long

    ' Set Color HP is displayed in
    If GetPlayerHP(Index) = 0 Then
        Color = QBColor(DarkGray)
            Else
        Color = QBColor(BrightGreen)
    End If
    
  
    ' Draw player HP
    TextX = GetPlayerX(Index) * PIC_X + sx + Player(Index).XOffset + Int(PIC_X / 3) - ((Len(GetPlayerHP(Index)) / 2) * 8)
    TextY = GetPlayerY(Index) * PIC_Y + sx + Player(Index).YOffset - Int(PIC_Y / 3) - (SIZE_Y - PIC_Y)
    Call DrawText(TexthDC, TextX - (NewPlayerX * PIC_X) - NewXOffset, TextY - (NewPlayerY * PIC_Y) - NewYOffset, GetPlayerHP(Index), Color)
End Sub
Reply
#2
What's sx ?
Reply
#3
A damage variable.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)