Quote:
Originally Posted by marlyandedsel
i tried this code under the
public void UseItem(Item I)
{
try
{
if (I.ID >= 1000000 && I.ID <= 1002050)
{
if (!(DateTime.Now > UnableToUseDrugs.AddSeconds(UnableToUseDrugsFor)))
{
MyClient.LocalMessage(2005, "You've been poisoned. You cannot use drugs for a while.");
return;
}
}
if (Job == 145)
{
if (I.ID >= 900000 && I.ID <= 900109)
{
MyClient.LocalMessage(2005, "You can't use this item");
return false;
}
else
return true;
}
the red one is the code but i got error on the return false and return true
what thing should i add in order to make it right?
thanks in advance
|
... you need to write a different method to handle to bool return.
You should have something like....
public static void EquipItem(ItemInfo Item, Character C)
{
ALL YOUR EQUIP CODE
}
Put the method ABOVE or BELOW that. Not inside obviously.
Then you can call it using something like...
if(!MethodName(Input Values))
{
code
}
means you have used the return false in the method you call.
You should REALLY read up a bit on how to program. There are tons of tutorials on the forum/net. It'll save you so much time