|
You last visited: Today at 21:05
Advertisement
Save Guild Enemies/Allies
Discussion on Save Guild Enemies/Allies within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.
08/28/2010, 17:35
|
#16
|
elite*gold: 0
Join Date: May 2009
Posts: 884
Received Thanks: 211
|
Quote:
Originally Posted by copz1337
I get an error on these 2 lines:
Code:
G.Allies.Add(0, "");
G.Enemies.Add(0, "");
The error is "Cannot use local variable 'G' before it is declared".
|
look for:
in Guilds.cs
and add what .Arco said under
Code:
public static Hashtable AllTheGuilds = new Hashtable();
add this under there:
Code:
public Dictionary<uint, string> Allies = new Dictionary<uint, string>();
public Dictionary<uint, string> Enemies = new Dictionary<uint, string>();
I also had dis problem  .
|
|
|
08/28/2010, 19:44
|
#17
|
elite*gold: 28
Join Date: Jun 2010
Posts: 2,225
Received Thanks: 868
|
Im tired, but it did look like your using a var before you have made it.
ex:
Code:
G = "ohai";
string G;
Would not work were as
Code:
string G;
G = "ohai";
Would work.
|
|
|
08/28/2010, 22:13
|
#18
|
elite*gold: 0
Join Date: Oct 2009
Posts: 8,783
Received Thanks: 5,304
|
IT looks as if he added it to the top of the void, rather than the bottom as I directed.
|
|
|
08/28/2010, 22:40
|
#19
|
elite*gold: 0
Join Date: May 2009
Posts: 884
Received Thanks: 211
|
Quote:
Originally Posted by .Arco
IT looks as if he added it to the top of the void, rather than the bottom as I directed.
|
its not that its just that u told him to put it in rather than becuz once u put it under that it wont find the reference as directed...
|
|
|
08/29/2010, 07:35
|
#20
|
elite*gold: 0
Join Date: Sep 2007
Posts: 188
Received Thanks: 8
|
Quote:
Originally Posted by .Arco
Make sure your server is off, delete guilds.dat. and then start the server, create a guild, and see if it works.
And as of adding the enemies via npc, just make the npc add the enemy ID and Name.
|
COULD YOU EXPLAIN MORE ABOUT NPC AND PACKET TO ADD...
|
|
|
08/29/2010, 07:42
|
#21
|
elite*gold: 0
Join Date: Oct 2009
Posts: 8,783
Received Thanks: 5,304
|
Actually I did tell him
Quote:
Code:
public static void CreateNewGuild(string GName, ushort GID, Character Creator)
And at the bottom of this void, put this
Code:
G.Allies.Add(0, "");
G.Enemies.Add(0, "");
|
|
|
|
08/30/2010, 16:47
|
#22
|
elite*gold: 0
Join Date: Sep 2008
Posts: 39
Received Thanks: 0
|
Well, you released how to ADD them...
tried to write it for myself ( didnt work ... ^^ )...
I'd like to see you releasing how to REMOVE them again?
|
|
|
08/30/2010, 18:22
|
#23
|
elite*gold: 0
Join Date: May 2006
Posts: 1,190
Received Thanks: 516
|
Quote:
Originally Posted by 2087
Well, you released how to ADD them...
tried to write it for myself ( didnt work ... ^^ )...
I'd like to see you releasing how to REMOVE them again?
|
He has given you the basis for this. To remove them is quite simple I coded one myself in a short amount of time. Try making it again it is quite simple to do.
|
|
|
08/30/2010, 21:55
|
#24
|
elite*gold: 0
Join Date: Oct 2009
Posts: 8,783
Received Thanks: 5,304
|
Quote:
Originally Posted by 2087
Well, you released how to ADD them...
tried to write it for myself ( didnt work ... ^^ )...
I'd like to see you releasing how to REMOVE them again?
|
if (GC.MyChar.MyGuild.Allies.Contains(ReadString))
{
Remove;
}
|
|
|
08/31/2010, 01:09
|
#25
|
elite*gold: 0
Join Date: Sep 2008
Posts: 39
Received Thanks: 0
|
I added it to a NPC, but it didnt work at all .Arco ...
Here's the code and the erros.
Code:
else if (Control == 31)
{
string Enemy = ReadString(Data);
foreach (Features.Guild g in Features.Guilds.AllTheGuilds.Values)
{
if (g.GuildName == Enemy)
{
if ([COLOR="Red"]GC.MyChar.MyGuild.Enemies.Contains(ReadString)[/COLOR])
{
[COLOR="Red"]Remove[/COLOR];
}
else
{
GC.AddSend(Packets.NPCSay(g.GuildName + " is already your Enemy!."));
GC.AddSend(Packets.NPCLink2("Damn", 255));
}
}
}
}
Code:
Fehler 1 "System.Collections.Generic.Dictionary<uint,string>" enthält keine Definition für "Contains", und die Überladung der optimalen Erweiterungsmethode "NewestCOServer.MyMath.Contains(NewestCOServer.coords[], NewestCOServer.coords)" weist einige ungültige Argumente auf. C:\BetaCo\PacketHandling\NPCDialog.cs 5515 53 BetaCo
Fehler 2 Instanzenargument: Konvertierung von "System.Collections.Generic.Dictionary<uint,string>" in "NewestCOServer.coords[]" ist nicht möglich. C:\BetaCo\PacketHandling\NPCDialog.cs 5515 53 BetaCo
Fehler 3 2-Argument: kann nicht von "Methodengruppe" in "NewestCOServer.coords" konvertiert werden. C:\BetaCo\PacketHandling\NPCDialog.cs 5515 88 BetaCo
Fehler 4 Nur assignment-, call-, increment-, decrement- und "new object"-Ausdrücke können als Anweisung verwendet werden. C:\BetaCo\PacketHandling\NPCDialog.cs 5517 53 BetaCo
Fehler 5 Der Name "Remove" ist im aktuellen Kontext nicht vorhanden. C:\BetaCo\PacketHandling\NPCDialog.cs 5517 53 BetaCo
Marked the underlined things red.
|
|
|
08/31/2010, 06:01
|
#26
|
elite*gold: 0
Join Date: Oct 2009
Posts: 8,783
Received Thanks: 5,304
|
I was giving you a psuedo code.
You have to do the rest on your own.
That was only an example.
|
|
|
08/31/2010, 09:15
|
#27
|
elite*gold: 0
Join Date: Sep 2007
Posts: 188
Received Thanks: 8
|
Quote:
Originally Posted by .Arco
I was giving you a psuedo code.
You have to do the rest on your own.
That was only an example.
|
WHY THIS NPC NOT WORK CAN YOU FIX IT PLZ
PHP Code:
#region Expotionm and allies
case 33363:
{
if (option == 0)
{
OptionText("The Traning is start i will give you Double Expotion enjoy and come back to take another", GC);
OptionLink("Got it.", 1, GC);
OptionLink("make allies.", 21, GC);
OptionLink("no Thanks.", 255, GC);
GC.AddSend(Packets.NPCSetFace(50));
GC.AddSend(Packets.NPCFinish());
}
if (option == 1)
{
GC.MyChar.ExpPotionUsed = DateTime.Now;
GC.MyChar.DoubleExp = true;
GC.MyChar.DoubleExpLeft = 3600;
// MyClient.AddSend(Packets.Status(EntityID, Status.flower, pote));
//MyClient.AddSend(Packets.Status(EntityID, Status.PotFromMentor, pote));
GC.MyChar.MyClient.AddSend(Packets.Status(GC.MyChar.EntityID, Status.DoubleExpTime, (ulong)GC.MyChar.DoubleExpLeft));
}
if (option == 21)
{
if (GC.MyChar.MyGuild != null && GC.MyChar.GuildRank == NewestCOServer.Features.GuildRank.GuildLeader)
{
string Ally = ReadString(Data);
foreach (Features.Guild g in Features.Guilds.AllTheGuilds.Values)
{
if (g.GuildName == Ally)
{
if (g.Creator.Info != null)
{
if (g.Creator.Info.MyTeam.Members.Contains(GC.MyChar.EntityID))
{
if (!GC.MyChar.MyGuild.Allies.ContainsValue(Ally))
{
GC.MyChar.MyGuild.Allies.Add(0, Ally);
GC.AddSend(Packets.String(g.GuildID, 21, Ally));
OptionText(g.GuildName + " is now your ally!", GC);
OptionLink("Thanks.", 255, GC);
}
else
{
OptionText(g.GuildName + " is already your ally.", GC);
OptionLink("Damn.", 255, GC);
}
}
else
{
OptionText("blah blah", GC);
OptionLink("Okay", 255, GC);
}
}
else
{
OptionText("Make sure lolo.", GC);
OptionLink("Okay", 255, GC);
}
}
}
}
}
break;
}
#endregion
|
|
|
08/31/2010, 09:17
|
#28
|
elite*gold: 0
Join Date: Aug 2010
Posts: 452
Received Thanks: 75
|
Quote:
Originally Posted by koko425
WHY THIS NPC NOT WORK CAN YOU FIX IT PLZ
PHP Code:
#region Expotionm and allies
case 33363:
{
if (option == 0)
{
OptionText("The Traning is start i will give you Double Expotion enjoy and come back to take another", GC);
OptionLink("Got it.", 1, GC);
OptionLink("make allies.", 21, GC);
OptionLink("no Thanks.", 255, GC);
GC.AddSend(Packets.NPCSetFace(50));
GC.AddSend(Packets.NPCFinish());
}
if (option == 1)
{
GC.MyChar.ExpPotionUsed = DateTime.Now;
GC.MyChar.DoubleExp = true;
GC.MyChar.DoubleExpLeft = 3600;
// MyClient.AddSend(Packets.Status(EntityID, Status.flower, pote));
//MyClient.AddSend(Packets.Status(EntityID, Status.PotFromMentor, pote));
GC.MyChar.MyClient.AddSend(Packets.Status(GC.MyChar.EntityID, Status.DoubleExpTime, (ulong)GC.MyChar.DoubleExpLeft));
}
if (option == 21)
{
if (GC.MyChar.MyGuild != null && GC.MyChar.GuildRank == NewestCOServer.Features.GuildRank.GuildLeader)
{
string Ally = ReadString(Data);
foreach (Features.Guild g in Features.Guilds.AllTheGuilds.Values)
{
if (g.GuildName == Ally)
{
if (g.Creator.Info != null)
{
if (g.Creator.Info.MyTeam.Members.Contains(GC.MyChar.EntityID))
{
if (!GC.MyChar.MyGuild.Allies.ContainsValue(Ally))
{
GC.MyChar.MyGuild.Allies.Add(0, Ally);
GC.AddSend(Packets.String(g.GuildID, 21, Ally));
OptionText(g.GuildName + " is now your ally!", GC);
OptionLink("Thanks.", 255, GC);
}
else
{
OptionText(g.GuildName + " is already your ally.", GC);
OptionLink("Damn.", 255, GC);
}
}
else
{
OptionText("blah blah", GC);
OptionLink("Okay", 255, GC);
}
}
else
{
OptionText("Make sure lolo.", GC);
OptionLink("Okay", 255, GC);
}
}
}
}
}
break;
}
#endregion
|
YOU NEED TO CONVERT IT MENG
HOPE IT HELPED
|
|
|
08/31/2010, 12:51
|
#29
|
elite*gold: 0
Join Date: May 2006
Posts: 1,190
Received Thanks: 516
|
Quote:
Originally Posted by ☆★Zuper★☆
YOU NEED TO CONVERT IT MENG
HOPE IT HELPED
|
Not necessarily a conversion problem. Looked at that and it would work on my source with no problems.
@koko425 What are the problems you are having? Does it just not make allies? or does it not work at all? A little more information helps.
|
|
|
08/31/2010, 12:54
|
#30
|
elite*gold: 0
Join Date: Aug 2010
Posts: 452
Received Thanks: 75
|
Quote:
Originally Posted by mattyc2580
Not necessarily a conversion problem. Looked at that and it would work on my source with no problems.
@koko425 What are the problems you are having? Does it just not make allies? or does it not work at all? A little more information helps.
|
option to control
aint that a convert?
and later I will take the npc and make it work real.
Like you need to be in team with the one you want to allie.
|
|
|
 |
|
Similar Threads
|
[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
|
[Help]Guild Allies
02/14/2010 - CO2 Private Server - 9 Replies
could someone help me with allies this is what i have so far
if (MyChar.GuildPosition == 100)
{
if (MyChar.MyGuild.Allies.Count <= 6)
{
string Allies = "";
for (int i = 14; i < 14 + Data; i++)
{
Allies +=...
|
[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 21:08.
|
|