Register for your free account! | Forgot your password?

You last visited: Today at 07:18

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Release] PK Points

Discussion on [Release] PK Points within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Reply
 
Old   #1
 
Zeroxelli's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 1,769
Received Thanks: 1,143
[Release] PK Points

Requested, so I did it. Pretty simple little addition.

to the bottom of Character.cs, under
Code:
public Timer FlashTimer;
Add
Code:
public Timer PkRemove;
Now, in ClientSocket.cs, under
Code:
		public void AddStam()
		{
			if(!Client.Dead)
			{
                if (Client.CurrentStam < 100)
                {
                    Client.CurrentStam += 10;
                    Send(ConquerPacket.Status(this, 2, Client.CurrentStam, Struct.StatusTypes.Stamina));
                }
                else if (Client.CurrentStam > 100)
                    Client.CurrentStam = 100;
			}
		}
Add
Code:
        public void RemPKP()
        {
            if (Client.PkPoints > 0)
            {
                Client.PkPoints -= 1;
                Send(ConquerPacket.Status(this, 2, Client.PkPoints, Struct.StatusTypes.PKPoints));
            }
        }
Last, in PacketProcessor.cs under
Code:
                                        CSocket.Client.UpStam = new System.Timers.Timer();
                                        CSocket.Client.UpStam.Interval = 850;
                                        CSocket.Client.UpStam.Elapsed += delegate { CSocket.AddStam(); };
Add
Code:
                                        CSocket.Client.PkRemove = new System.Timers.Timer();
                                        CSocket.Client.PkRemove.Interval = (60000 * 6);
                                        CSocket.Client.PkRemove.Elapsed += delegate { CSocket.RemPKP(); };
                                        CSocket.Client.PkRemove.Enabled = true;
                                        CSocket.Client.PkRemove.Start();
Done,
Zeroxelli is offline  
Thanks
18 Users
Old 06/06/2009, 22:43   #2
 
mejo33's Avatar
 
elite*gold: 0
Join Date: Sep 2007
Posts: 370
Received Thanks: 117
Yes yes, its work thanks
mejo33 is offline  
Thanks
1 User
Old 06/06/2009, 22:46   #3
 
HunterT's Avatar
 
elite*gold: 0
Join Date: Mar 2009
Posts: 16
Received Thanks: 0
Is this server sided?
HunterT is offline  
Old 06/06/2009, 22:48   #4
 
elite*gold: 0
Join Date: Feb 2008
Posts: 19
Received Thanks: 0
thanks
malak2100 is offline  
Old 06/06/2009, 22:49   #5
 
Zeroxelli's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 1,769
Received Thanks: 1,143
Server sided? No o_0

EDIT: Explanation: Your PK points stored in the server are sent every time another client requests the Spawn packet for a character or their info.
Zeroxelli is offline  
Thanks
3 Users
Old 06/06/2009, 23:15   #6
 
2coolforu2's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 377
Received Thanks: 80
Thanks for releasing, Zeroxelli you've been really contributing to this source ^_^ +k
2coolforu2 is offline  
Thanks
3 Users
Old 06/06/2009, 23:45   #7
 
Zeroxelli's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 1,769
Received Thanks: 1,143
@2coolforu2;

No prob This is really only a tenth of what I've gotten so far
Zeroxelli is offline  
Thanks
3 Users
Old 06/07/2009, 05:49   #8
 
elite*gold: 0
Join Date: Jan 2007
Posts: 220
Received Thanks: 63
again, sick release you really contribute to this forum alot but one small suggestion (if you actually can) just add under each line of code what's it purpose is this way it would actually help people who want to learn =)
BlooD-BoY is offline  
Thanks
2 Users
Old 06/07/2009, 06:29   #9
 
Zeroxelli's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 1,769
Received Thanks: 1,143
Code:
public Timer PkRemove; // Add a new Timer, to perform certain actions every time the interval elapses.
Code:
        public void RemPKP() // Create a new VOID function, passing no arguments.
        {
            if (Client.PkPoints > 0) // If we have more than ZERO PK Points
            {
                Client.PkPoints -= 1; // PkPoints = PkPoints - 1
                Send(ConquerPacket.Status(this, 2, Client.PkPoints, Struct.StatusTypes.PKPoints)); // Update the client with the new status and value of PK Points
            }
        }
Code:
                                        CSocket.Client.PkRemove = new System.Timers.Timer(); // Initialize the timer with the basic Timer type
                                        CSocket.Client.PkRemove.Interval = (60000 * 6); // The interval is set to 60000 * 6, 1000 = One Second, thus 60000 = Sixty Seconds (One Minute), * 6 = Six Minutes
                                        CSocket.Client.PkRemove.Elapsed += delegate { CSocket.RemPKP(); }; // The delegate to call the function we defined earlier, every time six minutes elapse.
                                        CSocket.Client.PkRemove.Enabled = true; // Enable the timer, so it ticks.
                                        CSocket.Client.PkRemove.Start(); // Start the timer
