Register for your free account! | Forgot your password?

You last visited: Today at 18:44

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

Advertisement



[Release] CP Admin (My way)

Discussion on [Release] CP Admin (My way) within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jan 2007
Posts: 220
Received Thanks: 63
[Release] CP Admin (My way)

This is the code to make CP Admin work to trade your DBs and DB Scrolls for CPs, report any bugs any errors and stuff here and i'll try to fix them. enjoy.

So go to 'Handler', 'Npc Talk.cs' and add the following code:

Code:
// Coded by : BlooDie
                case 2071: // CP ADMIN
                    {
                        if (LinkBack == 0)
                        {
                            Text("HELLO", CSocket);
                            Link("DragonBall", 1, CSocket);
                            Link("DragonBall Scroll", 2, CSocket);
                            Link("Just passing by", 255, CSocket);
                            Face(6, CSocket);
                            End(CSocket);
                        }

                        else if (LinkBack == 1)
                        {
                            int uid = 0;
                            bool cont = false;
                            foreach (Struct.ItemInfo Item in CSocket.Client.Inventory.Values)
                            {
                                if (Item.ItemID == 1088000)
                                {
                                    uid = Item.UID;
                                    cont = true;
                                    break;
                                }
                            }

                            if (cont)
                            {
                                if (CSocket.Client.CPs + 215 > 999999999)
                                    CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "You can not hold more then 999,999,999 CPs", Struct.ChatType.Top));

                                else
                                {
                                    CSocket.Client.Inventory.Remove(uid);
                                    CSocket.Send(ConquerPacket.ItemUsage(uid, 255, Struct.ItemUsage.RemoveItem));
                                    Database.Database.DeleteItem(uid);
                                    while (!CSocket.Send(ConquerPacket.ItemUsage(uid, 255, Struct.ItemUsage.RemoveItem)))
                                    {
                                        CSocket.Client.Inventory.Remove(uid);
                                        CSocket.Send(ConquerPacket.ItemUsage(uid, 255, Struct.ItemUsage.RemoveItem));
                                        Database.Database.DeleteItem(uid);
                                    }
                                    CSocket.Client.CPs += 215;
                                    CSocket.Send(ConquerPacket.Status(CSocket, 2, CSocket.Client.CPs, Struct.StatusTypes.InvCPoints));
                                }
                            }
                            else
                            {
                                Text("You don't have a DragonBall.", CSocket);
                                Link("I see.", 255, CSocket);
                                Face(6, CSocket);
                                End(CSocket);
                            }
                        }
                        else if (LinkBack == 2)
                        {
                            int uid = 0;
                            bool cont = false;
                            foreach (Struct.ItemInfo Item in CSocket.Client.Inventory.Values)
                            {
                                if (Item.ItemID == 720028)
                                {
                                    uid = Item.UID;
                                    cont = true;
                                    break;
                                }
                            }

                            if (cont)
                            {
                                if (CSocket.Client.CPs + 2150 > 999999999)
                                    CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "You can not hold more then 999,999,999 CPs", Struct.ChatType.Top));

                                else
                                {
                                    CSocket.Client.Inventory.Remove(uid);
                                    CSocket.Send(ConquerPacket.ItemUsage(uid, 255, Struct.ItemUsage.RemoveItem));
                                    Database.Database.DeleteItem(uid);
                                    while (!CSocket.Send(ConquerPacket.ItemUsage(uid, 255, Struct.ItemUsage.RemoveItem)))
                                    {
                                        CSocket.Client.Inventory.Remove(uid);
                                        CSocket.Send(ConquerPacket.ItemUsage(uid, 255, Struct.ItemUsage.RemoveItem));
                                        Database.Database.DeleteItem(uid);
                                    }
                                    CSocket.Client.CPs += 2150;
                                    CSocket.Send(ConquerPacket.Status(CSocket, 2, CSocket.Client.CPs, Struct.StatusTypes.InvCPoints));
                                }
                            }
                            else
                            {
                                Text("You don't have a DragonBall Scroll.", CSocket);
                                Link("I see.", 255, CSocket);
                                Face(6, CSocket);
                                End(CSocket);
                            }
                        }
                        break;
                    }
