Register for your free account! | Forgot your password?

You last visited: Today at 23:36

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


GM/PM protection

Discussion on GM/PM protection within the CO2 PServer - Discussions / Questions forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Feb 2009
Posts: 84
Received Thanks: 14
GM/PM protection

is there a way i can make GM/PM trade people stuff pk people and do other things like a normal player ?



daniel7851109 is offline  
Old 06/17/2010, 20:07   #2
 
elite*gold: 0
Join Date: Jun 2010
Posts: 118
Received Thanks: 23
I've seen it in this thread before

If you can't find it there , I can explain to you how its done in tanel's source


~Master is offline  
Old 06/17/2010, 20:38   #3
 
elite*gold: 0
Join Date: Feb 2009
Posts: 84
Received Thanks: 14
Quote:
Originally Posted by ~Master View Post
I've seen it in this thread before

If you can't find it there , I can explain to you how its done in tanel's source
well can it be removed can u explain to me please
daniel7851109 is offline  
Old 06/17/2010, 20:42   #4
 
elite*gold: 0
Join Date: May 2010
Posts: 630
Received Thanks: 130
try search in future thanks


.Summer is offline  
Old 06/17/2010, 20:46   #5
 
elite*gold: 0
Join Date: Jun 2010
Posts: 118
Received Thanks: 23
1- To make it possible for GM/PM to pk:
Open Character.cs

