View Single Post
Old 03-18-2006, 02:32 PM   #11 (permalink)
Sunshine
Forum Expert
 
Sunshine's Avatar
 
Join Date: Mar 2005
Location: Hopefully not near you
Posts: 2,233
Default

Code:
RunUO - [www.runuo.com] Version 1.0.0, Build 36918
Scripts: Compiling C# scripts...failed (4 errors, 31 warnings)
 - Error: Scripts\Custom\PinataTicket.cs: CS0103: (line 73, column 35) The name
'PackItem' does not exist in the class or namespace 'Server.Items.PinataTicket'
 - Error: Scripts\Custom\PinataTicket.cs: CS0103: (line 74, column 35) The name
'PackItem' does not exist in the class or namespace 'Server.Items.PinataTicket'
 - Error: Scripts\Custom\PinataTicket.cs: CS0103: (line 75, column 34) The name
'PackItem' does not exist in the class or namespace 'Server.Items.PinataTicket'
 - Error: Scripts\Custom\PinataTicket.cs: CS1501: (line 79, column 17) No overlo
ad for method 'Target' takes '0' arguments
 Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.
that is the errors ..I been working on this sence I seen your reply even before I posted back....but am now at my wits in ...feeling hopeless please can you help me, anyone?


Code:
using System;
using Server.Network;
using Server.Prompts;
using Server.Items;
using Server.Targeting;
using Server.Gumps;
namespace Server.Items
{
 public class PinataTicket : Item
 {
  private Mobile m_Owner;
  [CommandProperty( AccessLevel.GameMaster )]
  public Mobile Owner
  {
   get{ return m_Owner; }
   set{ m_Owner = value; }
  }
  [Constructable]
  public PinataTicket() : base( 0x14EF )
  {
   Weight = 1.0;
   LootType = LootType.Blessed;
  }

  public override bool DisplayLootType{ get{ return false; } }
  public PinataTicket( Serial serial ) : base( serial )
  {
  }
  public override void Serialize( GenericWriter writer )
  {
   base.Serialize( writer );
   writer.Write( (int) 0 ); // version
   writer.Write( (Mobile) m_Owner );
  }
  public override void Deserialize( GenericReader reader )
  {
   base.Deserialize( reader );
   int version = reader.ReadInt();
   switch ( version )
   {
    case 0:
    {
     m_Owner = reader.ReadMobile();
     break;
    }
   }
   if ( Name == "Pinata Ticket" )
    Name = null;
  }
  public override void OnDoubleClick( Mobile from )
  {
  
    if ( !IsChildOf( from.Backpack ) )
   {
    from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
   }
   
                      switch ( Utility.Random( 3 ) )
                      {
                          case 0: PackItem(new Pinatagold() ); break;
                          case 1: PackItem(new Pinata() ); break;
                         case 2: PackItem(new Pinatatoken() ); break;
                     } }
  private class InternalTarget : Target
  {
   private PinataTicket m_Ticket;
    }
   }
  }
I just want to make a simple ticket when double clicked the player is given 1 of 3 items equal chance of all of them appearing in the back pack. then ticket dissappears


sounds soo easy but is soo hard
__________________
All people have the right to be stupid but some abuse the privilege.
Sunshine is offline   Reply With Quote