You last visited: Today at 06:46
Advertisement
[Release] Item lock for NewestCOServer
Discussion on [Release] Item lock for NewestCOServer within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.
02/06/2010, 16:08
#1
elite*gold: 0
Join Date: Nov 2009
Posts: 754
Received Thanks: 544
[Release] Item lock for NewestCOServer
Search for;
Quote:
Add above;
Code:
case 2048:
{
PacketHandling.ItemLock.Handle(GC, Data);
break;
}
Search for;
Quote:
Change, and add;
Code:
public int Locked;
public uint LockedDays;
Then the last thing, add the attached file to the packethandling folder.
note; There are gonna be some errors and I'm not gonna correct them for you, besides I will just show how to solve them.
Quote:
if (Item.Locked) will be if (Item.Locked == 1)
if (Item.Locked == false) will be if (Item.Locked == 0)
I WILL NOT HELP YOU SAVING IT.
Big mistake, forgot the packet:
Code:
public static COPacket ItemLock(uint ItemID, byte Value1, byte Value2, uint Value3)
{
byte[] Packet = new byte[8 + 16];
COPacket P = new COPacket(Packet);
P.WriteInt16((ushort)(Packet.Length - 8));
P.WriteInt16((ushort)2048);
P.WriteInt32(ItemID);
P.WriteByte(Value1);
P.WriteByte(Value2);
P.WriteInt32(Value3);
return P;
}
Attached Files
ItemLock.zip
(695 Bytes, 556 views)
02/06/2010, 16:28
#2
elite*gold: 0
Join Date: Jan 2010
Posts: 139
Received Thanks: 45
very useful thanks
02/06/2010, 16:49
#3
elite*gold: 0
Join Date: Dec 2009
Posts: 36
Received Thanks: 1
Weeeeeeeeeeeeeee! Thaanks!
02/06/2010, 16:58
#4
elite*gold: 0
Join Date: Jan 2010
Posts: 43
Received Thanks: 4
good job buddy.
02/06/2010, 16:59
#5
elite*gold: 0
Join Date: Nov 2009
Posts: 754
Received Thanks: 544
IMPORTANT:
Change in ItemLock.cs
Quote:
to:
Quote:
02/06/2010, 17:37
#6
elite*gold: 20
Join Date: Jan 2008
Posts: 2,338
Received Thanks: 490
i hate u
02/06/2010, 17:52
#7
elite*gold: 0
Join Date: Feb 2009
Posts: 259
Received Thanks: 159
to be whitout time
change case 0: and case 1: in
Quote:
case 0:
{
if (Item.Locked == 0 || Item.Locked == 2)
{ Item.Locked = 1; }
Database.SaveCharacter(GC.MyChar, GC.MyChar.Name);
GC.AddSend(Packets.ItemLock(Itemuid, LockType, 1, 0));
GC.AddSend(Packets.UpdateItem(Item, 0));
if (Item.Locked == 2)
{ GC.AddSend(Packets.UpdateItem(Item, 0)); GC.AddSend(Packets.ItemLock(Item.UID, 1, 3, 0)); }
return;
}
case 1:
{
// DateTime datetounlock = DateTime.Now;
// datetounlock = datetounlock.AddDays(5);
//Item.LockedDays = Convert.ToUInt32(datetounlock.ToString("yyyyMMdd", System.Globalization.CultureInfo.InvariantCulture) );
Item.Locked = 0;
GC.AddSend(Packets.UpdateItem(Item, 0));
if (Item.Locked == 2)
{ GC.AddSend(Packets.UpdateItem(Item, 0)); GC.AddSend(Packets.ItemLock(Item.UID, 1, 3, 0)); }
break;
}
and new change
Quote:
in
Quote:
and pakect.cs were you see
Quote:
if (I.Locked)
P.WriteInt16(3);
else P.WriteInt16(0);
replace in
Quote:
if (I.Locked == 1)
P.WriteInt16(1);
else P.WriteInt16(0);
02/06/2010, 18:01
#8
elite*gold: 0
Join Date: Oct 2009
Posts: 768
Received Thanks: 550
Then what's the use of having item lock? It was added to prevent hacking.
02/06/2010, 18:45
#9
elite*gold: 0
Join Date: Nov 2009
Posts: 754
Received Thanks: 544
Quote:
Originally Posted by
~Yuki~
i hate u
Just because I helped the community out with something simple that anyone can perfom? Nice concept of thinking.
02/06/2010, 19:03
#10
elite*gold: 0
Join Date: Jan 2010
Posts: 74
Received Thanks: 18
good job yashi!
02/06/2010, 20:03
#11
elite*gold: 0
Join Date: Apr 2006
Posts: 532
Received Thanks: 66
NewestCoServer.Packets does not contain a definition for itemlock ItemLock.cs >.< Can somebody give me an example of a definition please
02/06/2010, 20:07
#12
elite*gold: 0
Join Date: Nov 2009
Posts: 754
Received Thanks: 544
Quote:
Originally Posted by
WHITELIONX
NewestCoServer.Packets does not contain a definition for itemlock ItemLock.cs >.<
Exactly, an example of people on elitepvpers what's the big problem that's causing people not being able to read the whole thread? I posted the **** packet.
02/06/2010, 20:09
#13
elite*gold: 0
Join Date: Apr 2006
Posts: 532
Received Thanks: 66
Probably because some of us do not have the advantage of knowing the language properly
Hehehehe I got it working
02/06/2010, 20:37
#14
elite*gold: 20
Join Date: Jan 2006
Posts: 890
Received Thanks: 240
Quote:
Originally Posted by
ImmuneOne
Just because I helped the community out with something simple that anyone can perfom? Nice concept of thinking.
congratulations you can leech. anyways, so this doesn't seem like im trying to flame you or anything nice release i suppose.
02/06/2010, 20:50
#15
elite*gold: 0
Join Date: Nov 2009
Posts: 754
Received Thanks: 544
Quote:
Originally Posted by
lostsolder05
congratulations you can leech. anyways, so this doesn't seem like im trying to flame you or anything nice release i suppose.
Congratulations, you just took your moronic brain level even higher. I never took credit for anything, I only took credits for converting from something impulse made, so basicly you got no saying in this at all. Oh, and this was on request but okay figures idiots can't read the forums well.
Similar Threads
[Release]Make the threading system better.[5165 NewestCOServer]
09/13/2010 - CO2 PServer Guides & Releases - 10 Replies
Okay so,
I was bored so I thought I would release some easy shiz. Credits to Impulse for his Thread.cs :)
Goto Program.cs find
Console.WriteLine("The server is ready for connections.");
abit under that is the threading system. It's like
5165 Item lock, and item redeem.
02/09/2010 - CO2 Private Server - 4 Replies
Anyone knows how to make the item lock and redeem items npc in 5165?
Im not too good at that stuff, and it'll be great if someone could help me. :handsdown:
All times are GMT +1. The time now is 06:46 .