Mudando a Cor de Algumas coisas

    Compartilhe
    avatar
    Thales12
    Administrador
    Administrador

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

    default Mudando a Cor de Algumas coisas

    Mensagem por Thales12 em Qua Fev 15, 2012 2:46 am

    ao pedido do castiel .. vamos la ..

    Server~Side:

    Mudando a cor da fala no global:

    procure por:

    Código:
    Private Sub HandleBroadcastMsg(ByVal index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)
        Dim Msg As String
        Dim s As String
        Dim i As Long
        Dim Buffer As clsBuffer
        Set Buffer = New clsBuffer
        Buffer.WriteBytes Data()
        Msg = Buffer.ReadString

        ' Prevent hacking
        For i = 1 To Len(Msg)

            If AscW(Mid$(Msg, i, 1)) < 32 Or AscW(Mid$(Msg, i, 1)) > 126 Then
                Exit Sub
            End If

        Next

        s = "[Global]" & GetPlayerName(index) & ": " & Msg
        Call SayMsg_Global(index, Msg, QBColor(White))
        Call AddLog(s, PLAYER_LOG)
        Call TextAdd(s)
       
        Set Buffer = Nothing
    End Sub

    e na linha:

    Código:
    Call SayMsg_Global(index, Msg, QBColor(White))

    onde ta :

    White

    so mudar para a cor q tu quer..

    Mudando a cor da fala no mapa:

    procure por:

    Código:
    ' ::::::::::::::::::::
    ' :: Social packets ::
    ' ::::::::::::::::::::
    Private Sub HandleSayMsg(ByVal index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)
        Dim Msg As String
        Dim i As Long
        Dim Buffer As clsBuffer
        Set Buffer = New clsBuffer
        Buffer.WriteBytes Data()
        Msg = Buffer.ReadString

        ' Prevent hacking
        For i = 1 To Len(Msg)
            ' limit the ASCII
            If AscW(Mid$(Msg, i, 1)) < 32 Or AscW(Mid$(Msg, i, 1)) > 126 Then
                ' limit the extended ASCII
                If AscW(Mid$(Msg, i, 1)) < 128 Or AscW(Mid$(Msg, i, 1)) > 168 Then
                    ' limit the extended ASCII
                    If AscW(Mid$(Msg, i, 1)) < 224 Or AscW(Mid$(Msg, i, 1)) > 253 Then
                        Mid$(Msg, i, 1) = ""
                    End If
                End If
            End If
        Next

        Call AddLog("Map #" & GetPlayerMap(index) & ": " & GetPlayerName(index) & " says, '" & Msg & "'", PLAYER_LOG)
        Call SayMsg_Map(GetPlayerMap(index), index, Msg, QBColor(White))
       
        Set Buffer = Nothing
    End Sub

    e na linha:

    Código:
    Call SayMsg_Map(GetPlayerMap(index), index, Msg, QBColor(White))

    onde ta :

    White

    so mudar para a cor q tu quer.

    Client~Side:

    mudando a cor do acesso de adm e do player normal:

    procure por:

    Código:
    Public Sub DrawPlayerName(ByVal Index As Long)
    Dim TextX As Long
    Dim TextY As Long
    Dim color As Long
    Dim Name 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)
        ' 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

        ' Draw name
        Call DrawText(TexthDC, TextX, TextY, Name, color)
       
        ' Error handler
        Exit Sub
    errorhandler:
        HandleError "DrawPlayerName", "modText", Err.Number, Err.Description, Err.Source, Err.HelpContext
        Err.Clear
        Exit Sub
    End Sub

    e na linha:

    Código:
    color = QBColor(Yellow)

    aonde ta:

    ai vai mudar a do adm:

    Yellow

    mude para a cor q vc quer..

    a do player ein:


    Código:
     color = RGB(255, 96, 0)

    mude para:

    Código:
    color = QBColor(DarkGrey)

    so por a cor q tu quer, ou se prefirir ali no, 255, 96, 0, so tu ir configurando ate ficar a cor q tu quer..

    mudando a cor do nome do npc:
    procure por:

    Código:
    Public Sub DrawNpcName(ByVal Index As Long)
    Dim TextX As Long
    Dim TextY As Long
    Dim color As Long
    Dim Name As String
    Dim npcNum As Long

        ' If debug mode, handle error then exit out
        If Options.Debug = 1 Then On Error GoTo errorhandler

        npcNum = MapNpc(Index).num

        Select Case Npc(npcNum).Behaviour
            Case NPC_BEHAVIOUR_ATTACKONSIGHT
                color = QBColor(BrightRed)
            Case NPC_BEHAVIOUR_ATTACKWHENATTACKED
                color = QBColor(Yellow)
            Case NPC_BEHAVIOUR_GUARD
                color = QBColor(Grey)
            Case Else
                color = QBColor(BrightGreen)
        End Select

        Name = Trim$(Npc(npcNum).Name)
        TextX = ConvertMapX(MapNpc(Index).x * PIC_X) + MapNpc(Index).XOffset + (PIC_X \ 2) - getWidth(TexthDC, (Trim$(Name)))
        If Npc(npcNum).Sprite < 1 Or Npc(npcNum).Sprite > NumCharacters Then
            TextY = ConvertMapY(MapNpc(Index).y * PIC_Y) + MapNpc(Index).YOffset - 16
        Else
            ' Determine location for text
            TextY = ConvertMapY(MapNpc(Index).y * PIC_Y) + MapNpc(Index).YOffset - (DDSD_Character(Npc(npcNum).Sprite).lHeight / 4) + 16
        End If

        ' Draw name
        Call DrawText(TexthDC, TextX, TextY, Name, color)
       
        ' Error handler
        Exit Sub
    errorhandler:
        HandleError "DrawNpcName", "modText", Err.Number, Err.Description, Err.Source, Err.HelpContext
        Err.Clear
        Exit Sub
    End Sub

    e nas linhas:

    Código:
    Select Case Npc(npcNum).Behaviour
            Case NPC_BEHAVIOUR_ATTACKONSIGHT
                color = QBColor(BrightRed)
            Case NPC_BEHAVIOUR_ATTACKWHENATTACKED
                color = QBColor(Yellow)
            Case NPC_BEHAVIOUR_GUARD
                color = QBColor(Grey)
            Case Else
                color = QBColor(BrightGreen)
        End Select

    aonde ta:

    BrightRed, yellow, Grey, brightgreen

    so vc mudar para a cor q tu quer..

    Bom ai ta algumas coisas q tu pode mudar a cor ! Smile
    se quizer mudar a cor de mais alguma coisa so falar ai, q eu add no tuto ! Smile

    Créditos: A Mim Thales12

      Data/hora atual: Dom Out 21, 2018 1:57 am