Remove this part
Code:
if(!MyClient.GM)
                            foreach (Character C in World.H_Chars.Values)
                            {
                                if (C.Alive && C != this)
                                {
                                    if (MyMath.PointDistance(Loc.X, Loc.Y, C.Loc.X, C.Loc.Y) <= Dist)
                                        if (C.PKAble(PKMode, this) && !SU.PlayerTargets.Contains(C) && !World.NoPKMaps.Contains(Loc.Map))
                                            SU.PlayerTargets.Add(C, SU.GetDamage(C));
                                }
Open Attack.cs

Remove this part
Code:
 if (PossChar != null)
                        if (GC.GM)
                            return;
Open Skill.cs

Remove this part
Code:
if (User.MyClient.GM && C.EntityID == User.EntityID || !User.MyClient.GM)
Also remove this part
Code:
if (User.MyClient.GM)
                        {
                            if (C.EntityID != User.EntityID)
                            {
                                continue;
                            }
                        }
2-To make it possible to make GM/PM Trade normal :
Open Trade.cs

Replace the whole code with this one
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NewestCOServer.Game;

namespace NewestCOServer.PacketHandling
{
    public class Trade
    {
        static void CancelTrade(Main.GameClient C)
        {
            if (C.MyChar.Trading)
            {
                Character Who = (Character)World.H_Chars[C.MyChar.TradingWith];
                if (Who != null)
                {
                    Who.MyClient.AddSend(Packets.TradePacket(C.MyChar.TradingWith, 5));
                    Who.Trading = false;
                    Who.TradingWith = 0;
                    Who.TradeSide.Clear();
                    Who.TradingCPs = 0;
                    Who.TradingSilvers = 0;
                    Who.ClickedOK = false;
                    Who.Silvers = Who.Silvers;//update the silvers
                    Who.CPs = Who.CPs;//update the cps
                    Who.MyClient.AddSend(Packets.ChatMessage(Who.MyClient.MessageID, "SYSTEM", Who.Name, "Trading failed!", 2005, 0));
                }
                C.AddSend(Packets.TradePacket(C.MyChar.TradingWith, 5));
                C.MyChar.Trading = false;
                C.MyChar.TradingWith = 0;
                C.MyChar.TradeSide = new System.Collections.ArrayList(20);
                C.MyChar.TradingCPs = 0;
                C.MyChar.TradingSilvers = 0;
                C.MyChar.ClickedOK = false;
                C.MyChar.CPs = C.MyChar.CPs;//update the cps
                C.MyChar.Silvers = C.MyChar.Silvers;//update the silvers
                C.AddSend(Packets.ChatMessage(C.MessageID, "SYSTEM", C.MyChar.Name, "Trading failed!", 2005, 0));
            }
        }
        public static void Handle(Main.GameClient C, byte[] Data)
        {
            uint UID = BitConverter.ToUInt32(Data, 4);
            byte Type = Data[8];

            switch (Type)
            {
                case 1:
                    {
                        Character Who = (Character)World.H_Chars[UID];
                        if (Who != null && !Who.Trading)
                        {
                            if (!C.MyChar.Trading)
                            {
                                if (Who.EntityID != C.MyChar.TradingWith)
                                {
                                    C.MyChar.TradingWith = UID;
                                    if (Who.EntityID == C.MyChar.TradingWith && Who.TradingWith == C.MyChar.EntityID)
                                    {
                                        Who.MyClient.AddSend(Packets.TradePacket(C.MyChar.EntityID, 3));
                                        C.AddSend(Packets.TradePacket(Who.EntityID, 3));
                                        C.MyChar.Trading = true;
                                        Who.Trading = true;
                                        break;
                                    }
                                    else
                                    {
                                        C.AddSend(Packets.ChatMessage(C.MessageID, "SYSTEM", C.MyChar.Name, "[Trade]Request for trading has been sent out.", 2005, 0));
                                        Who.MyClient.AddSend(Packets.TradePacket(C.MyChar.EntityID, 1));
                                    }
                                }
                                if (Who.EntityID == C.MyChar.TradingWith && Who.TradingWith == C.MyChar.EntityID)
                                {
                                    Who.MyClient.AddSend(Packets.TradePacket(C.MyChar.EntityID, 3));
                                    C.AddSend(Packets.TradePacket(Who.EntityID, 3));
                                    C.MyChar.Trading = true;
                                    Who.Trading = true;
                                }
                            }
                            else
                                C.AddSend(Packets.ChatMessage(C.MessageID, "SYSTEM", C.MyChar.Name, "[Trade]Close the current trade before you take another one.", 2005, 0));
                        }
                        else
                            C.AddSend(Packets.ChatMessage(C.MessageID, "SYSTEM", C.MyChar.Name, "[Trade]The target is trading with someone else.", 2005, 0));

                        break;
                    }
                case 2:
                    {
                        CancelTrade(C);
                        break;
                    }
                case 6:
                    {
                        Character Who = (Character)World.H_Chars[C.MyChar.TradingWith];
                        if (Who != null)
                        {
                            if (C.MyChar.TradeSide.Count < 20)
                            {
                                if (Who.Inventory.Count + C.MyChar.TradeSide.Count < 40)
                                {
                                    Game.Item I = C.MyChar.FindInvItem(UID);
                                    if (!I.FreeItem)
                                    {
                                        Who.MyClient.AddSend(Packets.TradeItem(I));
                                        C.MyChar.TradeSide.Add(I.UID);
                                    }
                                    else
                                    {
                                        C.AddSend(Packets.TradePacket(UID, 11));
                                        C.AddSend(Packets.ChatMessage(C.MessageID, "SYSTEM", C.MyChar.Name, "[Trade]Cannot trade items made with gm commands.", 2005, 0));
                                    }
                                }
                                else
                                {
                                    C.AddSend(Packets.TradePacket(UID, 11));
                                    C.AddSend(Packets.ChatMessage(C.MessageID, "SYSTEM", C.MyChar.Name, "[Trade]Your trade partner can't hold any more items.", 2005, 0));
                                    Who.MyClient.AddSend(Packets.ChatMessage(C.MessageID, "SYSTEM", C.MyChar.Name, "[Trade]The one your trading with cant add anymore items on the table because you have no room in your inventory.", 2005, 0));
                                }
                            }

                        }
                        break;
                    }
                case 7:
                    {
                        C.MyChar.TradingSilvers = UID;
                        Character Who = (Character)World.H_Chars[C.MyChar.TradingWith];
                        Who.MyClient.AddSend(Packets.TradePacket(UID, 8));

                        break;
                    }
                case 13:
                    {
                        C.MyChar.TradingCPs = UID;
                        Character Who = (Character)World.H_Chars[C.MyChar.TradingWith];
                        Who.MyClient.AddSend(Packets.TradePacket(UID, 12));

                        break;
                    }
                case 10:
                    {
                        Character Who = (Character)World.H_Chars[C.MyChar.TradingWith];

                        if (Who != null && Who.ClickedOK)
                        {
                                if (C.MyChar.Silvers >= C.MyChar.TradingSilvers && C.MyChar.CPs >= C.MyChar.TradingCPs && Who.Silvers >= Who.TradingSilvers && Who.CPs >= Who.TradingCPs)
                                {
                                    Who.MyClient.AddSend(Packets.TradePacket(C.MyChar.TradingWith, 5));
                                    C.AddSend(Packets.TradePacket(C.MyChar.EntityID, 5));

                                    Who.Silvers += C.MyChar.TradingSilvers;
                                    Who.Silvers -= Who.TradingSilvers;
                                    C.MyChar.Silvers += Who.TradingSilvers;
                                    C.MyChar.Silvers -= C.MyChar.TradingSilvers;

                                    Who.CPs += C.MyChar.TradingCPs;
                                    Who.CPs -= Who.TradingCPs;
                                    C.MyChar.CPs += Who.TradingCPs;
                                    C.MyChar.CPs -= C.MyChar.TradingCPs;


                                    foreach (uint Id in C.MyChar.TradeSide)
                                    {
                                        Game.Item I = C.MyChar.FindInvItem(Id);
                                        Who.AddItem(I);
                                        C.MyChar.RemoveItem(I);
                                    }
                                    foreach (uint Id in Who.TradeSide)
                                    {
                                        Game.Item I = Who.FindInvItem(Id);
                                        C.MyChar.AddItem(I);
                                        Who.RemoveItem(I);
                                    }

                                    Who.Trading = false;
                                    Who.TradingWith = 0;
                                    Who.TradeSide = new System.Collections.ArrayList(20);
                                    Who.TradingCPs = 0;
                                    Who.TradingSilvers = 0;
                                    Who.ClickedOK = false;
                                    Who.MyClient.AddSend(Packets.ChatMessage(Who.MyClient.MessageID, "SYSTEM", Who.Name, "Trading succeeded!", 2005, 0));
                                    C.MyChar.Trading = false;
                                    C.MyChar.TradingWith = 0;
                                    C.MyChar.TradeSide = new System.Collections.ArrayList(20);
                                    C.MyChar.TradingCPs = 0;
                                    C.MyChar.TradingSilvers = 0;
                                    C.MyChar.ClickedOK = false;
                                    C.AddSend(Packets.ChatMessage(C.MessageID, "SYSTEM", C.MyChar.Name, "Trading succeeded!", 2005, 0));
                                }
                                else
                                    CancelTrade(C);  
                            } 
                        else
                        {
                            C.MyChar.ClickedOK = true;
                            Who.MyClient.AddSend(Packets.TradePacket(0, 10));
                        }

                        break;
                    }
            }
        }
    }
}
~Master is offline  
Thanks
2 Users
Old 06/17/2010, 20:49   #6
 
elite*gold: 0
Join Date: May 2010
Posts: 630
Received Thanks: 130
you should have let him learned it by himself.
he will become alot better, then.
.Summer is offline  
Old 06/17/2010, 20:53   #7
 
elite*gold: 0
Join Date: Jun 2010
Posts: 118
Received Thanks: 23
He asked for help on my chatbox .
~Master is offline  
Old 06/17/2010, 20:56   #8
 
elite*gold: 0
Join Date: May 2010
Posts: 630
Received Thanks: 130
I mean. Just tell him what to put.
Then let him figure things out by him self.
Then help him, when he gets stucked.
(ex. on tv).
He will learn alot more from that.
This is just copy + paste, wich he wont learn anything from
.Summer is offline  
Old 06/17/2010, 21:37   #9
 
elite*gold: 0
Join Date: Feb 2009
Posts: 84
Received Thanks: 14
Quote:
Originally Posted by .Summer View Post
I mean. Just tell him what to put.
Then let him figure things out by him self.
Then help him, when he gets stucked.
(ex. on tv).
He will learn alot more from that.
This is just copy + paste, wich he wont learn anything from
well im havving error with the trade.cs im trying to figure out my self
so its just not copy and paste.



Yay i fixed the trade.cs all by my self
daniel7851109 is offline  
Thanks
1 User
Old 06/17/2010, 21:41   #10
 
elite*gold: 0
Join Date: May 2010
Posts: 630
Received Thanks: 130
Is good to see
.Summer is offline  
Old 06/18/2010, 06:41   #11
 
elite*gold: 0
Join Date: Oct 2009
Posts: 8,740
Received Thanks: 5,276
Quote:
Originally Posted by .Summer View Post
you should have let him learned it by himself.
he will become alot better, then.
He did a good enough job helping the member(Kudos to ~Master for doing so), if you have anything else to say to him leave it to private message.


Arcо is offline  
Reply



« [Coding] I'll code for ya | Client update? »

Similar Threads
Bot protection.
04/13/2010 - Lineage 2 - 5 Replies
Hey I am plaing on one l2 private server (name doesn't matter). Everything was ok until they made some bot protection. Mayby you guys can help me. When I start botting (when I start auto combat) I get message : Imageshack - 2141m.jpg I get it few times and then my game closes. thank you in advance.
is there a way to set up an no-pk protection?
01/27/2010 - EO PServer Hosting - 1 Replies
hello. one more time i need help hehe. i want to know if there is a way to set up an protection that dont let players atack others... just mobs in the map... like the protection in the market... if there is a way pls help me...
mayn and they protection...
09/05/2009 - 12Sky2 - 15 Replies
muhahaha mayn and they protection is shit like fk dunno what ^^. just broke them xD. Thx Striker if not you i will don't know from what to start xD. HAHAHA I MAID SO PET PICK UP SILVERS AND NO NEED 100% HAHAHAHA
Protection
01/31/2009 - Silkroad Online - 2 Replies
I'm so depressed caz' i got hacked once again. The only thing that ive done is that ive downloaded a video "arabian race trailor" from a post "Future abdates" from one of the people who has comented on the main post. I'm not saying that #[email protected]# about the forum, on the contrary, it's one of the greatest forums ever. But there are people who use such things. After i downloaded it, and after my main character loged off, i returned to discover that the servers are "offline", although my noob was...
Mo/X - Protection
07/07/2005 - Guild Wars - 0 Replies
So, ich bin wieder zurück und bring gleich was mit :eek: This build is based on heavy supporting another person. In a way this person reaches invinciblity as long as none of the enchantments get removed. It is a perfect build to farm places with few creatures doing awfully high damage (like Underworld or augury rock). So let&#39;s start with the Attributes: Healing - As high as possible Smiting - Unimportant for this build Protection - min. 14 Divine Favor - As high as possible



All times are GMT +2. The time now is 23:36.


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

BTC: 3KeUpz52VCbhmLwuwydqxu6U1xsgbT8YT5
ETH: 0xc6ec801B7563A4376751F33b0573308aDa611E05

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