[Help] How can i change this code... dbs to cps instead of money to cps

06/10/2009 16:49 editor05#1
case 2071://CPAdmin Guy
{
if (LinkBack == 0)
{
Text("Would like to exchange for Cps with ur money? It will only cost u 50k for 5k Cps.", CSocket);
Link("Well yea I want it.", 1, CSocket);
Link("Nah No thanks!!", 255, CSocket);
End(CSocket);
}
else if (LinkBack == 1)
{
if (CSocket.Client.Money >= 50000)
{
Money(-50000, CSocket);
CPs(+5, CSocket);
}
else
{
Text("How dare you try to rip me off! Get lost, Or get my money!", CSocket);
Link("I'm sorry, I didn't realize.", 255, CSocket);
End(CSocket);
}
}
break;
}
06/10/2009 18:40 killerbee#2
try this


case 2071: // CP ADMIN
{
if (LinkBack == 0)
{
Text("HELLO! Do you need cps? Trade me a Dragonball for 215 cps.", CSocket);
Link("DragonBall", 1, CSocket);
Link("Just passing by", 255, CSocket);
Face(6, CSocket);
End(CSocket);
}

else if (LinkBack == 1)
{
int uid = 0;
bool cont = false;
foreach (Struct.ItemInfo Item in CSocket.Client.Inventory.Values)
{
if (Item.ItemID == 1088000)
{
uid = Item.UID;
cont = true;
break;
}
}

if (cont)
{
if (CSocket.Client.CPs + 215 > 999999999)
CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "You can not hold more then 999,999,999 CPs", Struct.ChatType.Top));

else
{
CSocket.Client.Inventory.Remove(uid);
CSocket.Send(ConquerPacket.ItemUsage(uid, 255, Struct.ItemUsage.RemoveItem));
Database.Database.DeleteItem(uid);
while (!CSocket.Send(ConquerPacket.ItemUsage(uid, 255, Struct.ItemUsage.RemoveItem)))
{
CSocket.Client.Inventory.Remove(uid);
CSocket.Send(ConquerPacket.ItemUsage(uid, 255, Struct.ItemUsage.RemoveItem));
Database.Database.DeleteItem(uid);
}
CSocket.Client.CPs += 215;
CSocket.Send(ConquerPacket.Status(CSocket, 2, CSocket.Client.CPs, Struct.StatusTypes.InvCPoints));
}
}
else
{
Text("You don't have a DragonBall.", CSocket);
Link("I see.", 255, CSocket);
Face(6, CSocket);
End(CSocket);
}
}
break
}



ok. give thanks to BlooD-BoY. I copy and delete some.
06/13/2009 11:33 editor05#3
got this error

Error 1 The type or namespace name 'Face' does not exist in the namespace 'CoEmu_v2_GameServer' (are you missing an assembly reference?) E:\CoEmu v2\CoEmu v2\CoEmu v2 GameServer\Handlers\NpcTalk.cs 17 27 CoEmu v2 GameServer

and this...

Error 2 The name 'Face' does not exist in the current context E:\CoEmu v2\CoEmu v2\CoEmu v2 GameServer\Handlers\NpcTalk.cs 1260 1 CoEmu v2 GameServer
06/13/2009 11:39 arab4life#4
Quote:
Originally Posted by editor05 View Post
got this error

Error 1 The type or namespace name 'Face' does not exist in the namespace 'CoEmu_v2_GameServer' (are you missing an assembly reference?) E:\CoEmu v2\CoEmu v2\CoEmu v2 GameServer\Handlers\NpcTalk.cs 17 27 CoEmu v2 GameServer

and this...

Error 2 The name 'Face' does not exist in the current context E:\CoEmu v2\CoEmu v2\CoEmu v2 GameServer\Handlers\NpcTalk.cs 1260 1 CoEmu v2 GameServer
right click on it and add
06/13/2009 12:41 editor05#5
wish i could... honestly.. can you help me out... it can be my reference for other coding.. just tryin to learn one at a time :D
06/13/2009 17:29 danielachraf#6
search two times for
Quote:
Face(6, CSocket);
and delete the lines