coziboy Posted September 27, 2013 Author Share Posted September 27, 2013 Okay this is my first tutorial or whatever you can say because this is just a little change from some code :P*tested on eclipse the final frontier*difficult: Very Easy(deathkeeper said :lol: )**Client Side**open **modEnumeration** and add this```CSayParty```below```CSayMsg```then find in **modClientTCP**```Public Sub SayMsg(ByVal text As String)Dim buffer As clsBuffer ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo ErrorHandler Set buffer = New clsBuffer buffer.WriteLong CSayMsg buffer.WriteString text SendData buffer.ToArray() Set buffer = Nothing ' Error handler Exit SubErrorHandler: HandleError "SayMsg", "modClientTCP", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit SubEnd Sub```below that add this```Public Sub PartyMsg(ByVal text As String)Dim buffer As clsBuffer ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo ErrorHandler Set buffer = New clsBuffer buffer.WriteLong CSayParty buffer.WriteString text SendData buffer.ToArray() Set buffer = Nothing ' Error handler Exit SubErrorHandler: HandleError "PartyMsg", "modClientTCP", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit SubEnd Sub```then open **modInput** and search for```' Say message If Len(chatText) > 0 Then Call SayMsg(MyText) End If```below that add this```'Party Message If Left$(chatText, 1) = "~" Then chatText = Mid$(chatText, 2, Len(chatText) - 1) If Len(chatText) > 0 Then Call PartyMsg(chatText) End If MyText = vbNullString UpdateShowChatText Exit Sub End If```**Server Side**open **modEnumerations**then below```CSayMsg```add this```CSayParty```open **modHandleData**below```HandleDataSub(CSayMsg) = GetAddress(AddressOf HandleSayMsg)```add this```HandleDataSub(CSayParty) = GetAddress(AddressOf HandlePartyMsg)```still at **modHandleData**, search for this sub```Private Sub HandleSayMsg```below that sub add this sub```Public Sub HandlePartyMsg(ByVal index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long) Dim Msg As String, s As String Dim partynum As Long, 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 If Not TempPlayer(index).inParty > 0 Then PlayerMsg index, "You need to be in a party to talk in Party Chat!", BrightRed Exit Sub End If s = "[Party]" & GetPlayerName(index) & ": " & Msg partynum = TempPlayer(index).inParty PartyMsg partynum, "[Party] " & GetPlayerName(index) & " : " & Msg, Blue Call TextAdd(Msg) Call AddLog(s, PLAYER_LOG) Set buffer = NothingEnd Sub```**_Done…_** Link to comment Share on other sites More sharing options...
Matt Posted September 27, 2013 Share Posted September 27, 2013 Saw one of these earlier on, but it's nice to see you come up with a useful tutorial! Keep up the good work ^_^ Link to comment Share on other sites More sharing options...
abhi2011 Posted September 27, 2013 Share Posted September 27, 2013 There is a tutorial for this. But since this a first timer, keep up the good work!And also, just a suggestion: To make your code look a bit more neater, you could group together variable declaration. eg:```dim var1 as string, var2 as stringdim num1 as long, num2 as byte```etc Link to comment Share on other sites More sharing options...
Domino_ Posted September 27, 2013 Share Posted September 27, 2013 ``` Dim Msg As String Dim s As String Dim partynum As Long Dim i As Long```can also make bit shorter like``` Dim Msg, s As String Dim partynum, i As Long```Thanks for tutorial ;) Link to comment Share on other sites More sharing options...
abhi2011 Posted September 27, 2013 Share Posted September 27, 2013 > ```> > Dim Msg As String> Dim s As String> Dim partynum As Long> Dim i As Long> > ```> can also make bit shorter like> > > > ```> > Dim Msg, s As String> Dim partynum, i As Long> > ```> Thanks for tutorial ;)You cannot and should not do that.All variables in VB should be declared with a type. It is not a necessity by a coding efficiency. It also prevents logical errors from taking place. In Domino's "example" his Msg and partynum variables are not string, longs but rather variants. It should be```dim msg as string, s as stringdim partnum as long, i as long``` Link to comment Share on other sites More sharing options...
coziboy Posted September 27, 2013 Author Share Posted September 27, 2013 > Saw one of these earlier on, but it's nice to see you come up with a useful tutorial! Keep up the good work ^_^> There is a tutorial for this. But since this a first timer, keep up the good work!> > And also, just a suggestion: To make your code look a bit more neater, you could group together variable declaration. > > eg:> > ```> dim var1 as string, var2 as string> dim num1 as long, num2 as byte> > ```> etcmy mistake, sorry.. :(> ```> > Dim Msg As String> Dim s As String> Dim partynum As Long> Dim i As Long> > ```> can also make bit shorter like> > > > ```> > Dim Msg, s As String> Dim partynum, i As Long> > ```> Thanks for tutorial ;)i think that will cause an error, if i'm sure that is vb.net script :huh:but thanks for everyone who tell me to simply this code :wub: Link to comment Share on other sites More sharing options...
totidarmala Posted September 29, 2013 Share Posted September 29, 2013 nice tutor Link to comment Share on other sites More sharing options...
Domino_ Posted September 29, 2013 Share Posted September 29, 2013 ~~Umm isnt there already a party chat, with "/p" ?? o.O~~lol, i though eo had party chat xD But if not then this is helpful. :) Link to comment Share on other sites More sharing options...
coziboy Posted September 29, 2013 Author Share Posted September 29, 2013 > ~~Umm isnt there already a party chat, with "/p" ?? o.O~~> > lol, i though eo had party chat xD But if not then this is helpful. :)just like what i said, tested on eclipse the final frontier :lol:in this engine there is no party chat with /p command ;)CMIIW :P Link to comment Share on other sites More sharing options...
darksmash88 Posted June 5, 2014 Share Posted June 5, 2014 Hello! i have a question:How to do not appear bubblechat on the map??? [Final Frontier]Thanks for help. Link to comment Share on other sites More sharing options...
IFX Posted January 13, 2015 Share Posted January 13, 2015 Have not yet implemented this yet. but i definitely will.Apparently on export UpdateShowChatText is not defined.Grand. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now