01-02-2009, 10:11 PM
Trying to render the guild name over players head, and it doesn't seem to want to work.
![[Image: Error.jpg]](http://i168.photobucket.com/albums/u200/Majora-59901/Error.jpg)
![[Image: Error.jpg]](http://i168.photobucket.com/albums/u200/Majora-59901/Error.jpg)
Code:
TexthDC = DDS_BackBuffer.GetDC ' Lock the backbuffer so we can draw text and names
Code:
For i = 1 To PlayersOnMapHighIndex
Call DrawPlayerGuild(PlayersOnMap(i))
Next
Code:
Sub DrawPlayerGuild(ByVal Index As Long)
Dim TextX As Long
Dim TextY As Long
Dim Color As Long
' Check guild rank level to determine color
If GetPlayerPK(Index) = NO Then
Select Case Player(Index).GuildRank
Case 0
Color = QBColor(Brown)
Case 1
Color = QBColor(DarkGrey)
Case 2
Color = QBColor(Cyan)
Case 3
Color = QBColor(Blue)
Case 4
Color = QBColor(Pink)
End Select
Else
Color = QBColor(BrightRed)
End If
' Determine location for text
TextX = GetPlayerX(Index) * PIC_X + Player(Index).XOffset + (PIC_X \ 2) - ((Len(GetPlayerName(Index)) / 2) * 8)
TextY = GetPlayerY(Index) * PIC_Y + Player(Index).YOffset - (PIC_Y \ 2) - 2
' Draw name
Call DrawText(TexthDC, TextX, TextY, GetPlayerGuild(Index), Color)
End Sub