|
You last visited: Today at 13:30
Advertisement
NPC Problem!
Discussion on NPC Problem! within the CO2 Private Server forum part of the Conquer Online 2 category.
03/12/2011, 17:27
|
#1
|
elite*gold: 0
Join Date: Nov 2009
Posts: 785
Received Thanks: 421
|
NPC Problem!
Well,I coded my own NPC for Hellmouth Source,that sells garments for 100k CPs.
But if someone try to buy garments,they can buy if there CPs is 0.
After they buy it,they get -100k CPs...
Whats wrong,why its going on - when they buy garments from NPC.
And yeah,they are getting the garment and the CPs decrease to -100k.
Help please!
Thanks!
|
|
|
03/12/2011, 17:34
|
#2
|
elite*gold: 0
Join Date: Mar 2008
Posts: 555
Received Thanks: 99
|
but make sure u have a check to see that they have 100k cps or more
use something like if (Client.CP >= 100000)
|
|
|
03/12/2011, 17:38
|
#3
|
elite*gold: 0
Join Date: Nov 2009
Posts: 785
Received Thanks: 421
|
I already tried to add:
Code:
if(Client.CP >= 100000);
But its not working
|
|
|
03/12/2011, 17:40
|
#4
|
elite*gold: 0
Join Date: Mar 2008
Posts: 555
Received Thanks: 99
|
paste your code here
|
|
|
03/12/2011, 17:44
|
#5
|
elite*gold: 0
Join Date: Nov 2009
Posts: 785
Received Thanks: 421
|
Here you go:
Code:
#region Garments Seller!
case 5577:
if (Client.Permission < 1)
return;
{
switch (LinkBack)
{
case 0:
{
Text("Hello " + Client.Name + " I Sell 10 Special Garments For Only 100.000 CPs!", Client);
Link("I'll Buy Them!", 1, Client);
Link("I Don't Care!", 255, Client);
Finish(Client);
}
return;
case 1:
{
if (Client.Inventory.Count <= 40)
{
Client.CP -= 100000;
Client.AddItem(183325, 0, 1, 10, 0, 0, 0); // DuskRomance
Client.AddItem(183375, 0, 1, 10, 0, 0, 0); // CaribbeanPirate
Client.AddItem(184305, 0, 1, 10, 0, 0, 0); // FatalAllure
Client.AddItem(184315, 0, 1, 10, 0, 0, 0); // ChristmasCostume
Client.AddItem(184325, 0, 1, 10, 0, 0, 0); // Evernight
Client.AddItem(184375, 0, 1, 10, 0, 0, 0); // Spartan'sPride
Client.AddItem(187305, 0, 1, 10, 0, 0, 0); // PekingGeneral
Client.AddItem(191305, 0, 1, 10, 0, 0, 0); // GoodLuck
Client.AddItem(191405, 0, 1, 10, 0, 0, 0); // DivineRobe
Client.AddItem(181855, 0, 1, 10, 0, 0, 0); // DarkWizard
}
else
{
Text("Your Inventory Is Full Please Make More Room's!", Client);
}
}
return;
}
}
return;
#endregion
|
|
|
03/12/2011, 17:46
|
#6
|
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,376
|
Why does NO ONE use the external npc scripts?
Just do
if (Client.Inventory.Count < 40 && Client.CP > 10000)
you cannot have 41 items so you have that wrong also.
|
|
|
03/12/2011, 17:53
|
#7
|
elite*gold: 0
Join Date: Nov 2009
Posts: 785
Received Thanks: 421
|
Quote:
Originally Posted by pro4never
Why does NO ONE use the external npc scripts?
Just do
if (Client.Inventory.Count < 40 && Client.CP > 10000)
you cannot have 41 items so you have that wrong also.
|
Thanks,It worked now.
And I made like 4 NPCs with .npc , but this one I made it with C#.
|
|
|
03/12/2011, 18:24
|
#8
|
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,376
|
No problem.
Also keep in mind you cannot do something like
Text("Your Inventory Is Full Please Make More Room's!", Client);
You need to finish that or else that text will show up with the next npc you click.
|
|
|
03/12/2011, 18:36
|
#9
|
elite*gold: 0
Join Date: Nov 2009
Posts: 785
Received Thanks: 421
|
Quote:
Originally Posted by pro4never
No problem.
Also keep in mind you cannot do something like
Text("Your Inventory Is Full Please Make More Room's!", Client);
You need to finish that or else that text will show up with the next npc you click.
|
Oh i got it,thanks again ^_^
Btw,the /addnpc command is so awesome,also the .npc scripting,cause you don't have to restart the server every time you are changing/adding something,or correct bugged NPCs xD
|
|
|
03/12/2011, 23:55
|
#10
|
elite*gold: 0
Join Date: Dec 2010
Posts: 341
Received Thanks: 255
|
Quote:
Originally Posted by alexalx
I already tried to add:
Code:
if(Client.CP >= 100000);
But its not working
|
I just want to point out why this wasn't working.
You ended your if statement with a ;
So the if statement would not affect what was below it.
|
|
|
03/13/2011, 01:53
|
#11
|
elite*gold: 0
Join Date: Feb 2011
Posts: 185
Received Thanks: 55
|
I love the python npcs..
|
|
|
|
Similar Threads
|
[Hilfe]Ungelöstes Server Erstell Problem, ausführliche Problem Schilderung
09/15/2011 - Flyff Private Server - 8 Replies
Hey Com!
Ich hoffe, dass dieser Thread nicht als Spamthread angesehen wird, da ich ja gestern schon einen zu diesem Thema eröffnet habe.
Sorry wenn ich euch mit dem Thema nerve, aber ich sitze nun schon 4 Tage über dem Problem, und finde einfach keine Lösung.
Nun werde ich hier allerdings eine ausführlichere Beschreibung des Problems geben.
Mein Problem ist, dass ich den Windows Mssql Server 2008/2005 aus Sedrika's TuT nicht installieren kann, da sobald ich ihn immer installiere...
|
[Problem] Problem with server starting - cannot find quest index for PaxHeader
12/22/2009 - Metin2 Private Server - 1 Replies
Hello!
I have this same problem as here when i'm starting my server:
http://www.elitepvpers.com/forum/metin2-pserver-di scussions-questions/307143-metin2-serverfiles-ques t-index-fehler.html
But I didn't know the answer.. how to repair this?
Greetings
|
All times are GMT +2. The time now is 13:30.
|
|