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

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

Ver o tópico anterior Ver o tópico seguinte Ir para baixo  Mensagem [Página 1 de 1]

1Sistema de Guild 1.0 Empty Sistema de Guild 1.0 12/10/2012, 04:14

Myke ~

Myke ~
Membro Honorário I
Membro Honorário I
Exemplo:

Guild = Wars Guild
Nome = Eduardo - lv: 30


Client~Side

frmMain crie 3 TextBox , e 1 CommandButton

CommandButton
Nome: cmbGuild
Caption : Criar Guild


Dentro do cmbGuild coloque:

Código:
SendCriaGuild txtNome.text, txtGuildNome.text, txtGuildAcesso.text
SendRequestPlayerData

TextBox
Nome: txtNome

TextBox 2
Nome:txtGuildNome

TextBox 3
Nome:txtGuildAcesso


no fim do ModText coloque:

Código:
Public Sub DrawPlayerGuild(ByVal Index As Long)
Dim TextX As Long
Dim TextY As Long
Dim color As Long
Dim Guild As String

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

Select Case GetPlayerGuildAccesso(Index)
Case 0
color = QBColor(Black)
Case 1
color = QBColor(Green)
Case 2
color = QBColor(Cyan)
Case 3
color = QBColor(Green)
Case 4
color = QBColor(White)
End Select

Guild = Trim$(Player(Index).Guild)
' calc pos
TextX = ConvertMapX(GetPlayerX(Index) * PIC_X) + Player(Index).XOffset + (PIC_X \ 2) - getWidth(TexthDC, (Trim$(Guild)))
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) + 3
End If

' Draw name
Call DrawText(TexthDC, TextX, TextY, Guild, color)

' Error handler
Exit Sub
errorhandler:
HandleError "DrawPlayerGuild", "modText", Err.Number, Err.Description, Err.Source, Err.HelpContext
Err.Clear
Exit Sub
End Sub

Procure por: no ModTypes - PlayerRec

Código:
PK As Byte

Abaixo Coloque:

Código:
Guild As String

e:

Código:
GuildAcesso As Byte

Agora no final do modClientTCP coloque:

Código:
Sub SendCriaGuild(ByVal Nome As String, ByVal Guild As String, ByVal Acesso As Byte)
Dim Buffer As clsBuffer

Set Buffer = New clsBuffer

Buffer.WriteLong CGuild
Buffer.WriteString Nome
Buffer.WriteString Guild
Buffer.WriteByte Acesso
SendData Buffer.ToArray()

Set Buffer = Nothing
End Sub

No Final do ModDataBase Coloque:

Código:
Function GetPlayerGuild(ByVal Index As Long) As String
' If debug mode, handle error then exit out
If Options.Debug = 1 Then On Error GoTo errorhandler

If Index > MAX_PLAYERS Then Exit Function
GetPlayerGuild = Trim$(Player(Index).Guild)

' Error handler
Exit Function
errorhandler:
HandleError "GetPlayerGuild", "modDatabase", Err.Number, Err.Description, Err.Source, Err.HelpContext
Err.Clear
Exit Function
End Function

Sub SetPlayerGuild(ByVal Index As Long, ByVal Guild As String) ' lol 4 hora nem vi kk
' If debug mode, handle error then exit out
If Options.Debug = 1 Then On Error GoTo errorhandler

If Index > MAX_PLAYERS Then Exit Sub
Player(Index).Guild = Guild

' Error handler
Exit Sub
errorhandler:
HandleError "SetPlayerGuild", "modDatabase", Err.Number, Err.Description, Err.Source, Err.HelpContext
Err.Clear
Exit Sub
End Sub

Function GetPlayerGuildAcesso(ByVal Index As Long) As Byte
' If debug mode, handle error then exit out
If Options.Debug = 1 Then On Error GoTo errorhandler

If Index > MAX_PLAYERS Then Exit Function
GetPlayerGuildAcesso = Trim$(Player(Index).GuildAcesso)

