Omni

Member
Ive got this silly little error i just can't pin point. I know whats wrong just too sick and sleep deprived to actually fix it.

The Script

Code:
using System;
using Server;
using Server.Gumps;
using Server.Network;
using Server.Commands;
using Server.Mobiles;
 
namespace Server.Items
{
    public class PVMGate : Item
    {
        [Constructable]
        public PVMGate()
            : base(0xF6C)
        {
            Movable = false;
            Light = LightType.Circle300;
            Hue = 962;
            Name = "PVMer's Gate";
        }
 
        public PVMGate(Serial serial)
            : base(serial)
        {
        }
 
        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);
 
            writer.Write((int)0);
        }
 
        public override bool OnMoveOver(Mobile m )
        {
            Mobile from = Mobile;
            PlayerMobile SafePVP = from as PlayerMobile;
            SafePVP.PVM = PVM.PVM;
            SafePVP.Title = "[PVM]";
            SafePVP.SendMessage(62, "You have choosen be [PVM]");
            m.Hue = 2406;
            m.Location = new Point3D(1455, 1568, 30);
            World.Broadcast(0x35, true, "Another noobie who's scared of fighting");
            return false; //Changed this to false
        }
 
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
 
            int version = reader.ReadInt();
        }
    }
}
The Error
Code:
Errors:
+ Custom Systems/Safe System/PVMgate.cs:
    CS0118: Line 36: 'Server.Mobile' is a 'type' but is used like a 'variable'
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.

Can someone please put me out of my missery and show me why i am soo foolish lol
 
Code:
Mobile from = Mobile;
Assuming that you're wanting to set the variable 'from' to equal the mobile that's walked over the gate then you want this line instead;
Code:
Mobile from = m;
Otherwise you're kind of saying from is a type of the Mobile class which is equal to the Mobile class. (Probably not the most technical way to explain it :p )
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back