Mirage Engine
Variable Required issue... - Printable Version

+- Mirage Engine (https://mirage-engine.uk/forums)
+-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61)
+--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18)
+---- Forum: General (https://mirage-engine.uk/forums/forumdisplay.php?fid=17)
+---- Thread: Variable Required issue... (/showthread.php?tid=1977)



Variable Required issue... - DarkC - 28-07-2008

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



Re: Variable Required issue... - Dragoons Master - 28-07-2008

What's sx ?


Re: Variable Required issue... - DarkC - 28-07-2008

A damage variable.