Conexão Maker

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

    Item por gênero Male/Female

    Thales12
    Thales12
    Administrador
    Administrador


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

    Item por gênero Male/Female Empty Item por gênero Male/Female

    Mensagem por Thales12 Qua Fev 15, 2012 3:02 am

    Uma característica muito simples, e meu primeiro solo editar. Qualquer palavra de sabedoria seria muito bem recebido.

    0-Male (Masculino)
    1-Female (Mulher)
    2-Both (Os dois)


    Client side /////

    Abra frmEditor_Item e adicionar um HScrlBar logo abaixo do Nível de Req. barra de rolagem.
    Nome este scrlSexReq e defina o Max a 2.

    Criar uma label para a esquerda dessa barra de rolagem.
    Nomeá-lo lblSexReq e definir a legenda para "Sex req: 0".

    Em seguida, dê um duplo clique na sua barra de rolagem novo e adicione isso no sub selecionado:

    Código:
    ' If debug mode, handle error then exit out
     If Options.Debug = 1 Then On Error GoTo errorhandler
     
     If EditorIndex = 0 Or EditorIndex > MAX_ITEMS Then Exit Sub
     lblSexReq.Caption = "Sex req: " & scrlSexReq.Value
     Item(EditorIndex).SexReq = scrlSexReq.Value
     
     ' Error handler
     Exit Sub
     errorhandler:
     HandleError "scrlSexReq_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext
     Err.Clear
     Exit Sub

    Então, em modDatabase, adicionar esta função em algum lugar:

    Código:
    Function GetPlayerSex(ByVal Index As Long) As Long
     ' If debug mode, handle error then exit out
     If Options.Debug = 1 Then On Error GoTo errorhandler
     
     If Index > MAX_PLAYERS Then Exit Function
     GetPlayerSex = Player(Index).Sex
     
     ' Error handler
     Exit Function
     errorhandler:
     HandleError "GetPlayerSex", "modDatabase", Err.Number, Err.Description, Err.Source, Err.HelpContext
     Err.Clear
     Exit Function
     End Function

    Em modGameEditors, adicione isso ao ItemEditorInit (em "Basic requirements)
    Código:
    frmEditor_Item.scrlSexReq.Value = .SexReq

    Em modTypes adicionar este na parte inferior da Private Type ItemRec
    Código:
    SexReq As Byte

    E isto sob Private Type PlayerRec
    Código:
    Sex As Byte

    Agora no


    SERVER SIDE//////

    Em modPlayer adicionar esta função em algum lugar
    Código:
    Function GetPlayerSex(ByVal index As Long) As Long
     
     If index > MAX_PLAYERS Then Exit Function
     GetPlayerSex = Player(index).Sex
     End Function

    e também em modPlayer,Você deve procurar Public Sub UseItem
    Código:
    Select Case Item(itemnum).Type

    apenas algumas linhas para baixo.

    Agora coloque esse código sob a casos que você quer o atributo exigência de sexo para ser ativo no. Em qualquer caso em que você não coloca isso, o SexReq será arbitrária.
    Código:
    ' sex requirement
     If Item(itemnum).SexReq < 2 And GetPlayerSex(index) <> Item(itemnum).SexReq Then
     PlayerMsg index, "You are not the right sex to equip this item.", BrightRed
     Exit Sub
     End If

    E finalmente,em modTypes adicionar este na parte inferior da Private Type ItemRec
    Código:
    SexReq As Byte

    Pronto só issu mesmo,usei google translate não sei sé está certo.

    Creditos

    Darkpeople196 (por postar.)
    Repercussionist (pelo Tutorial)

      Data/hora atual: Qui Mar 28, 2024 1:43 pm