' Error handler
Exit Function
errorhandler:
HandleError "GetPlayerGuildAcesso ", "modDatabase", Err.Number, Err.Description, Err.Source, Err.HelpContext
Err.Clear
Exit Function
End Function

Sub SetPlayerGuildAcesso(ByVal Index As Long, ByVal GuildAcesso As Byte)
' If debug mode, handle error then exit out
If Options.Debug = 1 Then On Error GoTo errorhandler

If Index > MAX_PLAYERS Then Exit Sub
Player(Index).GuildAcesso = GuildAcesso

' Error handler
Exit Sub
errorhandler:
HandleError "SetPlayerGuildGuildAcesso", "modDatabase", Err.Number, Err.Description, Err.Source, Err.HelpContext
Err.Clear
Exit Sub
End Sub

Procure por:

Código:
' draw player names
For i = 1 To Player_HighIndex
If IsPlaying(i) And GetPlayerMap(i) = GetPlayerMap(MyIndex) Then
Call DrawPlayerName(i)
End If
Next

Mude para:

Código:
 ' draw player names
For i = 1 To Player_HighIndex
If IsPlaying(i) And GetPlayerMap(i) = GetPlayerMap(MyIndex) Then
Call DrawPlayerName(i)
Call DrawPlayerGuild(i)
End If
Next

Procure por:

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

Acima coloque:

Código:
CGuild

Procure por:

Código:
Call SetPlayerPK(i, Buffer.ReadLong)

Abaixo Coloque:

Código:
Call SetPlayerGuild(i, Buffer.ReadString)

E:

Código:
Call SetPlayerGuildAcesso(i, Buffer.ReadByte)

Fim do Client agora vamos ao Server~Side

Procure por:

Código:
Buffer.WriteString GetPlayerAccess(index)

Abaixo Coloque:

Código:
Buffer.WriteString GetPlayerGuild(index)

E:

Código:
Buffer.WriteByte GetPlayerGuildAcesso(index)

Procure por :

Código:
PK as Byte

abaixo coloca:

Código:
Guild As String

E:

Código:
GuildAcesso as Byte

procure por:

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

acima coloca:

Código:
CGuild

No final do ModDataBase coloca:

Código:
Function GetPlayerGuild(ByVal index As Long) As String

If index > MAX_PLAYERS Then Exit Function
GetPlayerGuild = Trim$(Player(index).Guild)
End Function

Sub SetPlayerGuild(ByVal index As Long, ByVal Guild As String)
Player(index).Guild = Guild
End Sub

E:

Código:
Function GetPlayerGuildAcesso(ByVal index As Long) As Byte

If index > MAX_PLAYERS Then Exit Function
GetPlayerGuildAcesso = Trim$(Player(index).GuildAcesso)
End Function

Sub SetPlayerGuildAcesso(ByVal index As Long, ByVal GuildAcesso As Byte)
Player(index).GuildAcesso = GuildAcesso
End Sub

Procure por:

Código:
Player(index).Class = ClassNum

abaixo coloque:

Código:
Player(index).Guild = vbNullString

Procure por:

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

abaixo coloca:

Código:
HandleDataSub(CGuild) = GetAddress(AddressOf HandleGuild)

Agora no final do HandleData coloque:

Código:
Public Sub HandleGuild(ByVal index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)
Dim Buffer As New clsBuffer
Dim Guild As String
Dim Nome As String
Dim Acesso As Byte

Set Buffer = New clsBuffer
Buffer.WriteBytes Data()

Nome = FindPlayer(Buffer.ReadString)
Guild = Buffer.ReadString
Acesso = Buffer.ReadByte

If Nome = 0 Then
PlayerMsg index, "O Jogador Selecionado não está online", Red
Exit Sub
End If

If GetPlayerGuild(Nome) <> vbNullString Then
PlayerMsg index, "O Jogador já Esta Em Uma guild!", Red
Exit Sub
End If