Remember to press 'Thank' button or say Thank if your using or taking any ideas from this code, enjoy =)
BlooD-BoY is offline  
Thanks
9 Users
Old 06/06/2009, 05:53   #2
 
elite*gold: 0
Join Date: Nov 2006
Posts: 65
Received Thanks: 2
works like real CO.
killerbee is offline  
Old 06/06/2009, 09:32   #3
 
$HaDoW's Avatar
 
elite*gold: 0
Join Date: Sep 2007
Posts: 285
Received Thanks: 78
this was already release like 5 times !
and here is a real one -_-
Code:
case 2071://Market CPAdmin 
                    {
                        if (LinkBack == 0)
                        {
                            Text("Do you know how I desire the Dragonball? I would like to pay all I have for Dragonballs. Would you like to exchange Dragonballs for CPs? I will pay you 215 CPs for a Dragonball, and 2150 CPs for a DBScroll.", CSocket);
                            Text("I also exchange Money for Cps ! It will only cost you I can exchange 10,000,000 Gold into 1000 cps.", CSocket);
                            Link("Yes, i want 215 CPs for my dragonball.", 1, CSocket);
                            Link("Yes, i want 2150 CPs for my DBScroll.", 2, CSocket);
							Link("1000 CPs.", 3, CSocket);
                            Link("Just passing by.", 255, CSocket);
                            Face(30, CSocket);
                            End(CSocket);
                        }
                        else if (LinkBack == 1)
                        {
                            if (InventoryContains(1088000, 1, CSocket))
                            {
                                CSocket.Client.CPs += 215;
                                int uid = ReturnUID(1088000, CSocket);
                                CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "You now have " + CSocket.Client.CPs + " CPs.", Struct.ChatType.Top));
                                CSocket.Send(ConquerPacket.Status(CSocket, 2, CSocket.Client.CPs, Struct.StatusTypes.InvCPoints));
                                CSocket.Client.Inventory.Remove(uid);
                                CSocket.Send(ConquerPacket.ItemUsage(uid, 255, Struct.ItemUsage.RemoveItem));
                                Database.Database.DeleteItem(uid);
                            }
                            else
                            {
                                Text("You don't have a dragonball.", CSocket);
                                Link("Oh sorry.", 255, CSocket);
                                Face(30, CSocket);
                                End(CSocket);
                            }
                        }
                        else if (LinkBack == 2)
                        {
                            if (InventoryContains(720028, 1, CSocket))
                            {
                                CSocket.Client.CPs += 2150;
                                int uid = ReturnUID(720028, CSocket);
                                CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "You now have " + CSocket.Client.CPs + " CPs.", Struct.ChatType.Top));
                                CSocket.Send(ConquerPacket.Status(CSocket, 2, CSocket.Client.CPs, Struct.StatusTypes.InvCPoints));
                                CSocket.Client.Inventory.Remove(uid);
                                CSocket.Send(ConquerPacket.ItemUsage(uid, 255, Struct.ItemUsage.RemoveItem));
                                Database.Database.DeleteItem(uid);
                            }
                            else
                            {
                                Text("You don't have a dragonball scroll.", CSocket);
                                Link("oh sorry.", 255, CSocket);
                                Face(30, CSocket);
                                End(CSocket);
                            }
                        }
						else if (LinkBack == 3)
                        {
                            if (CSocket.Client.Money >= 10000000)
                            {
                                Money(-10000000, CSocket);
                                CPs (+1000, CSocket);
                            }
                            else
                            {
                                Text("How dare you try to rip me off! Get lost, Or get my money!", CSocket);
                                Link("I'm sorry, I didn't realize.", 255, CSocket);
                                Face(30, CSocket);
								End(CSocket);
                            }
                        }
                        break;
                    }
$HaDoW is offline  
Thanks
1 User
Old 06/06/2009, 14:26   #4
 
