|
You last visited: Today at 18:05
Advertisement
[Help]Guild Allies
Discussion on [Help]Guild Allies within the CO2 Private Server forum part of the Conquer Online 2 category.
02/12/2010, 02:10
|
#1
|
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
|
|
|
02/12/2010, 02:42
|
#2
|
elite*gold: 0
Join Date: May 2006
Posts: 127
Received Thanks: 91
|
Quote:
Originally Posted by coreymills
could someone help me with this please
|
what exactly is your problem with that code
|
|
|
02/12/2010, 02:59
|
#3
|
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
|
|
|
02/12/2010, 03:58
|
#4
|
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
|
|
|
02/14/2010, 11:09
|
#5
|
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
|
|
|
02/14/2010, 12:14
|
#6
|
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?
|
|
|
02/14/2010, 13:04
|
#7
|
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);
|
|
|
02/14/2010, 13:22
|
#8
|
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
|
Whats this defined as?
Code:
MyChar.MyGuild.Allies
|
|
|
02/14/2010, 13:23
|
#9
|
elite*gold: 0
Join Date: Mar 2008
Posts: 555
Received Thanks: 99
|
an array
|
|
|
02/14/2010, 13:25
|
#10
|
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.
|
|
|
 |
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.
|
|