Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.

[EEB]Vila em cima do nome do Player

2 participantes

Ir para baixo

[EEB]Vila em cima do nome do Player Empty [EEB]Vila em cima do nome do Player

Mensagem  DrayonDuarte Sex Set 07, 2012 9:39 pm

Bom Aqui vai um tuto para quem fez o Sistema de Vilas e quer colocar o nome da vila em cima do nome do player:

Bom Começando:

(Esse e para Sprites 32x32)

Procure por:

Código:
Call BltPlayerName(I)


Abaixo Adicione:

Código:
Call BltPlayerVilas(I)


Agora procure por essa sub:

Código:
Sub BltPlayerName(ByVal Index As Long)
Dim TextX As Long
Dim TextY As Long
Dim Color As Long
   
    ' Check access level
        If GetPlayerPK(Index) = NO Then
            Select Case GetPlayerAccess(Index)
                Case 0
                    Color = QBColor(Brown)
                Case 1
                    Color = QBColor(BrightBlue)
                Case 2
                    Color = QBColor(Grey)
                Case 3
                    Color = QBColor(Blue)
                Case 4
                    Color = QBColor(Pink)
            End Select
        Else
            Color = QBColor(BrightRed)
        End If
       
    ' Draw name
    TextX = GetPlayerX(Index) * PIC_X + sx + Player(Index).XOffset + Int(PIC_X / 2) - ((Len(GetPlayerName(Index)) / 2) * 8)
    TextY = GetPlayerY(Index) * PIC_Y + sx + Player(Index).YOffset - Int(PIC_Y / 2) - (SIZE_Y - PIC_Y)
    Call DrawText(TexthDC, TextX - (NewPlayerX * PIC_X) - NewXOffset, TextY - (NewPlayerY * PIC_Y) - NewYOffset, GetPlayerName(Index), Color)
End Sub


E em baixo sub adicone:

Código:
Sub BltPlayerVilas(ByVal Index As Long)
Dim TextX As Long
Dim TextY As Long
Dim Color As Long
   
    ' Check access level
    If GetPlayerPK(Index) = NO Then
        Select Case GetPlayerAccess(Index)
            Case 0 ' vila 1
                Color = QBColor(Brown)
            Case 1 ' vila 2
                Color = QBColor(Blue)
    End Select
    Else
        Color = QBColor(BrightRed) ' Vila quando ficar pk
    End If
       
    ' Draw VilaName
    TextX = GetPlayerX(Index) * PIC_X + sx + Player(Index).XOffset + Int(PIC_X / 2) - ((Len(GetPlayerVila(Index)) / 2) * 8)
    TextY = GetPlayerY(Index) * PIC_Y + sx + Player(Index).YOffset - Int(PIC_Y / 2) - 12
    Call DrawText(TexthDC, TextX - (NewPlayerX * PIC_X) - NewXOffset, TextY - (NewPlayerY * PIC_Y) - NewYOffset, GetPlayerVila(Index), Color)
End Sub


Agora procure por:

Código:
TextX = GetPlayerX(Index) * PIC_X + sx + Player(Index).XOffset + Int(PIC_X * 0.5) - ((Len(GetPlayerGuild(Index)) * 0.5) * 8)
    TextY = GetPlayerY(Index) * PIC_Y + sx + Player(Index).YOffset - Int(PIC_Y * 0.5) - 12


mude para:

Código:
TextX = GetPlayerX(Index) * PIC_X + sx + Player(Index).XOffset + Int(PIC_X * 0.5) - ((Len(GetPlayerGuild(Index)) * 0.5) * 8)
    TextY = GetPlayerY(Index) * PIC_Y + sx + Player(Index).YOffset - Int(PIC_Y * 0.5) - 25


(Esse e para Sprites 32x64)

Procure por:

Código:
Call BltPlayerName(I)


Abaixo Adicione:

Código:
Call BltPlayerVilas(I)


Agora procure por essa sub:

Código:
Sub BltPlayerName(ByVal Index As Long)
Dim TextX As Long
Dim TextY As Long
Dim Color As Long
   
    ' Check access level
        If GetPlayerPK(Index) = NO Then
            Select Case GetPlayerAccess(Index)
                Case 0
                    Color = QBColor(Brown)
                Case 1
                    Color = QBColor(BrightBlue)
                Case 2
                    Color = QBColor(Grey)
                Case 3
                    Color = QBColor(Blue)
                Case 4
                    Color = QBColor(Pink)
            End Select
        Else
            Color = QBColor(BrightRed)
        End If
       
    ' Draw name
    TextX = GetPlayerX(Index) * PIC_X + sx + Player(Index).XOffset + Int(PIC_X / 2) - ((Len(GetPlayerName(Index)) / 2) * 8)
    TextY = GetPlayerY(Index) * PIC_Y + sx + Player(Index).YOffset - Int(PIC_Y / 2) - (SIZE_Y - PIC_Y)
    Call DrawText(TexthDC, TextX - (NewPlayerX * PIC_X) - NewXOffset, TextY - (NewPlayerY * PIC_Y) - NewYOffset, GetPlayerName(Index), Color)
End Sub


E em baixo sub adicone:

Código:
Sub BltPlayerVilas(ByVal Index As Long)
Dim TextX As Long
Dim TextY As Long
Dim Color As Long
   
    ' Check access level
    If GetPlayerPK(Index) = NO Then
        Select Case GetPlayerAccess(Index)
            Case 0 ' vila 1
                Color = QBColor(Brown)
            Case 1 ' vila 2
                Color = QBColor(Blue)
    End Select
    Else
        Color = QBColor(BrightRed) ' Vila quando ficar pk
    End If
       
    ' Draw VilaName
    TextX = GetPlayerX(Index) * PIC_X + sx + Player(Index).XOffset + Int(PIC_X / 2) - ((Len(GetPlayerVila(Index)) / 2) * 8)
    TextY = GetPlayerY(Index) * PIC_Y + sx + Player(Index).YOffset - Int(PIC_Y / 2) - 45
    Call DrawText(TexthDC, TextX - (NewPlayerX * PIC_X) - NewXOffset, TextY - (NewPlayerY * PIC_Y) - NewYOffset, GetPlayerVila(Index), Color)
End Sub


Agora procure por:

Código:
TextX = GetPlayerX(Index) * PIC_X + sx + Player(Index).XOffset + Int(PIC_X * 0.5) - ((Len(GetPlayerGuild(Index)) * 0.5) * 8)
    TextY = GetPlayerY(Index) * PIC_Y + sx + Player(Index).YOffset - Int(PIC_Y * 0.5) - 45


mude para:

Código:
TextX = GetPlayerX(Index) * PIC_X + sx + Player(Index).XOffset + Int(PIC_X * 0.5) - ((Len(GetPlayerGuild(Index)) * 0.5) * 8)
    TextY = GetPlayerY(Index) * PIC_Y + sx + Player(Index).YOffset - Int(PIC_Y * 0.5) - 91


E Than esta pronto... aqui vai uma Screen:

[Apenas Administradores podem visualizar imagens]

Creditos:
Pablo
lucasvivo25~~Por Arrumar
DrayonDuarte
DrayonDuarte
Membro
Membro

Mensagens : 14
Agradecimentos : 1
Data de inscrição : 07/09/2012
Idade : 27
Localização : Caruaru - PE

Ir para o topo Ir para baixo

[EEB]Vila em cima do nome do Player Empty Re: [EEB]Vila em cima do nome do Player

Mensagem  Guiinholp Seg Out 01, 2012 3:14 pm

Man aki da erro

Código:
  ' Draw VilaName
    TextX = GetPlayerX(Index) * PIC_X + sx + Player(Index).XOffset + Int(PIC_X / 2) - ((Len(GetPlayerVila(Index)) / 2) * 8)

"GetPlayerVila(Index))"
Guiinholp
Guiinholp
Novato
Novato

Mensagens : 7
Agradecimentos : 1
Data de inscrição : 22/08/2012
Idade : 29

Ir para o topo Ir para baixo

Ir para o topo

- Tópicos semelhantes

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