elite*gold: 0
Join Date: Jan 2007
Posts: 220
Received Thanks: 63
Quote:
Originally Posted by $HaDoW View Post
this was already release like 5 times !
and here is a real one -_-
Code:
case 2071://Market CPAdmin 
                    {
                        if (LinkBack == 0)
                        {
                            Text("Do you know how I desire the Dragonball? I would like to pay all I have for Dragonballs. Would you like to exchange Dragonballs for CPs? I will pay you 215 CPs for a Dragonball, and 2150 CPs for a DBScroll.", CSocket);
                            Text("I also exchange Money for Cps ! It will only cost you I can exchange 10,000,000 Gold into 1000 cps.", CSocket);
                            Link("Yes, i want 215 CPs for my dragonball.", 1, CSocket);
                            Link("Yes, i want 2150 CPs for my DBScroll.", 2, CSocket);
							Link("1000 CPs.", 3, CSocket);
                            Link("Just passing by.", 255, CSocket);
                            Face(30, CSocket);
                            End(CSocket);
                        }
                        else if (LinkBack == 1)
                        {
                            if (InventoryContains(1088000, 1, CSocket))
                            {
                                CSocket.Client.CPs += 215;
                                int uid = ReturnUID(1088000, CSocket);
                                CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "You now have " + CSocket.Client.CPs + " CPs.", Struct.ChatType.Top));
                                CSocket.Send(ConquerPacket.Status(CSocket, 2, CSocket.Client.CPs, Struct.StatusTypes.InvCPoints));
                                CSocket.Client.Inventory.Remove(uid);
                                CSocket.Send(ConquerPacket.ItemUsage(uid, 255, Struct.ItemUsage.RemoveItem));
                                Database.Database.DeleteItem(uid);
                            }
                            else
                            {
                                Text("You don't have a dragonball.", CSocket);
                                Link("Oh sorry.", 255, CSocket);
                                Face(30, CSocket);
                                End(CSocket);
                            }
                        }
                        else if (LinkBack == 2)
                        {
                            if (InventoryContains(720028, 1, CSocket))
                            {
                                CSocket.Client.CPs += 2150;
                                int uid = ReturnUID(720028, CSocket);
                                CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "You now have " + CSocket.Client.CPs + " CPs.", Struct.ChatType.Top));
                                CSocket.Send(ConquerPacket.Status(CSocket, 2, CSocket.Client.CPs, Struct.StatusTypes.InvCPoints));
                                CSocket.Client.Inventory.Remove(uid);
                                CSocket.Send(ConquerPacket.ItemUsage(uid, 255, Struct.ItemUsage.RemoveItem));
                                Database.Database.DeleteItem(uid);
                            }
                            else
                            {
                                Text("You don't have a dragonball scroll.", CSocket);
                                Link("oh sorry.", 255, CSocket);
                                Face(30, CSocket);
                                End(CSocket);
                            }
                        }
						else if (LinkBack == 3)
                        {
                            if (CSocket.Client.Money >= 10000000)
                            {
                                Money(-10000000, CSocket);
                                CPs (+1000, CSocket);
                            }
                            else
                            {
                                Text("How dare you try to rip me off! Get lost, Or get my money!", CSocket);
                                Link("I'm sorry, I didn't realize.", 255, CSocket);
                                Face(30, CSocket);
								End(CSocket);
                            }
                        }
                        break;
                    }
funny how all 5 of them didn't work correctly, they didn't even remove the items. now the one you just released looks good, good job =)
BlooD-BoY is offline  
Old 06/06/2009, 16:22   #5
 
$HaDoW's Avatar
 
elite*gold: 0
Join Date: Sep 2007
Posts: 285
Received Thanks: 78
maybe you dont have these lines on the bottom
Code:
GONE CUS YOU are a *** ! 
^_^
$HaDoW is offline  
Old 06/06/2009, 16:24   #6
 
elite*gold: 0
Join Date: Dec 2007
Posts: 226
Received Thanks: 55
@ shadow
i suggest you remove the last post.
the person who made the codes, "inventory, returnUID" removed his own
you should need autorisation to post that