Zeroxelli is offline  
Thanks
3 Users
Old 06/07/2009, 09:12   #10
 
elite*gold: 0
Join Date: Nov 2006
Posts: 65
Received Thanks: 2
thanks, it works for me. how do you make the chars name flashes?
killerbee is offline  
Thanks
1 User
Old 06/07/2009, 09:44   #11
 
Zeroxelli's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 1,769
Received Thanks: 1,143
That should already be added to the source.
Zeroxelli is offline  
Thanks
3 Users
Old 06/07/2009, 12:34   #12
 
elite*gold: 0
Join Date: Jan 2007
Posts: 220
Received Thanks: 63
Quote:
Originally Posted by Zeroxelli View Post
Code:
public Timer PkRemove; // Add a new Timer, to perform certain actions every time the interval elapses.
Code:
        public void RemPKP() // Create a new VOID function, passing no arguments.
        {
            if (Client.PkPoints > 0) // If we have more than ZERO PK Points
            {
                Client.PkPoints -= 1; // PkPoints = PkPoints - 1
                Send(ConquerPacket.Status(this, 2, Client.PkPoints, Struct.StatusTypes.PKPoints)); // Update the client with the new status and value of PK Points
            }
        }
Code:
                                        CSocket.Client.PkRemove = new System.Timers.Timer(); // Initialize the timer with the basic Timer type
                                        CSocket.Client.PkRemove.Interval = (60000 * 6); // The interval is set to 60000 * 6, 1000 = One Second, thus 60000 = Sixty Seconds (One Minute), * 6 = Six Minutes
                                        CSocket.Client.PkRemove.Elapsed += delegate { CSocket.RemPKP(); }; // The delegate to call the function we defined earlier, every time six minutes elapse.
                                        CSocket.Client.PkRemove.Enabled = true; // Enable the timer, so it ticks.
                                        CSocket.Client.PkRemove.Start(); // Start the timer
yep thats good, hopefully people would read and learn something from every release a lil by lil =)
BlooD-BoY is offline  
Thanks
2 Users
Old 06/07/2009, 13:49   #13
 
nTL3fTy's Avatar
 
elite*gold: 0
Join Date: Jun 2005
Posts: 692
Received Thanks: 353
Just a small note:
Code:
PkRemove.Enabled = true;
is the same as
Code:
PkRemove.Start();
They do the same thing, no need to have both.
nTL3fTy is offline  
Thanks
3 Users
Old 06/07/2009, 17:19   #14
 
Zeroxelli's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 1,769
Received Thanks: 1,143
Quote:
Originally Posted by nTL3fTy View Post
Just a small note:
Code:
PkRemove.Enabled = true;
is the same as
Code:
PkRemove.Start();
They do the same thing, no need to have both.
I have VS Pro 2008, it always warns me if I don't enable a timer before I start it. And I never release anything that doesn't have 0/0 Error/warns.

Probably wouldn't on C# Express because it doesn't have the entire MSDN to back its intellisense.
Zeroxelli is offline  
Thanks
3 Users
Old 07/01/2009, 15:46   #15
 
elite*gold: 0
Join Date: Jul 2007
Posts: 73
Received Thanks: 1
thanx u make it work i try to make but i i allwase get errors but i'm still learning i will be something this day will come thanx alot
0105653642 is offline  
Reply


Similar Threads Similar Threads
[Release] Atr Points Command
06/30/2010 - CO2 PServer Guides & Releases - 14 Replies
Put these codes in Chat.cs in your source Command for free Atr. Points if (GC.AuthInfo.Status == "") { if (Cmd == "/statp") { GC.MyChar.StatPoints = 0; GC.MyChar.StatPoints = byte.Parse(Cmd); } }
[Release]Attribute points in console
02/03/2010 - CO2 PServer Guides & Releases - 18 Replies
Hello everyone. If you need to put manually your Attribute Points in console - option: /characters here is form1.cs with my added function. I think you need only replace your orginal form1 with my from archive and rebuild project.
Small Release For Points
11/15/2008 - CO2 PServer Guides & Releases - 4 Replies
Hello every one this is pretty noobie release but here goes this release is for Emme's Point cose that he released it is a command that gives u Points Here it is : if (Splitter == "/points") { uint NewPoints = uint.Parse(Splitter); MyChar.Points = NewPoints; ...
[RElease]Command Virtual points
08/31/2008 - CO2 PServer Guides & Releases - 6 Replies
in client.cs in case 1004:



All times are GMT +1. The time now is 07:19.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.