dthnote801 Posted March 22, 2011 Author Share Posted March 22, 2011 ![](http://i55.tinypic.com/1zvyaab.jpg)When initial start-up of the client, I get this error.RTE 13 mismatchIt's in this sub.```Public Sub DrawPlayerName(ByVal Index As Long)Dim TextX As LongDim TextY As LongDim color As LongDim Name As Long'Title SystemDim TitleX As LongDim TitleY As LongDim title As String ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler ' Check access level If GetPlayerPK(Index) = NO Then Select Case GetPlayerAccess(Index) Case 0 color = RGB(255, 96, 0) Case 1 color = QBColor(DarkGrey) Case 2 color = QBColor(Cyan) Case 3 color = QBColor(BrightGreen) Case 4 color = QBColor(Yellow) End Select Else color = QBColor(BrightRed) End If Name = Trim$(Player(Index).Name) 'Title System title = Trim$(Player(Index).CurTitle) ' calc pos TextX = ConvertMapX(GetPlayerX(Index) * PIC_X) + Player(Index).XOffset + (PIC_X \ 2) - getWidth(TexthDC, (Trim$(Name))) If GetPlayerSprite(Index) < 1 Or GetPlayerSprite(Index) > NumCharacters Then TextY = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - 16 Else ' Determine location for text TextY = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - (DDSD_Character(GetPlayerSprite(Index)).lHeight / 4) + 16 End If'Title System TitleX = ConvertMapX(GetPlayerX(Index) * PIC_X) + Player(Index).XOffset + (PIC_X \ 2) - getWidth(TexthDC, (Trim$(title))) If GetPlayerSprite(Index) < 1 Or GetPlayerSprite(Index) > NumCharacters Then TitleY = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - 4 Else ' Determine location for text TitleY = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - (DDSD_Character(GetPlayerSprite(Index)).lHeight / 4) + 4 End If ' Draw name Call DrawText(TexthDC, TextX, TextY, Name, color) 'Title System If title = "----" Then Exit Sub 'Draw Title Call DrawText(TexthDC, TitleX, TitleY, "[" & title & "]", color) ' Error handler Exit Suberrorhandler: HandleError "DrawPlayerName", "modText", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit SubEnd Sub``` Link to comment Share on other sites More sharing options...
Helladen Posted March 22, 2011 Share Posted March 22, 2011 Name needs to be a string.```Public Sub DrawPlayerName(ByVal Index As Long)Dim TextX As LongDim TextY As LongDim color As LongDim Name As String'Title SystemDim TitleX As LongDim TitleY As LongDim title As String ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler ' Check access level If GetPlayerPK(Index) = NO Then Select Case GetPlayerAccess(Index) Case 0 color = RGB(255, 96, 0) Case 1 color = QBColor(DarkGrey) Case 2 color = QBColor(Cyan) Case 3 color = QBColor(BrightGreen) Case 4 color = QBColor(Yellow) End Select Else color = QBColor(BrightRed) End If Name = Trim$(Player(Index).Name) 'Title System title = Trim$(Player(Index).CurTitle) ' calc pos TextX = ConvertMapX(GetPlayerX(Index) * PIC_X) + Player(Index).XOffset + (PIC_X \ 2) - getWidth(TexthDC, (Trim$(Name))) If GetPlayerSprite(Index) < 1 Or GetPlayerSprite(Index) > NumCharacters Then TextY = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - 16 Else ' Determine location for text TextY = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - (DDSD_Character(GetPlayerSprite(Index)).lHeight / 4) + 16 End If'Title System TitleX = ConvertMapX(GetPlayerX(Index) * PIC_X) + Player(Index).XOffset + (PIC_X \ 2) - getWidth(TexthDC, (Trim$(title))) If GetPlayerSprite(Index) < 1 Or GetPlayerSprite(Index) > NumCharacters Then TitleY = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - 4 Else ' Determine location for text TitleY = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - (DDSD_Character(GetPlayerSprite(Index)).lHeight / 4) + 4 End If ' Draw name Call DrawText(TexthDC, TextX, TextY, Name, color) 'Title System If title = "----" Then Exit Sub 'Draw Title Call DrawText(TexthDC, TitleX, TitleY, "[" & title & "]", color) ' Error handler Exit Suberrorhandler: HandleError "DrawPlayerName", "modText", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit SubEnd Sub``` Link to comment Share on other sites More sharing options...
dthnote801 Posted March 22, 2011 Author Share Posted March 22, 2011 @Helladen:> Name needs to be a string.> ```> Public Sub DrawPlayerName(ByVal Index As Long)> Dim TextX As Long> Dim TextY As Long> Dim color As Long> Dim Name As String> > 'Title System> Dim TitleX As Long> Dim TitleY As Long> Dim title As String> > ' If debug mode, handle error then exit out> If Options.Debug = 1 Then On Error GoTo errorhandler> > ' Check access level> If GetPlayerPK(Index) = NO Then> > Select Case GetPlayerAccess(Index)> Case 0> color = RGB(255, 96, 0)> Case 1> color = QBColor(DarkGrey)> Case 2> color = QBColor(Cyan)> Case 3> color = QBColor(BrightGreen)> Case 4> color = QBColor(Yellow)> End Select> > Else> color = QBColor(BrightRed)> End If> > Name = Trim$(Player(Index).Name)> > 'Title System> title = Trim$(Player(Index).CurTitle)> > ' calc pos> TextX = ConvertMapX(GetPlayerX(Index) * PIC_X) + Player(Index).XOffset + (PIC_X \ 2) - getWidth(TexthDC, (Trim$(Name)))> If GetPlayerSprite(Index) < 1 Or GetPlayerSprite(Index) > NumCharacters Then> TextY = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - 16> Else> ' Determine location for text> TextY = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - (DDSD_Character(GetPlayerSprite(Index)).lHeight / 4) + 16> End If> > 'Title System> TitleX = ConvertMapX(GetPlayerX(Index) * PIC_X) + Player(Index).XOffset + (PIC_X \ 2) - getWidth(TexthDC, (Trim$(title)))> If GetPlayerSprite(Index) < 1 Or GetPlayerSprite(Index) > NumCharacters Then> TitleY = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - 4> Else> ' Determine location for text> TitleY = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - (DDSD_Character(GetPlayerSprite(Index)).lHeight / 4) + 4> End If> > ' Draw name> Call DrawText(TexthDC, TextX, TextY, Name, color)> > 'Title System> If title = "----" Then Exit Sub> 'Draw Title> Call DrawText(TexthDC, TitleX, TitleY, "[" & title & "]", color)> > ' Error handler> Exit Sub> errorhandler:> HandleError "DrawPlayerName", "modText", Err.Number, Err.Description, Err.Source, Err.HelpContext> Err.Clear> Exit Sub> End Sub> ```D'oh, I didn't even bother to look at the variables. Thanks Helladen. Link to comment Share on other sites More sharing options...
crzyone9584 Posted March 22, 2011 Share Posted March 22, 2011 Mybad. I'll fix that in the tutorial. 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