Bem vindo visitante.
Caso ainda não tenha uma conta,pedimos para que crie uma,assim você terá acesso a todos os links e imagens disponíveis no fórum.
Bem vindo visitante.
Caso ainda não tenha uma conta,pedimos para que crie uma,assim você terá acesso a todos os links e imagens disponíveis no fórum.

Você não está conectado. Conecte-se ou registre-se

Titulo por nível

Ir para baixo  Mensagem [Página 1 de 1]

1Titulo por nível Empty Titulo por nível Qua Fev 15, 2012 11:39 pm

Terabin

Terabin
Administrador
Administrador

Este tutorial fará com que mostre um "titulo" acima do nome do personagem,dependendo do nível dele.

Vá no final de modText e coloque:
Código:

Public Sub DrawPlayerTitulo(ByVal Index As Long)
Dim TextX As Long
Dim TextY As Long
Dim rankcolor As Long
Dim Rank As String


    If Options.Debug = 1 Then On Error GoTo errorhandler


    rankcolor = QBColor(Green)

    If Player(Index).Level > 0 Then
    titulo = "Cara verde"
    Else
End If

    If Player(Index).Level > 5 Then
    titulo = "Pokemon"
    Else
    End If

    Rank = titulo


    TextX = ConvertMapX(GetPlayerX(Index) * PIC_X) + Player(Index).XOffset + (PIC_X \ 2) - getWidth(TexthDC, (Trim$(Rank)))
    If GetPlayerSprite(Index) < 1 Or GetPlayerSprite(Index) > NumCharacters Then
        TextY = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - 16
    Else

        TextY = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - (DDSD_Character(GetPlayerSprite(Index)).lHeight / 4) + 6
    End If


    Call DrawText(TexthDC, TextX, TextY, Rank, rankcolor)
   
    ' Error handler
    Exit Sub
errorhandler:
    HandleError "DrawPlayerTitulo", "modText", Err.Number, Err.Description, Err.Source, Err.HelpContext
    Err.Clear
    Exit Sub
End Sub

Em seguida,no modDirectDraw procure por:
Código:
    For i = 1 To Player_HighIndex
        If IsPlaying(i) And GetPlayerMap(i) = GetPlayerMap(MyIndex) Then
            Call DrawPlayerName(i)
        End If
    Next

Abaixo adicione:
Código:
    For i = 1 To Player_HighIndex
        If IsPlaying(i) And GetPlayerMap(i) = GetPlayerMap(MyIndex) Then
            Call DrawPlayerTitulo(i)
        End If
    Next


Explicando:
Código:

    If Player(Index).Level > 5 Then
    titulo = "Pokemon"
    Else
    End If

Se o jogador for nível maior que cinco.
Mostrar acima do nome dele "Pokemon".

https://pokepokepoke.forumeiros.com

Ir para o topo  Mensagem [Página 1 de 1]

Permissões neste sub-fórum
Não podes responder a tópicos