Register for your free account! | Forgot your password?

You last visited: Today at 21:05

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

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.

Reply
 
Old 08/28/2010, 17:35   #16
 
killersub's Avatar
 
elite*gold: 0
Join Date: May 2009
Posts: 884
Received Thanks: 211
Quote:
Originally Posted by copz1337 View Post
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:

Code:
class Guilds
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 .
killersub is offline  
Old 08/28/2010, 19:44   #17
 
_DreadNought_'s Avatar
 
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.
_DreadNought_ is offline  
Old 08/28/2010, 22:13   #18
 
Arcо's Avatar
 
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.
Arcо is offline  
Thanks
1 User
Old 08/28/2010, 22:40   #19
 
killersub's Avatar
 
elite*gold: 0
Join Date: May 2009
Posts: 884
Received Thanks: 211
Quote:
Originally Posted by .Arco View Post
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
Code:
class Guild
rather than
Code:
class Guilds
becuz once u put it under that it wont find the reference as directed...
killersub is offline  
Old 08/29/2010, 07:35   #20
 
elite*gold: 0
Join Date: Sep 2007
Posts: 188
Received Thanks: 8
Quote:
Originally Posted by .Arco View Post
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...
koko425 is offline  
Old 08/29/2010, 07:42   #21
 
Arcо's Avatar
 
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, "");
Arcо is offline  
Thanks
1 User
Old 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?
2087 is offline  
Old 08/30/2010, 18:22   #23
 
.Beatz's Avatar
 
elite*gold: 0
Join Date: May 2006
Posts: 1,190
Received Thanks: 516
Quote:
Originally Posted by 2087 View Post
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.
.Beatz is offline  
Old 08/30/2010, 21:55   #24
 
Arcо's Avatar
 
elite*gold: 0
Join Date: Oct 2009
Posts: 8,783
Received Thanks: 5,304
Quote:
Originally Posted by 2087 View Post
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;
}
Arcо is offline  
Thanks
1 User
Old 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.


Marked the underlined things red.
2087 is offline  
Old 08/31/2010, 06:01   #26
 
Arcо's Avatar
 
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.
Arcо is offline  
Thanks
1 User
Old 08/31/2010, 09:15   #27
 
elite*gold: 0
Join Date: Sep 2007
Posts: 188
Received Thanks: 8
Quote:
Originally Posted by .Arco View Post
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."1GC);
                                        
OptionLink("make allies."21GC);
                                        
OptionLink("no Thanks."255GC);
                                        
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.EntityIDStatus.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(0Ally);
                                                                
GC.AddSend(Packets.String(g.GuildID21Ally));
                                                                
OptionText(g.GuildName " is now your ally!"GC);
                                                                
OptionLink("Thanks."255GC);
                                                            }
                                                            else
                                                            {
                                                                
OptionText(g.GuildName " is already your ally."GC);
                                                                
OptionLink("Damn."255GC);
                                                            }
                                                        }
                                                        else
                                                        {
                                                            
OptionText("blah blah"GC);
                                                            
OptionLink("Okay"255GC);
                                                        }
                                                       }
                                                        else
                                                        {
                                                            
OptionText("Make sure lolo."GC);
                                                            
OptionLink("Okay"255GC);
                                                        }

                                                    
                                                }
                                            }
                                            }
                                    }
 
                                    break;
                                }
                            
#endregion 
koko425 is offline  
Old 08/31/2010, 09:17   #28
 
elite*gold: 0
Join Date: Aug 2010
Posts: 452
Received Thanks: 75
Quote:
Originally Posted by koko425 View Post
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."1GC);
                                        
OptionLink("make allies."21GC);
                                        
OptionLink("no Thanks."255GC);
                                        
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.EntityIDStatus.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(0Ally);
                                                                
GC.AddSend(Packets.String(g.GuildID21Ally));
                                                                
OptionText(g.GuildName " is now your ally!"GC);
                                                                
OptionLink("Thanks."255GC);
                                                            }
                                                            else
                                                            {
                                                                
OptionText(g.GuildName " is already your ally."GC);
                                                                
OptionLink("Damn."255GC);
                                                            }
                                                        }
                                                        else
                                                        {
                                                            
OptionText("blah blah"GC);
                                                            
OptionLink("Okay"255GC);
                                                        }
                                                       }
                                                        else
                                                        {
                                                            
OptionText("Make sure lolo."GC);
                                                            
OptionLink("Okay"255GC);
                                                        }

                                                    
                                                }
                                            }
                                            }
                                    }
 
                                    break;
                                }
                            
#endregion 
YOU NEED TO CONVERT IT MENG

HOPE IT HELPED
dowhatuwant is offline  
Old 08/31/2010, 12:51   #29
 
.Beatz's Avatar
 
elite*gold: 0
Join Date: May 2006
Posts: 1,190
Received Thanks: 516
Quote:
Originally Posted by ☆★Zuper★☆ View Post
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.
.Beatz is offline  
Old 08/31/2010, 12:54   #30
 
elite*gold: 0
Join Date: Aug 2010
Posts: 452
Received Thanks: 75
Quote:
Originally Posted by mattyc2580 View Post
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.
dowhatuwant is offline  
Reply


Similar Threads 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.


Powered by vBulletin®
Copyright ©2000 - 2025, 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 ©2025 elitepvpers All Rights Reserved.