Conexão Maker

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

    Teleporte por Imagem

    Thales12
    Thales12
    Administrador
    Administrador


    Mensagens : 140
    Level : 8
    Data de inscrição : 01/11/2011
    Idade : 29
    Localização : Rio de Janeiro

    Teleporte por Imagem Empty Teleporte por Imagem

    Mensagem por Thales12 Qua Fev 15, 2012 2:33 am

    Começando

    Va na pasta data files\graphics\ e crie uma nova pasta chamada imagens e dentro dela adicione 2 fotos uma com nome "1" , "2" sem aspas

    Client~Side

    Na frmMain crie 2 picture box com as configurações:

    Picture1

    Name: picTele1

    Picture2

    Name:
    picTele2


    Dentro da picTele1 adicione:

    Código:
        Call SendTele1


    E dentro da pic
    Tele2 adicione:

    Código:
        Call SendTele2


    E agora no final do modClientTcp adicione:

    Código:
    Public Sub SendTele1()
        Dim Buffer As clsBuffer
        Set Buffer = New clsBuffer
       
        Buffer.WriteLong CTele1
       
        SendData Buffer.ToArray()
        Set Buffer = Nothing
    End Sub

    Public Sub SendTele2()
        Dim Buffer As clsBuffer
        Set Buffer = New clsBuffer
       
        Buffer.WriteLong CTele2
       
        SendData Buffer.ToArray()
        Set Buffer = Nothing
    End Sub


    Em modEnumerations ache:

    Código:
        ' Make sure CMSG_COUNT is below everything else
        CMSG_COUNT


    E em cima adicione:

    Código:
        CTele1
        CTele2


    Agora procure por:

    Código:
        ' Make sure SMSG_COUNT is below everything else
        SMSG_COUNT


    E acima adicione:

    Código:
        SImagens


    Procure por:

    Código:
        HandleDataSub(SPartyVitals) = GetAddress(AddressOf HandlePartyVitals)


    E abaixo adicione:

    Código:
        HandleDataSub(SImagens) = GetAddress(AddressOf HandleImagens)


    Agora no final do modHandleData adicione:

    Código:
    Private Sub HandleImagens(ByVal Index As Long, ByRef Data() As Byte, ByVal EditorIndex As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)
        Dim Buffer As clsBuffer

        If GetPlayerClass(Index) = 1 Then
            frmMain.picTele1.Picture = LoadPicture(App.Path & "\data files\graphics\imagens\1.bmp")
            frmMain.picTele2.Picture = LoadPicture(App.Path & "\data files\graphics\imagens\2.bmp")
        ElseIf GetPlayerClass(Index) = 2 Then
            ' Aqui é se vocÊ quiser pro mais classes
        End If

        Set Buffer = Nothing
    End Sub


    Serve~Side

    Procure por:

    Código:
        HandleDataSub(CPartyLeave) = GetAddress(AddressOf HandlePartyLeave)


    E abaixo adicione:

    Código:
        HandleDataSub(CTele1) = GetAddress(AddressOf HandleTele1)
        HandleDataSub(CTele2) = GetAddress(AddressOf HandleTele2
    )

    E no final do modHandleData adicione:

    Código:
    Sub HandleTele1(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)
    Dim Buffer As clsBuffer
       
        If GetPlayerLevel(Index) >= 10 Then
            Call PlayerWarp(Index, 1, 2, 3) ' 1 é o mapa, 2 o X do mapa e 3 o Y do mapa
        End If
       
        Set Buffer = Nothing
    End Sub

    Sub HandleTele2(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)
    Dim Buffer As clsBuffer
       
        If GetPlayerLevel(Index) >= 10 Then
            Call PlayerWarp(Index, 1, 2, 3) ' 1 é o mapa, 2 o X do mapa e 3 o Y do mapa
        End If
       
        Set Buffer = Nothing
    End Sub


    Em modEnumerations ache:

    Código:
        ' Make sure CMSG_COUNT is below everything else
        CMSG_COUNT


    E em cima adicione:

    Código:
        CTele1
        CTele2


    Agora procure por:

    Código:
        ' Make sure SMSG_COUNT is below everything else
        SMSG_COUNT


    E acima adicione:

    Código:
        SImagens

    E no final do modServeTcp adicione:

    Código:
    Sub SendImagens(ByVal Index As Long)
    Dim Buffer As clsBuffer
       
        Set Buffer = New clsBuffer
        Buffer.WriteLong SImagens
       
        SendDataToMap GetPlayerMap(Index), Buffer.ToArray()
        Set Buffer = Nothing
    End Sub


    Procure por:

    Código:
        Call SendHotbar(Index)


    E abaixo adicione:

    Código:
        Call SendImagens(Index)


    Creditos:

    Ricardo

      Tópicos semelhantes

      -

      Data/hora atual: Sex Abr 26, 2024 12:07 pm