SImple Question

09/25/2011 15:09 shadowman123#1
well i wanted to make horse race like that if the player isnt riding his horse the acc disconnect..how to write that ?? ,,i made smthing like Team Extreme Pk Tournament..i made every thing cool but couldnt add a case which is...when there is more than team leader no1 get award beside and when teamleader claim the award the teammates claim it too or vice versa ...how to write that in C# ?
09/25/2011 15:14 BaussHacker#2
Just make so they can't go off the horse or just disable all skills.
09/25/2011 16:02 shadowman123#3
Quote:
Originally Posted by BaussHacker View Post
Just make so they can't go off the horse or just disable all skills.
aha ..Nice Idea but what about the 2nd part of Team pk ..Any hints or infos?? would be appriciate
09/25/2011 16:09 BaussHacker#4
What you mean with 2nd part?
09/25/2011 16:15 shadowman123#5
Quote:
Originally Posted by BaussHacker View Post
What you mean with 2nd part?
Adding smthing like that..if there r two or more teamleader no1 get awarded till it become only teamleader in map ..and when teamleader claim the reward everyteammate claim it too ..how it would be
09/25/2011 16:55 BaussHacker#6
Try turn what you just said into a programmatical way :)
09/25/2011 17:18 shadowman123#7
i tried but i failed heres my code ...Heres my Decent Code

Code
Code:
if (client.Alive && client.Team.TeamLeader)
                                        {
                                            foreach (GameState cli in client.Team.Teammates)
                                            {
                                                client.Entity.ConquerPoints += 20000;
                                                Conquer_Online_Server.ServerBase.Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + "'s Team claimed 20k cps for winning the Team Extreme Pk War and Received PurpleSparkle Halo .", System.Drawing.Color.White, Message.Center), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                client.Entity.AddFlag(Update.Flags.PurpleSparkles);
                                                DateTime.Now.AddDays(7);
                                                client.Entity.Teleport(1002, 429, 378);
                                                EntityTable.SaveEntity(client);
                                            }
                                        }
What do u think About that ...?
09/25/2011 18:43 BaussHacker#8
Quote:
Originally Posted by shadowman123 View Post
i tried but i failed heres my code ...Heres my Decent Code

Code
Code:
if (client.Alive && client.Team.TeamLeader)
                                        {
                                            foreach (GameState cli in client.Team.Teammates)
                                            {
                                                client.Entity.ConquerPoints += 20000;
                                                Conquer_Online_Server.ServerBase.Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + "'s Team claimed 20k cps for winning the Team Extreme Pk War and Received PurpleSparkle Halo .", System.Drawing.Color.White, Message.Center), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                client.Entity.AddFlag(Update.Flags.PurpleSparkles);
                                                DateTime.Now.AddDays(7);
                                                client.Entity.Teleport(1002, 429, 378);
                                                EntityTable.SaveEntity(client);
                                            }
                                        }
What do u think About that ...?
DateTime.Now.AddDays(7); will not do anything, because you do not assign it to a variable or save it any places.
09/25/2011 20:19 pwerty#9
meh
Code:
byte c = 0;
player winner;
Foreach( player in map)
{
 if ( player.teamleader && player.alive)
{
   winner = player
   c++;
}
}
if(c != 1)
 return;
else
 foreach(tempplayer in winners.teammates)
{
 // reward code
}
this is easiest way that I can think of!
09/25/2011 20:34 BaussHacker#10
Quote:
Originally Posted by pwerty View Post
meh
Code:
byte c = 0;
player winner;
Foreach( player in map)
{
 if ( player.teamleader && player.alive)
{
   winner = player
   c++;
}
}
if(c != 1)
 return;
else
 foreach(tempplayer in winners.teammates)
{
 // reward code
}
this is easiest way that I can think of!
Change if(c != 1) to if(c > 1)

Otherwise there would only be a winner, when there is one in the team.
09/25/2011 20:47 pwerty#11
Quote:
Originally Posted by BaussHacker View Post
Change if(c != 1) to if(c > 1)

Otherwise there would only be a winner, when there is one in the team.
Im pretty sure that it just make sure that there is only on winning team

and if c stays 0 for some reason then it couse crash or somthing coz "winner" will be empty/null. So there is no winner.teammates to look at.

EDIT: anyway its just Idea not code. He should work around it if he choose this Idea
09/25/2011 21:14 BaussHacker#12
Quote:
Originally Posted by pwerty View Post
Im pretty sure that it just make sure that there is only on winning team

and if c stays 0 for some reason then it couse crash or somthing coz "winner" will be empty/null. So there is no winner.teammates to look at.

EDIT: anyway its just Idea not code. He should work around it if he choose this Idea
Well your adding a value to the variable c for every member there is in the team.
The check you made is only checking if there is one member. If there is more or less, then it will just return. And I made a mistake as well, it should have been > 0. But true, the code should just be used as a reference.
09/25/2011 21:27 pwerty#13
Quote:
Originally Posted by BaussHacker View Post
Well your adding a value to the variable c for every member there is in the team.
The check you made is only checking if there is one member. If there is more or less, then it will just return. And I made a mistake as well, it should have been > 0. But true, the code should just be used as a reference.
well ..
Code:
if ( player.teamleader && player.alive)
   c++;
player.teamleader is bool (and in team there can be only one leader) and player.alive is bool!
so this code counts alive team leaders.

next:: "winner" is teamleader. and its used as referance to reward team members.

Code:
 foreach(tempplayer in winners.teammates)
{
 // reward code
}
I hope this makes it clear. (sry for "spamming" but I just don't like to leave things unexplained)
09/26/2011 01:42 shadowman123#14
Well thank u both ..its amazing Solution u both Rocks ;)