Quote:
Originally Posted by scottdavey View Post
# Deleted, i've decided to let people attempt to code the source themselves, thus becoming a better programmer.
Code:
public static bool InventoryContains(int itemid, int amount, ClientSocket CSocket) [COLOR="red"]//By scottdavey[/COLOR]
public static int ReturnUID(int itemid, ClientSocket CSocket) [COLOR="Red"]// By scottdavey[/COLOR]
yuko is offline  
Old 06/13/2009, 15:52   #7
 
elite*gold: 0
Join Date: Jun 2007
Posts: 69
Received Thanks: 2
where/how can i fix this error

Error 1 The name 'Face' does not exist in the current context E:\CoEmu v2\CoEmu v2\CoEmu v2 GameServer\Handlers\NpcTalk.cs 1260 29 CoEmu v2 GameServer
editor05 is offline  
Old 06/13/2009, 20:41   #8
 
WHITELIONX's Avatar
 
elite*gold: 0
Join Date: Apr 2006
Posts: 532
Received Thanks: 66
I got about 7 errors with the one of these for cpadmin UID didn`t exist face didn`t exist etc etc
WHITELIONX is offline  
Old 06/13/2009, 21:35   #9
 
Zeroxelli's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 1,769
Received Thanks: 1,142
Quote:
Originally Posted by $HaDoW View Post
this was already release like 5 times !
and here is a real one -_-
Code:
 /* Removed */
Fix'd, do the same.

Quote:
Originally Posted by $HaDoW View Post
maybe you dont have these lines on the bottom
Code:
GONE CUS YOU are a FAG ! 
^_^
Only fags notice fags, clean your mirror pl0x.

Quote:
Originally Posted by yuko View Post
@ shadow
i suggest you remove the last post.
the person who made the codes, "inventory, returnUID" removed his own
you should need autorisation to post that


Code:
public static bool InventoryContains(int itemid, int amount, ClientSocket CSocket) [COLOR="red"]//By scottdavey[/COLOR]
public static int ReturnUID(int itemid, ClientSocket CSocket) [COLOR="Red"]// By scottdavey[/COLOR]
Exactly, infringement much? :P

Quote:
Originally Posted by editor05 View Post
where/how can i fix this error

Error 1 The name 'Face' does not exist in the current context E:\CoEmu v2\CoEmu v2\CoEmu v2 GameServer\Handlers\NpcTalk.cs 1260 29 CoEmu v2 GameServer


Quote:
Originally Posted by WHITELIONX View Post
I got about 7 errors with the one of these for cpadmin UID didn`t exist face didn`t exist etc etc


The rest is by scott, so you'll have to do it yourself.
Zeroxelli is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
[RELEASE] Acme Admin Tool
04/08/2015 - EO PServer Guides & Releases - 73 Replies
this is for all pservers that have gms thats pretty much limited to do just smaller stuffs.. with this tool they can: ban to botjail unban from botjail change names of users,pets,legions award pps ban users unban users
[RELEASE]Web Admin/User Panel v1.0
06/24/2011 - Dekaron Private Server - 10 Replies
Hello Guys,All credits going to Niky.I dont saw this tool posted in epvpers so i decided to help the community. the release function : GM/DEV/OPR Login ( detected by Character with // on the name ) Edit Accounts ( select by Account Name or Character Name ) Edit Character ( select by Character Name ) Give / Take Coins to Account ( select by Character Name ) Send Weapon to Character ( select by Character Name ) ( order by Lv till Lv / Class --> See all Weapons / Select the + )
[Release] /Admin Command
12/11/2008 - CO2 PServer Guides & Releases - 4 Replies
Sup guys. Small release coded in about 2 minutes, not tested ( as usual ). The reason im not testing is because im to lazy installing appserv, lawl. Well, here you are. This is what it does: If an player types /admin, it will list up all admins that are online , if there isnt any admin online, it says that. Search for /save or something like that where the playercommands are, and add this somewhere. if (Message == "/admin") { ...



All times are GMT +2. The time now is 18:44.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

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