Register for your free account! | Forgot your password?

You last visited: Today at 18:05

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

Advertisement



[Help]Guild Allies

Discussion on [Help]Guild Allies within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
coreymills's Avatar
 
elite*gold: 0
Join Date: Mar 2008
Posts: 555
Received Thanks: 99
[Help]Guild Allies

could someone help me with allies this is what i have so far

Code:
if (MyChar.GuildPosition == 100)
                                {
                                    if (MyChar.MyGuild.Allies.Count <= 6)
                                    {
                                        string Allies = "";
                                        for (int i = 14; i < 14 + Data[13]; i++)
                                        {
                                            Allies += Convert.ToString(Data[i]);
                                        }
                                        uint GuildID = 0;

                                        foreach (DictionaryEntry DE in MyChar.MyGuild.Allies)
                                        {
                                            string ally = (string)DE.Value;
                                            string[] Splitter = ally.Split(':');

                                            if (Splitter[0] == Allies)
                                                GuildID = uint.Parse(Splitter[1]);
                                        }
                                    }
                                    else
                                    {
                                        SendPacket(General.MyPackets.NPCSay("You can only have 6 Allies."));
                                        SendPacket(General.MyPackets.NPCLink("Ok.", 255));
                                        SendPacket(General.MyPackets.NPCSetFace(30));
                                        SendPacket(General.MyPackets.NPCFinish());
                                    }
                                }
                                else
                                {
                                    SendPacket(General.MyPackets.NPCSay("You are not the Guild Leader."));
                                    SendPacket(General.MyPackets.NPCLink("Ok.", 255));
                                    SendPacket(General.MyPackets.NPCSetFace(30));
                                    SendPacket(General.MyPackets.NPCFinish());
                                }
could someone help me with this please
coreymills is offline  
Old 02/12/2010, 02:42   #2
 
elite*gold: 0
Join Date: May 2006
Posts: 127
Received Thanks: 91
Quote:
Originally Posted by coreymills View Post

could someone help me with this please
what exactly is your problem with that code
kamote is offline  
Old 02/12/2010, 02:59   #3
 
coreymills's Avatar
 
elite*gold: 0
Join Date: Mar 2008
Posts: 555
Received Thanks: 99
when i try to add the allies it gives me errors

forgot to mention that the error is in the console and i get the error when i try to add the allie to my guild ingame
coreymills is offline  
Old 02/12/2010, 03:58   #4
 
salem rey's Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 275
Received Thanks: 43
hope this will fix so that corey will release a guild allies and enemies
salem rey is offline  
Old 02/14/2010, 11:09   #5
 
coreymills's Avatar
 
elite*gold: 0
Join Date: Mar 2008
Posts: 555
Received Thanks: 99
so i take it no one can help or they just dont want to help
coreymills is offline  
Old 02/14/2010, 12:14   #6


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
I think this was mentioned last time but, what exactly is it that you need help with?
Korvacs is offline  
Old 02/14/2010, 13:04   #7
 
coreymills's Avatar
 
elite*gold: 0
Join Date: Mar 2008
Posts: 555
Received Thanks: 99
when i try to add the allies to my guild ingame i get an error in the console

Quote:
System.InvalidCastException: Specified cast is not valid.
at COServer_Project.Client.GetPacket(Byte[] data) in C:\Documents and Settings\Corey\Desktop\MeteorCo V5017\RandomCo\COServerProject1\COServerProject\Cl ient.cs:line 4064
at COServer_Project.General.GamePacketHandler(Object Sender, HybridSocket Socket) in C:\Documents and Settings\Corey\Desktop\MeteorCo V5017\RandomCo\COServerProject1\COServerProject\Ge neral.cs:line 353
Client.cs Line 4064
Code:
foreach (DictionaryEntry DE in MyChar.MyGuild.Allies)
General.cs Line 353
Code:
Cli.GetPacket(Data);
coreymills is offline  
Old 02/14/2010, 13:22   #8


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
Whats this defined as?

Code:
MyChar.MyGuild.Allies
Korvacs is offline  
Old 02/14/2010, 13:23   #9
 
coreymills's Avatar
 
elite*gold: 0
Join Date: Mar 2008
Posts: 555
Received Thanks: 99
an array
coreymills is offline  
Old 02/14/2010, 13:25   #10


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
An array of...?

Well im going to guess string based on what your doing.

DictionaryEntry can only be used with Dictionarys, examples of these are Hashtable() and Dictionary<,>(). What you need is something like this:

Code:
                foreach (string ally in MyChar.MyGuild.Allies)
                {
                    string[] Splitter = ally.Split(':');

                    if (Splitter[0] == Allies)
                        GuildID = uint.Parse(Splitter[1]);
                }
See if that works.
Korvacs is offline  
Reply


Similar Threads Similar Threads
Save Guild Enemies/Allies
12/07/2010 - CO2 PServer Guides & Releases - 131 Replies
First and foremost this is for 5165 Tanel source. NewestCOServer. Well first define this in features/guilds.cs under public class Guild public Dictionary<uint, string> Allies = new Dictionary<uint, string>(); public Dictionary<uint, string> Enemies = new Dictionary<uint, string>(); public static void CreateNewGuild(string GName, ushort GID, Character Creator) And at the bottom of this void, put this
[Problem]Guild Allies and Enemies
08/16/2010 - CO2 Private Server - 2 Replies
Well after two days of having a go at this, and one day of asking people for help, I finally decided it was time to ask the community for help. Well I am trying to load allies from the Guilds.dat file. They are defined as public Dictionary<uint, string> Allies = new Dictionary<uint, string>(); When something is added to the dictionary its like this. Allies.Add(GuildID, GuildName); Now when saving to the guild.dat file, its saved like this. BW.Write((int)Allies.Count); ...
allies and enemies
03/31/2010 - CO2 Private Server - 1 Replies
Anybody know if Guild Allie and Enemy code is released for LOTF? The status are added, but not codes for npc. And im to lazy to make it, so if is not released ill just leave it untill i got time to make it ^^ Thanks
[Question]Guild Allies
02/02/2010 - CO2 Private Server - 0 Replies
could someone help me with adding allies its for 5017
guild and allies
12/29/2007 - CO2 Weapon, Armor, Effects & Interface edits - 0 Replies
hi all i was thinking does anyone know if its possible to make allie colors yellow and guild green cause i like the green more grtz



All times are GMT +1. The time now is 18:06.


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.