Lucas Roberto Administrador
Mensagens : 711
| Assunto: Sistema de Anuncio Qui 02 Fev 2017, 16:24 | |
| Sistema de Anuncio 1 Client~Side FrmMirage Crie uma PictureBox, dentro crie um TextBox e um botão em baixo. Com as Propriedades: - Código:
-
PictureBox: (Name) = picAnuncio Visible = False
TextBox: (Name) = txtAnuncio MultiLine = True Enabled = False
CommandButton: (Name) = cmdOk Caption = Okay Tente deixar como na imagem: Dois cliques no botão Okay e adicione: - Código:
-
picAnuncio.Visible = False Procure por: - Código:
-
' Refresh Player If LCase(Mid(MyText, 1, 10)) = "/atualizar" Then Call SendData("refresh" & END_CHAR) MyText = vbNullString Exit Sub End If Abaixo adicione: - Código:
-
' Anuncio If LCase(Mid(MyText, 1, 8)) = "/anuncio" Then If Player(MyIndex).Access >= 3 Then 'Ter certeza de que ele está mandando algo If Len(MyText) > 9 Then ChatText = Mid(MyText, 10, Len(MyText) - 9) Call SendAnuncio(ChatText) Else MyText = vbNullString Exit Sub End If End If Exit Sub End If Procure por: - Código:
-
If Parse(0) = "info" Then frmLogin.lblOnOff.Caption = "Online" frmLogin.lblOnOff.ForeColor = &HFF00& frmLogin.lblPlayers.Caption = Parse(1) & " Players Online" frmLogin.lblPlayers.Visible = True frmLogin.tmrInfo.Enabled = False Exit Sub End If Abaixo adicione: - Código:
-
' Packet de Anuncio If Parse(0) = "anuncio" Then frmMirage.txtAnuncio.Text = Parse(1) frmMirage.picAnuncio.Visible = True Exit Sub End If Procure por: - Código:
-
Sub SendRequestEditMap() Dim Packet As String
Packet = "REQUESTEDITMAP" & END_CHAR Call SendData(Packet) End Sub Abaixo adicione: - Código:
-
Sub SendAnuncio(ByVal Msg As String) Dim Packet As String
Packet = "ANUNCIO" & SEP_CHAR & Msg & END_CHAR Call SendData(Packet) End Sub Client Finish. Server~Side Procure por: - Código:
-
' ::::::::::::::::::::::::::::::: ' :: Packet de Edição de mapas :: ' ::::::::::::::::::::::::::::::: Em cima adicione: - Código:
-
Case "anuncio" For i = 1 To MAX_PLAYERS Msg = Parse(1)
If IsPlaying(i) Then Packet = "anuncio" & SEP_CHAR & Msg & END_CHAR Call SendDataTo(i, Packet) End If Next i Exit Sub Como utilizá-lo: Digite: /anuncio MENSAGEM DO ANUNCIO. Após isso aparecerá a pic com o anuncio para todos online. Créditos: RenanR | |
|