Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server
You last visited: Today at 23:03

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

Advertisement



Question about a code (5165)

Discussion on Question about a code (5165) within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Feb 2009
Posts: 700
Received Thanks: 79
Cool Question about a code (5165)

SERVER 5165 LOTF
Well, what this npc is suppose to do in order is: Check if you have 50k cps or more, check if you are level 130 or more, check if you are level 137 or less (so check if your between level 130-137 and also checks if you have 50k or more cps). If true, the npc takes away 50k cps from your inventory, and adds a level and broadcasts that you bought a lvl. Otherwise, it gives an error message.

But I'm getting 2 errors on the line where "else" is which are "Invalid Expression term 'else'" and "';' expected. How do I fix this ? I don't get it. Here's the code.

Code:
                            #region Leveler 137
                            case 88955:
                                {
                                    if (Control == 0)
                                    {
                                        GC.AddSend(Packets.NPCSay("Hello, I'm the hoe that you want to talk to if you want to buy levels from 130-137. Want to buy a lvl for 50,000 cps each?"));
                                        GC.AddSend(Packets.NPCLink("Buy a level.", 1));
                                        GC.AddSend(Packets.NPCLink("Just passing by.", 255));
                                        GC.AddSend(Packets.NPCSetFace(30));
                                        GC.AddSend(Packets.NPCFinish());
                                    }
                                    if (Control == 1)
                                    {
                                        if (GC.MyChar.CPs >= 50000) & (GC.MyChar.Level >= 130) & (GC.MyChar.Level <= 137);
                                        {
                                            GC.MyChar.CPs -= 50000;
                                            GC.MyChar.Level += 1;
                                            Broadcast("Congratulations," + GC.MyChar.Name + "has just bought a level! He/she is now level" + GC.MyChar.Level+"!");
                                            GC.AddSend(Packets.NPCSay("You have leveled up! You are now level" + GC.MyChar.Level+". Thank you for buying a level, come back soon!"));
                                            GC.AddSend(Packets.NPCLink("Thanks.", 255));
                                            GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                        else
                                        {
                                            GC.AddSend(Packets.NPCSay("Sorry, you must be level 130-136 and have 50,000 cps to buy a level."));
                                            GC.AddSend(Packets.NPCLink("Damn.", 255));
                                            GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                        break;
                                    }
                                }
                            #endregion



copz1337 is offline  
Old 08/23/2010, 10:35   #2
 
elite*gold: 0
Join Date: Aug 2010
Posts: 20
Received Thanks: 5
dont use & () & () & ().
use && && &&.
im talking about this:
if (GC.MyChar.CPs >= 50000) & (GC.MyChar.Level >= 130) & (GC.MyChar.Level <= 137);
and dont use ; for checks.
make it:
if (GC.MyChar.CPs >= 50000 && GC.MyChar.Level >= 130 && GC.MyChar.Level <= 137)

and this one:
break;
never put break 2 brackets over end.
It have to be inside the case.
like

case 1:
{
break;
}

controls:
case 1:
{
if (control == 1)
{

}
break;
}

Should work


BLASTER!!!! is offline  
Old 08/23/2010, 13:16   #3
 
elite*gold: 0
Join Date: May 2006
Posts: 1,190
Received Thanks: 515
Code:
#region Leveler 137
                            case 88955:
                                    {
                                        if (Control == 0)
                                        {
                                            GC.AddSend(Packets.NPCSay("Hello, I'm the hoe that you want to talk to if you want to buy levels from 130-137. Want to buy a lvl for 50,000 cps each?"));
                                            GC.AddSend(Packets.NPCLink("Buy a level.", 1));
                                            GC.AddSend(Packets.NPCLink("Just passing by.", 255));
                                            GC.AddSend(Packets.NPCSetFace(30));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                        if (Control == 1)
                                        {
                                            if (GC.MyChar.CPs >= 50000 && GC.MyChar.Level >= 130 && GC.MyChar.Level <= 137)
                                            {
                                                GC.MyChar.CPs -= 50000;
                                                GC.MyChar.Level += 1;
                                                Broadcast("Congratulations," + GC.MyChar.Name + "has just bought a level! He/she is now level" + GC.MyChar.Level + "!");
                                                GC.AddSend(Packets.NPCSay("You have leveled up! You are now level" + GC.MyChar.Level + ". Thank you for buying a level, come back soon!"));
                                                GC.AddSend(Packets.NPCLink("Thanks.", 255));
                                                GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                                GC.AddSend(Packets.NPCFinish());
                                            }
                                            else
                                            {
                                                GC.AddSend(Packets.NPCSay("Sorry, you must be level 130-136 and have 50,000 cps to buy a level."));
                                                GC.AddSend(Packets.NPCLink("Damn.", 255));
                                                GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                                GC.AddSend(Packets.NPCFinish());
                                            }
                                        }
                                        break;
                                    }
                            #endregion
Done
.Beatz is offline  
Thanks
1 User
Old 08/23/2010, 18:06   #4
 
elite*gold: 0
Join Date: Feb 2009
Posts: 700
Received Thanks: 79
Thanks now it works. #Request close
copz1337 is offline  
Reply



« How to add new skills?? | [Developement] MainStream Conquer 5017 »

Similar Threads
[Release]ReviveHere Code For 5165
09/21/2010 - CO2 PServer Guides & Releases - 12 Replies
This is my first post on ElitePvpers i don't know if any one released it before I made it my self i'm a c# noob btw so Go easy on me guys first open PacketHandling\Revive then replace everything with this using System; using System.Collections.Generic; using System.Linq; using System.Text;
Need Auto Save Code for 5165
09/11/2010 - CO2 Private Server - 29 Replies
hi, my source don't save the caracters actions some times ex: i was lvl 120 and i had 2000cps i was in TC , i level up to 200 and i get 5kkcps and i go to BI i relog and i find my character lvl 120 with 2000cps in TC a friend told me you have to make auto save code to save each 2min or 2sec whatever but i don't know what's this code and where i put it
[Help]Trying to code something on Source 5165
04/04/2010 - CO2 Private Server - 4 Replies
I tryed to code that if you have this skill don't learn it again. So i tryed if (Skills.Contains(1000)) *1000 is Thunder skill id* But it is not working, can anyone help me? I think im missing the ID of skill.
plz need Code Compose to +12 [5165]
02/12/2010 - CO2 Private Server - 5 Replies
Hello all plz i need Code Compose to +12 and Disappear the ston or file compose



All times are GMT +1. The time now is 23:03.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

BTC: 33E6kMtxYa7dApCFzrS3Jb7U3NrVvo8nsK
ETH: 0xc6ec801B7563A4376751F33b0573308aDa611E05

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