SetPlayerGuild Nome, Guild,Acesso
PlayerMsg index, "Sua guild: " & Guild & " - Acesso: " & Acesso, Red
Set Buffer = Nothing
End Sub

Server~Side Terminada Sistema Finalizado

Créditos ~
Eduardo por Criar
M.Dutra por incentivar
Eu por Postar

2Sistema de Guild 1.0 Empty Re: Sistema de Guild 1.0 21/12/2012, 08:39

AlexsandroChaos

AlexsandroChaos
Membro I
Membro I
da erro

http://gameplayswordartonline.blogspot.com.br/?view=flipcard

3Sistema de Guild 1.0 Empty Re: Sistema de Guild 1.0 21/12/2012, 12:22

newbie123

newbie123
Membro Honorário III
Membro Honorário III
Primeiramente você reviveu o topico mas como foi por um erro então só 1 alerta, qual foi o erro para que possamos ajudar a resolver.

4Sistema de Guild 1.0 Empty Re: Sistema de Guild 1.0 21/12/2012, 19:38

AlexsandroChaos

AlexsandroChaos
Membro I
Membro I
newbie123 escreveu:Primeiramente você reviveu o topico mas como foi por um erro então só 1 alerta, qual foi o erro para que possamos ajudar a resolver.
da esse erro na hora de compilar o client.(uso EO 2.0)
[Tens de ter uma conta e sessão iniciada para poderes visualizar esta imagem]

http://gameplayswordartonline.blogspot.com.br/?view=flipcard

5Sistema de Guild 1.0 Empty Re: Sistema de Guild 1.0 21/12/2012, 20:22

Warrior

Warrior
Ajudante
Ajudante
Aqui no meu pc ta com a qualidade da imagem muito ruim e so aqui no meu se nao for arrume a imagem.

6Sistema de Guild 1.0 Empty Re: Sistema de Guild 1.0 21/12/2012, 22:25

AlexsandroChaos

AlexsandroChaos
Membro I
Membro I
Warrior_Maker escreveu:Aqui no meu pc ta com a qualidade da imagem muito ruim e so aqui no meu se nao for arrume a imagem.
ve se assim esta melhor[Tens de ter uma conta e sessão iniciada para poderes visualizar esta imagem]

http://gameplayswordartonline.blogspot.com.br/?view=flipcard

7Sistema de Guild 1.0 Empty Re: Sistema de Guild 1.0 21/12/2012, 23:05

newbie123

newbie123
Membro Honorário III
Membro Honorário III
Nuss tutorial mais fail, man vamos fazer assim vou postar um tutorial de sistema de guild que eu achei, ai eu posto ele e muito grande, mas se preferir eu mesmo crio um e posto. xD A e sobre o erro voce fez o tutorial completo? ou fez uns codigos ai foi compilar pra ver se dava certo?

8Sistema de Guild 1.0 Empty Re: Sistema de Guild 1.0 22/12/2012, 06:49

AlexsandroChaos

AlexsandroChaos
Membro I
Membro I
newbie123 escreveu:Nuss tutorial mais fail, man vamos fazer assim vou postar um tutorial de sistema de guild que eu achei, ai eu posto ele e muito grande, mas se preferir eu mesmo crio um e posto. xD A e sobre o erro voce fez o tutorial completo? ou fez uns codigos ai foi compilar pra ver se dava certo?
Eu fiz o tutorial td e na hr de compilar deu erro , posta sim o sistema da guild.eu achei outro sistema de guild ele ate funfo mas num aparece o nome da guild emcima do nome, se vc poder posta o seu ou um melhor eu agradeço.
By:Seu fã

http://gameplayswordartonline.blogspot.com.br/?view=flipcard

Conteúdo patrocinado


Ver o tópico anterior Ver o tópico seguinte Ir para o topo  Mensagem [Página 1 de 1]

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