Zopto Posted August 1, 2012 Author Share Posted August 1, 2012 Baisic Duel System 1vs1**Client Side ~**Create a picture in frmMainRename the picture for "picPVPRequest" add label raname it "lblPVPplayer."now make two lbels Accept and Decline…click on accept lbl and put this in:``` picPVPRequest.Visible = False SendAcceptPVP```And the same thing, but the label 'Reject':``` picPVPRequest.Visible = False SendDeclinePVP```Look for:``` Case "/ debug"```Below this case add:```Case "/fight" If Len (MyText)> 7 Then ChatText = Mid (MyText, 8, Len (MyText) - 7) SendPVPRequest ChatText Else AddText "Useage: / fight," HelptColor End If```Look for:``` Sub SendDeclineParty ( )```Add Below:``` Sub SendPVPRequest (ByVal Name As String) Dim Buffer As clsBuffer If Options.Debug = 1 Then On Error GoTo ErrorHandler Set Buffer = New clsBuffer Buffer.WriteLong CPvp Buffer.WriteString Name SendData Buffer.ToArray () Set Buffer = Nothing 'Error Handler Exit Sub ErrorHandler: HandleError "SendPVPRequested", "modClientTCP", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit Sub End Sub Sub SendDeclinePVP () Dim Buffer As clsBuffer If Options.Debug = 1 Then On Error GoTo ErrorHandler Set Buffer = New clsBuffer Buffer.WriteLong CDPvp SendData Buffer.ToArray () Set Buffer = Nothing 'Error Handler Exit Sub ErrorHandler: HandleError "SendDeclinePVP", "modClientTCP", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit Sub End Sub Sub SendAcceptPVP () Dim Buffer As clsBuffer If Options.Debug = 1 Then On Error GoTo ErrorHandler Set Buffer = New clsBuffer Buffer.WriteLong PAPVC SendData Buffer.ToArray () Set Buffer = Nothing 'Error Handler Exit Sub ErrorHandler: HandleError "SendAcceptPVP", "modClientTCP", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit Sub End Sub```Search For:``` 'Make sure CMSG_COUNT is below everything else CMSG_COUNT```Above that add:``` CPvp CDPvp PAPVC```**~ Server Side**Go to the Type PlayerRecand below:``` Pk as byte```Add:``` PVPPlayer As Long```Search For:``` 'Make sure CMSG_COUNT is below everything else CMSG_COUNT```Add Up:``` CPvp CDPvp PAPVC```Now Look for:``` HandleDataSub (CPartyLeave) = GetAddress (AddressOf HandlePartyLeave)```Below add:``` HandleDataSub (CPvp) = GetAddress (AddressOf HandlePvp) HandleDataSub (PAPVC) = GetAddress (AddressOf HandleAcceptPvp) HandleDataSub (CDPvp) = GetAddress (AddressOf HandleDeclinePVP)```Now add this at the end of modHandleData: FIX BY SOUL!!!``` Sub HandlePvp (ByVal index As Long, ByRef Data () As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long) Dim N As ByteDim Buffer As clsBuffer Set Buffer = New clsBuffer N = FindPlayer (Buffer.ReadString) 'Parse (1)) If N <1 Then PlayerMsg index, N & "is not online.", White Exit Sub End If If N = index Then Exit Sub End If PlayerMsg index, "The request was sent to fight" & GetPlayerName (N) & ".", Pink PlayerMsg N, GetPlayerName (index) & "wants to fight you.", PinkPlayer(N).PVPPlayer = index Player(index).PVPPlayer = N PVPRequestWindow N, Index End Sub Sub HandleAcceptPvp (ByVal index As Long, ByRef Data () As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long) Dim N As Byte N = Player (index). PVPPlayer If N> 0 Then PlayerWarp N, 1, 10, 10 'Map of the "arena" PlayerWarp index, 1, 11, 10 'Map of the "arena" GlobalMsg GetPlayerName (index) & "and" & GetPlayerName (N) & "will fight in the arena. Good luck!", Pink Else PlayerMsg index, "Player no longer online.", White Exit Sub End If End Sub Sub HandleDeclinePVP (ByVal index As Long, ByRef Data () As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long) Dim N As Byte N = Player (index). PVPPlayer If N> 0 Then PlayerMsg index, "The request was rejected in the fight.", Pink PlayerMsg N, GetPlayerName (index) & "rejected his request to fight.", Pink End If End Sub```Search For:``` Sub SendSpawnItemToMap (ByVal mapNum As Long, ByVal Index As Long)```Below this sub add:``` Sub PVPRequestWindow (ByVal Index As Long, ByVal Inviter As Long) Dim Buffer As clsBuffer Set Buffer = New clsBuffer Buffer.WriteLong SPvpWindow Buffer.WriteByte Inviter SendDataTo Index, Buffer.ToArray () Set Buffer = Nothing End Sub```Search For:``` 'Make sure SMSG_COUNT is below everything else SMSG_COUNT```Add up:``` SPvpWindow```**i forgot this****Client Side**and search for:``` 'Make sure SMSG_COUNT is below everything else SMSG_COUNT```Add Up:``` SPvpWindow```Now Look For:``` HandleDataSub (SPartyVitals) = GetAddress (AddressOf HandlePartyVitals)```Add Below:``` HandleDataSub (SPvpWindow) = GetAddress (AddressOf HandlePvpWindow)```Now the end of modHandleData Add:``` Sub HandlePvpWindow (ByVal Index As Long, ByRef Data () As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long) 'If debug mode, then handle error exit in October If Options.Debug = 1 Then On Error GoTo ErrorHandler frmMain.lblPVPplayer.Caption = "%% Player" frmMain.picPVPRequest.Visible = True 'Error handler Exit Sub ErrorHandler: HandleError "HandlePvpWindow", "modHandleData", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit Sub End Sub```Ready to give the system using example:how to start dueling simple put this in chat**/fight (player name)**not tested on eo 3.0 Link to comment Share on other sites More sharing options...
SAubryTV Posted August 1, 2012 Share Posted August 1, 2012 Would it work on CS:DE? Link to comment Share on other sites More sharing options...
Zopto Posted August 1, 2012 Author Share Posted August 1, 2012 @--------:> Would it work on CS:DE?yea if you chage code a litl bitfor now i trying to fix buf/fight command dont work Link to comment Share on other sites More sharing options...
minipimp Posted August 1, 2012 Share Posted August 1, 2012 Whats wrong with this code?I attempted to change it to see if it will work, on the client side.I get a compile error : Case else ousite of select case.heres a screeny Link to comment Share on other sites More sharing options...
Zopto Posted August 1, 2012 Author Share Posted August 1, 2012 @Sinnix803:> Whats wrong with this code?> I attempted to change it to see if it will work, on the client side.> I get a compile error : Case else ousite of select case.> heres a screeny```Case "/fight" If Len (MyText)> 7 Then ChatText = Mid (MyText, 8, Len (MyText) - 7) SendPVPRequest ChatText Else AddText "Useage: /fight", HelptColor End If```try this Link to comment Share on other sites More sharing options...
Zopto Posted August 1, 2012 Author Share Posted August 1, 2012 can any one help me all works fine exept when some one ask me for duel and i click accept it say player no more online how to fix that? Link to comment Share on other sites More sharing options...
JohnPony Posted August 1, 2012 Share Posted August 1, 2012 There are a couple flaws with this system, for one i didn't see a check anywhere to make sure you are actually fighting your opponent in the arena, and you also need to figure out a way to get oneself out of the arena when the fighting ends.Also stop using 'EE 2.3' it will confuse some people with Eclipse Evolution 2.7\. Link to comment Share on other sites More sharing options...
Zopto Posted August 1, 2012 Author Share Posted August 1, 2012 @General:> There are a couple flaws with this system, for one i didn't see a check anywhere to make sure you are actually fighting your opponent in the arena, and you also need to figure out a way to get oneself out of the arena when the fighting ends.> > Also stop using 'EE 2.3' it will confuse some people with Eclipse Evolution 2.7.```Sub HandleAcceptPvp (ByVal index As Long, ByRef Data () As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long) Dim N As Byte N = Player (index). PVPPlayer If N> 0 Then PlayerWarp N, 1, 10, 10 'Map of the "arena" PlayerWarp index, 1, 11, 10 'Map of the "arena" GlobalMsg GetPlayerName (index) & "and" & GetPlayerName (N) & "will fight in the arena. Good luck!", ```this sub send players to arena so if some one went to get out i will make somting like dors and attribut wrap ?? Link to comment Share on other sites More sharing options...
JohnPony Posted August 1, 2012 Share Posted August 1, 2012 Your system is flawed. Here is how i would do it.Player sends duel request, other player accepts -> creates a instanced arena map and warps them to it -> they fight, one player wins -> warp the players back to their previous location after the duel finishes. Link to comment Share on other sites More sharing options...
Zopto Posted August 1, 2012 Author Share Posted August 1, 2012 i wish i cnow better….can you help me to i edite it pls Link to comment Share on other sites More sharing options...
Ganjika Posted December 13, 2012 Share Posted December 13, 2012 I'm interested to see if anyone has this or any similar (working) system working in EO 3.0 (Dx8). Link to comment Share on other sites More sharing options...
DarkDino Posted April 23, 2013 Share Posted April 23, 2013 How to change " [background=rgb(248, 248, 248)]frmMain.lblPVPplayer.Caption = "%% Player" "[/background] To Player Opponent Name? Link to comment Share on other sites More sharing options...
escfoe2 Posted April 23, 2013 Share Posted April 23, 2013 > How to change " [background=rgb(248, 248, 248)]frmMain.lblPVPplayer.Caption = "%% Player" "[/background] To Player Opponent Name?[background=rgb(248, 248, 248)]frmMain.lblPVPplayer.Caption = [/background]GetPlayerName(Index of the Opponent)Basically change```Sub HandlePvpWindow (ByVal Index As Long, ByRef Data () As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)'If debug mode, then handle error exit in OctoberIf Options.Debug = 1 Then On Error GoTo ErrorHandlerfrmMain.lblPVPplayer.Caption = "%% Player"frmMain.picPVPRequest.Visible = True'Error handlerExit SubErrorHandler:HandleError "HandlePvpWindow", "modHandleData", Err.Number, Err.Description, Err.Source, Err.HelpContextErr.ClearExit SubEnd Sub```to```Sub HandlePvpWindow (ByVal Index As Long, ByRef Data () As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)Dim buffer as clsBufferDim Inviter as ByteSet Buffer = New clsBufferBuffer.WriteBytes Data()Inviter = Buffer.ReadByte'If debug mode, then handle error exit in OctoberIf Options.Debug = 1 Then On Error GoTo ErrorHandlerfrmMain.lblPVPplayer.Caption = GetPlayerName(Inviter)frmMain.picPVPRequest.Visible = True'Error handlerExit SubErrorHandler:HandleError "HandlePvpWindow", "modHandleData", Err.Number, Err.Description, Err.Source, Err.HelpContextErr.ClearExit SubEnd Sub```That ought to do it. I didn't use my compiler to edit that. I free handed it, so I apologize if there's any misspellings. 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