Register for your free account! | Forgot your password?

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

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

Advertisement



Writing my first line of code in c# need some help

Discussion on Writing my first line of code in c# need some help within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Feb 2008
Posts: 217
Received Thanks: 26
Writing my first line of code in c# need some help

Hey guys, I am busy trying to write a little command that gives a player a starter pack, but it's a little confusing. I wanna make it to where if the players IP has already received a starter pack he will be unable to do it again.

sigh, I wish this was php, would be so much easier >.< . Here is what I have so far.

Code:
                                        if (Splitter[0] == "/starter")
                                        {
                                            MyChar.CPs += 54;
                                            MyChar.Silvers += 10000;
                                        }
Which from as far as I know, is as basic as basic gets.

EDIT:Sigh, I must be doing this wrong, even this small command is not working correctly. Any advice/help?
demonscim is offline  
Old 10/16/2008, 06:53   #2
 
elite*gold: 20
Join Date: Apr 2008
Posts: 2,281
Received Thanks: 913
Code:
                                        if (Splitter[0] == "/starter")
                                        {
                                            MyChar.CPs += 54;
                                            MyChar.Silvers += 10000;
                                        }
Alright, so this is what you have right now right?

Well, since there is a Server and a Client, you have to deal with both.
With that code you are adding silvers and cps to the Server, but you must make it reflect back on the Client.

So you use packets to send information between the Server and Client.
In this case, we will need to send the Vital packet, with the correct ID.

For CPs, the ID is 30.
So we send the packet:
Code:
SendPacket(General.MyPackets.Vital((long)MyChar.UID, 30, MyChar.CPs));
Now the CPs reflect on the Client.
And for Silvers, we do the same, just change the ID for silvers, which is 4.
Code:
SendPacket(General.MyPackets.Vital((long)MyChar.UID, 4, MyChar.Silvers));
So, now we have a working "Starter" command to add CPs and Silvers:
Code:
if (Splitter[0] == "/starter")
{
    MyChar.CPs += 54;
    SendPacket(General.MyPackets.Vital((long)MyChar.UID, 30, MyChar.CPs));
    MyChar.Silvers += 10000;
    SendPacket(General.MyPackets.Vital((long)MyChar.UID, 4, MyChar.Silvers));
}
kinshi88 is offline  
Old 10/16/2008, 08:15   #3
 
elite*gold: 0
Join Date: Jan 2008
Posts: 145
Received Thanks: 91
kinshi was right.
If you want that your command is only for 1 use then you need to use the mysql.
Or just edit the CreateCharacter in DataBase.cs that it will give cps or money or items for the first create character.

hope you get me
pauldexter is offline  
Old 10/16/2008, 13:15   #4
 
elite*gold: 0
Join Date: Feb 2008
Posts: 217
Received Thanks: 26
Thank you both, I understand well.
demonscim is offline  
Old 10/16/2008, 16:51   #5
 
taguro's Avatar
 
elite*gold: 0
Join Date: Jun 2007
Posts: 387
Received Thanks: 64
Wow, nice to see E*Pvpers being used to help people and not to sell things... nice one Kinshi.
taguro is offline  
Old 10/16/2008, 18:41   #6
 
felipeboladao's Avatar
 
elite*gold: 0
Join Date: Jul 2007
Posts: 255
Received Thanks: 273
lol go to Database insert money and cps to creat chars
felipeboladao is offline  
Reply


Similar Threads Similar Threads
[Guide]CoEmuV2 Line 30 and line 34 error FIX *Changed Name*
02/26/2021 - CO2 PServer Guides & Releases - 57 Replies
CoEmu V2 Common 2 Error fixes After you have followed one of these 3 guides *ORIGINAL AMAZING RELEASE* CoEmuv2.Nano(5095) Source Code GOOD VIDEO GUIDE Video+All Files+Source oF CoEmu v2 Setup Explained Guide (Pics) CoEmu v2 Source Setup NONE OF THE ABOVE GUIDES ARE CREATED BY ME
writing a own bot question
07/03/2010 - Perfect World - 3 Replies
hi people i have some questions xD. 1 I plan to write with AutoIT a simple perfect world international bot. i have Basic knowledge with AutoIT and it would be a realy simple bot nothing complicated or other difficult things, know my question have i need to know something importent if i write my bot ? 2 This bot would be only for me and im a bit afraid to use this bot because i think the gms are very very active and detect me if i use my bot so how big is the chance that they detect my...
plz help me iin writing ver code
10/04/2009 - Silkroad Online - 3 Replies
hi plz help me i can't write the verification code
Need help with line code for looting Rare Items with auto hotkey
08/04/2009 - 12Sky2 - 10 Replies
Hi currently i have a fully working aoeing , 2-4 buff using , loooting , potting macro , it only loots all loots atm including junk unis , ive tried mesing with it to just pick up rares but ive made no progreas , was wondering if anyone can help me with the line of code i owuld need for it to select Rares within the ts2 window with the mouse click rather than just spamming loot key , any hints or ideas would be appreciated thanks
who is writing these scripts?
03/27/2009 - Dekaron - 1 Replies
who is writing the scripts for ce? also i looks like c++ am i correct or is it somthing else?



All times are GMT +1. The time now is 14:39.


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.