|
You last visited: Today at 04:52
Advertisement
if player1 killed player2 do this action , else do another action .
Discussion on if player1 killed player2 do this action , else do another action . within the CO2 Private Server forum part of the Conquer Online 2 category.
10/27/2011, 03:23
|
#1
|
elite*gold: 0
Join Date: Mar 2010
Posts: 475
Received Thanks: 14
|
if player1 killed player2 do this action , else do another action .
Okay , sorry for this thread but the old one none joining it , or trying to correct my wrong , well .
if p1 killed p2 do this action , else do this action . is what i wanna to convert this into C# , so how to make it,
for example.
PHP Code:
if (Player1 killed Player2) { Player1.Entity.Teleport(1002, 000 , 000); Player2.Entity.Teleport(1003, 000 , 000); } else { Player1.Entity.Teleport(1003, 000 , 000); Player2.Entity.Teleport(1002, 000 , 000);
|
|
|
10/27/2011, 04:02
|
#2
|
elite*gold: 0
Join Date: Aug 2007
Posts: 1,525
Received Thanks: 230
|
Quote:
Originally Posted by abdeen
Okay , sorry for this thread but the old one none joining it , or trying to correct my wrong , well .
if p1 killed p2 do this action , else do this action . is what i wanna to convert this into C# , so how to make it,
for example.
PHP Code:
if (Player1 killed Player2) { Player1.Entity.Teleport(1002, 000 , 000); Player2.Entity.Teleport(1003, 000 , 000); } else { Player1.Entity.Teleport(1003, 000 , 000); Player2.Entity.Teleport(1002, 000 , 000);
|
Code:
if (attacker.MapID == 1038 && attacked.MapID == 1038) <<== Check about that They r in same map (its useless anyways )
{
if (attacker.Owner.Entity.Dead)
{
attacker.Teleport(1002, 421, 380);<<= This case means that attacker is Dead and teleported to Tc Then
}
else
{
attacker.Teleport(1003, 421, 380); <<= This case means that attacker is alive and be teleported to get prize
}
}
thats what came on my mind
|
|
|
10/27/2011, 04:10
|
#3
|
elite*gold: 0
Join Date: Mar 2010
Posts: 475
Received Thanks: 14
|
its Dynamic map , so its wont work .
|
|
|
10/27/2011, 06:42
|
#4
|
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,376
|
Simplest way I can think of doing it is when you add them to your event (I assume this is still for your elite pk tournament so you should be posting this question inside that thread like I told you to...) would be to create a class for ElitePkTournamentMatch.
This will hold both players, their damage and everything else as well as having some simple methods such as..
EventStart()
EventEnd()
Win(bool playerOne)
etc
Then in your player death code do something like..
if(user.ElitePkMatch !=null)
{
if(user == user.ElitePkMatch.PlayerOne)
user.ElitePkMatch.Win(PlayerOne);
else
user.ElitePkMath.Win(PlayerTwo);
}
Then in your win method make sure to award prizes and run your RoundEnd() code which would clear the ElitePkMatch value for all clients competing and send them to wherever you want.
Tada!
<edit>
The reason I would do something like that is it avoids any extra threads or timers checking conditions... I'd consider it more of an "asynchronous event" because the only time the event needs to end (in this situation) is when a player dies... so you run your checks only when someone dies! If you wanted the round to also have a timeout value then you'd need a different solution (such as a timer which will end the round if it hasn't already been destroyed when the timer expires... but w/e!)
|
|
|
10/27/2011, 18:06
|
#5
|
elite*gold: 0
Join Date: Mar 2010
Posts: 475
Received Thanks: 14
|
Quote:
Originally Posted by pro4never
Simplest way I can think of doing it is when you add them to your event (I assume this is still for your elite pk tournament so you should be posting this question inside that thread like I told you to...) would be to create a class for ElitePkTournamentMatch.
This will hold both players, their damage and everything else as well as having some simple methods such as..
EventStart()
EventEnd()
Win(bool playerOne)
etc
Then in your player death code do something like..
if(user.ElitePkMatch !=null)
{
if(user == user.ElitePkMatch.PlayerOne)
user.ElitePkMatch.Win(PlayerOne);
else
user.ElitePkMath.Win(PlayerTwo);
}
Then in your win method make sure to award prizes and run your RoundEnd() code which would clear the ElitePkMatch value for all clients competing and send them to wherever you want.
Tada!
<edit>
The reason I would do something like that is it avoids any extra threads or timers checking conditions... I'd consider it more of an "asynchronous event" because the only time the event needs to end (in this situation) is when a player dies... so you run your checks only when someone dies! If you wanted the round to also have a timeout value then you'd need a different solution (such as a timer which will end the round if it hasn't already been destroyed when the timer expires... but w/e!)
|
so this code will not work for me ?
PHP Code:
public void EventEnd() { if (pOne.Entity.Dead) { pOne.Entity.Teleport(1002, 421, 380); //<<= This case means that attacker is Dead and teleported to Tc Then pTwo.Entity.Teleport(pTwo.Entity.PreviousMapID, pTwo.Entity.PrevX, pTwo.Entity.PrevY); pTwo.Entity.PKMode = pOne.Entity.PKMode; pOne.Entity.PKMode = Conquer_Online_Server.Game.Enums.PKMode.Capture; pOne.Send(new Data(true) { UID = pOne.Entity.UID, ID = Data.ChangePKMode, dwParam = (uint)pOne.Entity.PKMode }); pOne.Entity.PKMode = pTwo.Entity.PKMode; pTwo.Entity.PKMode = Conquer_Online_Server.Game.Enums.PKMode.Capture; pTwo.Send(new Data(true) { UID = pTwo.Entity.UID, ID = Data.ChangePKMode, dwParam = (uint)pTwo.Entity.PKMode }); this.EventEnd(); } else { pTwo.Entity.Teleport(1002, 421, 380); //<<= This case means that attacker is Dead and teleported to Tc Then pOne.Entity.Teleport(pOne.Entity.PreviousMapID, pOne.Entity.PrevX, pOne.Entity.PrevY); pTwo.Entity.PKMode = pOne.Entity.PKMode; pOne.Entity.PKMode = Conquer_Online_Server.Game.Enums.PKMode.Capture; pOne.Send(new Data(true) { UID = pOne.Entity.UID, ID = Data.ChangePKMode, dwParam = (uint)pOne.Entity.PKMode }); pOne.Entity.PKMode = pTwo.Entity.PKMode; pTwo.Entity.PKMode = Conquer_Online_Server.Game.Enums.PKMode.Capture; pTwo.Send(new Data(true) { UID = pTwo.Entity.UID, ID = Data.ChangePKMode, dwParam = (uint)pTwo.Entity.PKMode }); this.EventEnd(); } }
|
|
|
10/28/2011, 22:13
|
#6
|
elite*gold: 0
Join Date: Oct 2009
Posts: 125
Received Thanks: 21
|
abdeen
hey bro ty for help me with random select player sistem hehe
|
|
|
10/29/2011, 22:54
|
#7
|
elite*gold: 0
Join Date: Mar 2010
Posts: 475
Received Thanks: 14
|
you are welcome.
|
|
|
Similar Threads
|
Action 9!
03/29/2011 - Dekaron Private Server - 27 Replies
I don't know if you guys read the kr website sometimes but well I do and just noticed this.
http://i52.tinypic.com/2555fyd.jpg
Update will be called,
16ppl can enter the Colosseum and its like survival match
You can also do it in a pt mode (2:2,5:5)
|
Action-CO where real action comes in co privateserver
01/12/2011 - CO2 PServer Archive - 4 Replies
At the begging I would like to say hi
I would like to produce you new server called Action-CO
Server is 5095 as patch and is on VPS
At first I want to say server is still Beta like on levels and that and shopping mall items worth alot atm we r decreasing in time so please we ask you for patience also atm there r no donations for ppl who lives out of egypt atm since there r no Paypay account to provide us with the money untill then there r no donations.
Server Features
1:-Server mobs...
|
Action 6 First Ban.
04/02/2010 - Dekaron - 15 Replies
Any got bann, after action 6?
|
All times are GMT +2. The time now is 04:52.
|
|