00GuthixLord Posted July 13, 2012 Author Share Posted July 13, 2012 Ok this is my second code I've Done with VB6 and eclipse so I hope it helps. :)* * *Outcome:>! ![](http://i45.tinypic.com/2ngr0ab.png)* * *Client:Ok for to start off we need a button:* Open client* Then frmMain* Expand frmMain To The Right* Rearrange the admin panel so you can fit in another button* After you add in your button double click and it will take you to some codeThe code should look something like this:```Private Sub HealPlayer_Click()End Sub```The first thing we should add is the debug so its a simple code that looks like this:``` ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler Exit Suberrorhandler: HandleError "HealPlayer_Click", "frmMain", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit Sub```Now to prevent hackers add:``` If GetPlayerAccess(MyIndex) < ADMIN_MAPPER Then Exit Sub End If```That checks if you the owner/admin. Now we need it to do some thing so make a variable name, I chose HealThem so I would add this:``` HealThem Trim$(txtAName.text)```That tells the code to read from some where else, Now open modClientTCP.In there find a empty spot that is not in a sub and make your own sub. It should look something like this(With The Debug):```Public Sub HealThem(ByVal Name As String) ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler Exit Suberrorhandler: HandleError "HealThem", "modClientTCP", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit SubEnd Sub```Ok now that we have are sub we need to tell it what to do so add this:```' This goes under your sub nameDim Buffer As clsBuffer 'This Goes After The Goto Errorhandler Set Buffer = New clsBuffer Buffer.WriteLong CHealer Buffer.WriteString Name SendData Buffer.ToArray() Set Buffer = Nothing```That tells the code to send the name to the server with CHealer you can change that but make sure it has a C in front.Ok to make it so the server receives that you need to open modEnumerations and find this:```' Packets sent by client to serverPublic Enum ClientPackets```There is a big long list after it, you need to add CHealer after the last 'C' thing But Before CMSG_COUNT .Example:>! ``` CDeclineTradeRequest CPartyRequest CAcceptParty CDeclineParty CPartyLeave CEventChatReply CEvent CSwitchesAndVariables CRequestSwitchesAndVariables CHealer ' Its After The Last C thing>! ```* * *Server:Ok your in the server now so open modEnumerations first and add the last part of Client in the same spot.Ok after that you need to open modHandleData, and find a nice open spot and add this:```Sub HandleHealThem(ByVal index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long, ByVal Vital As Vitals) Dim n As Long Dim buffer As clsBuffer Set buffer = New clsBuffer buffer.WriteBytes Data() ' Prevent hacking If GetPlayerAccess(index) < ADMIN_MAPPER Then Exit Sub End If ' The player n = FindPlayer(buffer.ReadString) 'Parse(1)) Set buffer = Nothing If n <> index Then If n > 0 Then Else End If Else End IfEnd Sub```Explanation:>! ```Sub HandleHealThem(ByVal index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long, ByVal Vital As Vitals)>! ```That starts the sub with all your values you need.The HandleHealThem change that to the Variable you created for the Trim$ part in the client.>! ``` Dim n As Long Dim buffer As clsBuffer Set buffer = New clsBuffer buffer.WriteBytes Data()```That creates your variable n, and Buffer then sets buffer as the clsBuffer and gets your data you sent from client.>! ``` ' Prevent hacking If GetPlayerAccess(index) < ADMIN_MAPPER Then Exit Sub End If>! ' The player n = FindPlayer(buffer.ReadString) 'Parse(1)) Set buffer = Nothing>! ```These kinda explain them self's, but the set buffer just stops the buffer from working because it has all the data it needs.>! ``` If n <> index Then If n > 0 Then Else End If Else End If>! ```That checks to see if your using it on your self or another person.. The 'If n > 0 Then' checks if the player is on. Now to add healing replace the whole 'If n <> index then' statement with this:``` If n <> index Then If n > 0 Then Call SetPlayerVital(n, Vitals.HP, GetPlayerMaxVital(n, Vitals.HP)) Call SetPlayerVital(n, Vitals.MP, GetPlayerMaxVital(n, Vitals.MP)) Call SendVital(n, Vitals.HP) Call SendVital(n, Vitals.MP) Call PlayerMsg(n, "You Feel Refreshed.", BrightBlue) Call AddLog("You Healed" & GetPlayerName(n) & ".", ADMIN_LOG) Else Call PlayerMsg(index, "Player is not online.", White) End If Else Call SetPlayerVital(n, Vitals.HP, GetPlayerMaxVital(n, Vitals.HP)) Call SetPlayerVital(n, Vitals.MP, GetPlayerMaxVital(n, Vitals.MP)) Call SendVital(n, Vitals.HP) Call SendVital(n, Vitals.MP) Call PlayerMsg(n, "You Feel Refreshed.", BrightBlue) Call AddLog("You Healed" & GetPlayerName(n) & ".", ADMIN_LOG) End If```Explanation:>! ``` If n > 0 Then Call SetPlayerVital(n, Vitals.HP, GetPlayerMaxVital(n, Vitals.HP)) Call SetPlayerVital(n, Vitals.MP, GetPlayerMaxVital(n, Vitals.MP)) Call SendVital(n, Vitals.HP) Call SendVital(n, Vitals.MP) Call PlayerMsg(n, "You Feel Refreshed.", BrightBlue) Call AddLog("You Healed" & GetPlayerName(n) & ".", ADMIN_LOG) Else Call PlayerMsg(index, "Player is not online.", White) End If```That gets a player that wasn't a the person using the button and heals them.```The 'If n > 0 Then' Checks If There Online Else Call SetPlayerVital(n, Vitals.HP, GetPlayerMaxVital(n, Vitals.HP)) Call SetPlayerVital(n, Vitals.MP, GetPlayerMaxVital(n, Vitals.MP)) Call SendVital(n, Vitals.HP) Call SendVital(n, Vitals.MP) Call PlayerMsg(n, "You Feel Refreshed.", BrightBlue) Call AddLog("You Healed" & GetPlayerName(n) & ".", ADMIN_LOG) End If```The Else Say's That its the Admin Healing Them Self And Heals Them.>! ``` Call SetPlayerVital(n, Vitals.HP, GetPlayerMaxVital(n, Vitals.HP)) Call SetPlayerVital(n, Vitals.MP, GetPlayerMaxVital(n, Vitals.MP))```That Gets The Players Max HP and MP Then:``` Call SendVital(n, Vitals.HP) Call SendVital(n, Vitals.MP)```That Gives Them There Max HP And MP``` Call PlayerMsg(n, "You Feel Refreshed.", BrightBlue)```That Just Tells The Player He Was Healed>! ``` Call AddLog("You Healed" & GetPlayerName(n) & ".", ADMIN_LOG)```That Puts It Into The Server Log. I Hope That Helped. And I Put Enough Explanation In It. :PSorry If There Are Any Misspellings Or Grammar Mishaps Writing Tutorials With All The Spoilers And Code Makes Me Mess Up Alot. :embarrassed: Link to comment Share on other sites More sharing options...
Joost Posted July 14, 2012 Share Posted July 14, 2012 ``` If n <> index Then If n > 0 Then Call SetPlayerVital(n, Vitals.HP, GetPlayerMaxVital(n, Vitals.HP)) Call SetPlayerVital(n, Vitals.MP, GetPlayerMaxVital(n, Vitals.MP)) Call SendVital(n, Vitals.HP) Call SendVital(n, Vitals.MP) Call PlayerMsg(n, "You Feel Refreshed.", BrightBlue) Call AddLog("You Healed" & GetPlayerName(n) & ".", ADMIN_LOG) Else Call PlayerMsg(index, "Player is not online.", White) End If Else Call SetPlayerVital(n, Vitals.HP, GetPlayerMaxVital(n, Vitals.HP)) Call SetPlayerVital(n, Vitals.MP, GetPlayerMaxVital(n, Vitals.MP)) Call SendVital(n, Vitals.HP) Call SendVital(n, Vitals.MP) Call PlayerMsg(n, "You Feel Refreshed.", BrightBlue) Call AddLog("You Healed" & GetPlayerName(n) & ".", ADMIN_LOG) End If```This is the same thing with less lines of code``` If n > 0 Then Call SetPlayerVital(n, Vitals.HP, GetPlayerMaxVital(n, Vitals.HP)) Call SetPlayerVital(n, Vitals.MP, GetPlayerMaxVital(n, Vitals.MP)) Call SendVital(n, Vitals.HP) Call SendVital(n, Vitals.MP) Call PlayerMsg(n, "You Feel Refreshed.", BrightBlue) Call AddLog("You Healed" & GetPlayerName(n) & ".", ADMIN_LOG) Else Call PlayerMsg(index, "Player is not online.", White) End If``` Link to comment Share on other sites More sharing options...
abhi2011 Posted July 14, 2012 Share Posted July 14, 2012 Wanted to say. This can be used by anyone who is greater than mapper. So when a log is added shouldn't it be```call addlog(index & "healded" & hetplayername(n)& ".", Admin_log)```saying that you can be anyone Link to comment Share on other sites More sharing options...
tslusny Posted July 14, 2012 Share Posted July 14, 2012 @TheChoosenOne:> ```> call addlog(index & "healded" & hetplayername(n)& ".", Admin_log)> > ```saying that you can be anyoneFIX```Call AddLog(index & " healed " & GetPlayerName(n) & ".", ADMIN_LOG)``` Link to comment Share on other sites More sharing options...
abhi2011 Posted July 14, 2012 Share Posted July 14, 2012 Lol. You got me. I was wondering will index show the name or the index number? I personally believe it is the number so it might be```getplayername(index)``` Link to comment Share on other sites More sharing options...
tslusny Posted July 14, 2012 Share Posted July 14, 2012 @TheChoosenOne:> Lol. You got me. I was wondering will index show the name or the index number? I personally believe it is the number so it might be> ```> getplayername(index)> > ```you are right Link to comment Share on other sites More sharing options...
Matt Posted July 14, 2012 Share Posted July 14, 2012 Please change ES to Event System unless this **really** works in Eclipse Stable…. ES stands for Eclipse Stable and nothing else otherwise people would get confused. Link to comment Share on other sites More sharing options...
abhi2011 Posted July 14, 2012 Share Posted July 14, 2012 People now that ES is no longer supported. So they will know that it is for the event system Link to comment Share on other sites More sharing options...
00GuthixLord Posted July 14, 2012 Author Share Posted July 14, 2012 TheChoosenOne:>! @TheChoosenOne:>! > Lol. You got me. I was wondering will index show the name or the index number? I personally believe it is the number so it might be> ```> getplayername(index)> > ```>! Well The Code Is Set Up To Use The "Name" Text Box For The Player "n">! @TheChoosenOne:>! > Wanted to say. This can be used by anyone who is greater than mapper. So when a log is added shouldn't it be> ```> call addlog(index & "healded" & hetplayername(n)& ".", Admin_log)> > ```saying that you can be anyone>! Yes That Would Work I Never Thought Of That :) * * *Joost:>! @Joost:>! > ```> If n <> index Then> If n > 0 Then> Call SetPlayerVital(n, Vitals.HP, GetPlayerMaxVital(n, Vitals.HP))> Call SetPlayerVital(n, Vitals.MP, GetPlayerMaxVital(n, Vitals.MP))> Call SendVital(n, Vitals.HP)> Call SendVital(n, Vitals.MP)> Call PlayerMsg(n, "You Feel Refreshed.", BrightBlue)> Call AddLog("You Healed" & GetPlayerName(n) & ".", ADMIN_LOG)> Else> Call PlayerMsg(index, "Player is not online.", White)> End If> Else> Call SetPlayerVital(n, Vitals.HP, GetPlayerMaxVital(n, Vitals.HP))> Call SetPlayerVital(n, Vitals.MP, GetPlayerMaxVital(n, Vitals.MP))> Call SendVital(n, Vitals.HP)> Call SendVital(n, Vitals.MP)> Call PlayerMsg(n, "You Feel Refreshed.", BrightBlue)> Call AddLog("You Healed" & GetPlayerName(n) & ".", ADMIN_LOG)> End If> > ```> This is the same thing with less lines of code> ```> If n > 0 Then> Call SetPlayerVital(n, Vitals.HP, GetPlayerMaxVital(n, Vitals.HP))> Call SetPlayerVital(n, Vitals.MP, GetPlayerMaxVital(n, Vitals.MP))> Call SendVital(n, Vitals.HP)> Call SendVital(n, Vitals.MP)> Call PlayerMsg(n, "You Feel Refreshed.", BrightBlue)> Call AddLog("You Healed" & GetPlayerName(n) & ".", ADMIN_LOG)> Else> Call PlayerMsg(index, "Player is not online.", White)> End If> > ```>! Well, I Did That So You Can Choose If You Want The Person To Be Able To Heal Them Self, If Not You Could Put Like:```Call PlayerMsg(index, "You Cannot Heal Yourself.", White)```* * *Sigridunset:>! @Sigridunset:>! > Please change ES to Event System unless this **really** works in Eclipse Stable…. ES stands for Eclipse Stable and nothing else otherwise people would get confused.>! Ok I Will Change It. I Didn't Know There Was A Eclipse Stable any more. * * *Thanks. :P Link to comment Share on other sites More sharing options...
abhi2011 Posted July 15, 2012 Share Posted July 15, 2012 @Upso are you saying that index will actually print the player name and not the number?And also there is no Eclipse Stable anymore Link to comment Share on other sites More sharing options...
jcsnider Posted July 15, 2012 Share Posted July 15, 2012 Index is simply a long value (a number).GetPlayerName(index) gets the name of the player who would heal whomever….Furthermore, although ES - Event System or ES - Eclipse Stable could end up confusing... a simple glance at the code would show that it is referring to a version of Eclipse newer than stable. One easy giveaway is the admin panel image. Another, the fact that it is using the Buffer class. Either way, Eclipse Stable is old/outdated/etc... and new tutorials should not be coming out for it anyways.@00GuthixLord, overall it is a little messy but the code appears like it would work as intended so good job and keep it up! It is nice seeing so many contributions to the source tutorials section in such a small window of time. Link to comment Share on other sites More sharing options...
abhi2011 Posted July 15, 2012 Share Posted July 15, 2012 I know index is a long. And it means the number will be printed.@00GuthixLordYour confusing me :P Link to comment Share on other sites More sharing options...
00GuthixLord Posted July 19, 2012 Author Share Posted July 19, 2012 @TheChoosenOne:> I know index is a long. And it means the number will be printed.> @00GuthixLord> Your confusing me :PYou all are confusing me…Index: The admin usingn: the person getting healed Link to comment Share on other sites More sharing options...
abhi2011 Posted July 19, 2012 Share Posted July 19, 2012 Index is a number. So won't adding a log with index print admin's index number? Or will it add the admin's name? Link to comment Share on other sites More sharing options...
00GuthixLord Posted July 19, 2012 Author Share Posted July 19, 2012 @TheChoosenOne:> Index is a number. So won't adding a log with index print admin's index number? Or will it add the admin's name?Admins nameEdit:00Guthixlord Healed TheChoosenOne.Index = 00GuthixLordn = TheChoosenOne Link to comment Share on other sites More sharing options...
bunny123 Posted September 8, 2012 Share Posted September 8, 2012 Actually, index is a number. It will print the admin's ID unless you use```GetPlayerName(index)``` Link to comment Share on other sites More sharing options...
matthewpull Posted September 16, 2012 Share Posted September 16, 2012 Does this work on Eclipse Advanced? It doesn't seem to be working for me… Link to comment Share on other sites More sharing options...
bunny123 Posted September 16, 2012 Share Posted September 16, 2012 > Does this work on Eclipse Advanced? It doesn't seem to be working for me…Well, it says "[EO - Event System]" meaning it's made for Eclipse Origins - Event System, so what do you think the answer to your question is? Link to comment Share on other sites More sharing options...
matthewpull Posted September 17, 2012 Share Posted September 17, 2012 I know, but I was wondering if anyone had made it work on Eclipse Advance, as that is based on Eclipse Nightly, which is basically Eclipse Origins 3.0. Link to comment Share on other sites More sharing options...
Ruins of Hell Posted September 17, 2012 Share Posted September 17, 2012 > I know, but I was wondering if anyone had made it work on Eclipse Advance, as that is based on Eclipse Nightly, which is basically Eclipse Origins 3.0.Just taking a precursory glance, I see no reason why it shouldn't work with Eclipse Nightly. I would make a back up, add it in, and report back on whether or not it works.Basically, if the tutorial does any rendering, it won't work on Eclipse Nightly without adaptation. Link to comment Share on other sites More sharing options...
matthewpull Posted September 17, 2012 Share Posted September 17, 2012 I've tried it and NOTHING happens when u click the buttons. Oh well it doesn't matter that much. 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