Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Installing crzyone9584's title system [SOLVED]


dthnote801
 Share

Recommended Posts

![](http://i55.tinypic.com/1zvyaab.jpg)

When initial start-up of the client, I get this error.

RTE 13 mismatch

It's in this sub.
```
Public Sub DrawPlayerName(ByVal Index As Long)
Dim TextX As Long
Dim TextY As Long
Dim color As Long
Dim Name As Long

'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
```
Link to comment
Share on other sites

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
```
Link to comment
Share on other sites

@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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...