1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Silly Error

Discussion in 'Script Support' started by Omni, Feb 21, 2014.

  1. Omni
    Offline

    Omni Member

    Joined:
    Dec 22, 2013
    Messages:
    165
    Likes Received:
    24
    Publish Number:
    54
    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 (C#):
    1. using System;
    2. using Server;
    3. using Server.Gumps;
    4. using Server.Network;
    5. using Server.Commands;
    6. using Server.Mobiles;
    7.  
    8. namespace Server.Items
    9. {
    10.     public class PVMGate : Item
    11.     {
    12.         [Constructable]
    13.         public PVMGate()
    14.             : base(0xF6C)
    15.         {
    16.             Movable = false;
    17.             Light = LightType.Circle300;
    18.             Hue = 962;
    19.             Name = "PVMer's Gate";
    20.         }
    21.  
    22.         public PVMGate(Serial serial)
    23.             : base(serial)
    24.         {
    25.         }
    26.  
    27.         public override void Serialize(GenericWriter writer)
    28.         {
    29.             base.Serialize(writer);
    30.  
    31.             writer.Write((int)0);
    32.         }
    33.  
    34.         public override bool OnMoveOver(Mobile m )
    35.         {
    36.             Mobile from = Mobile;
    37.             PlayerMobile SafePVP = from as PlayerMobile;
    38.             SafePVP.PVM = PVM.PVM;
    39.             SafePVP.Title = "[PVM]";
    40.             SafePVP.SendMessage(62, "You have choosen be [PVM]");
    41.             m.Hue = 2406;
    42.             m.Location = new Point3D(1455, 1568, 30);
    43.             World.Broadcast(0x35, true, "Another noobie who's scared of fighting");
    44.             return false; //Changed this to false
    45.         }
    46.  
    47.         public override void Deserialize(GenericReader reader)
    48.         {
    49.             base.Deserialize(reader);
    50.  
    51.             int version = reader.ReadInt();
    52.         }
    53.     }
    54. }
    55.  
    The Error
    Code (C#):
    1. Errors:
    2. + Custom Systems/Safe System/PVMgate.cs:
    3.     CS0118: Line 36: 'Server.Mobile' is a 'type' but is used like a 'variable'
    4. Scripts: One or more scripts failed to compile or no script files were found.
    5. - Press return to exit, or R to try again.
    6.  
    Can someone please put me out of my missery and show me why i am soo foolish lol
     
  2. Ce Jayce
    Offline

    Ce Jayce Member

    Joined:
    Jan 24, 2014
    Messages:
    140
    Likes Received:
    14
    Code (C#):
    1. 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 (C#):
    1. 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 )
     
    • Two Thumbs Up Two Thumbs Up x 1
  3. Omni
    Offline

    Omni Member

    Joined:
    Dec 22, 2013
    Messages:
    165
    Likes Received:
    24
    :) Thanks for proving that i am a fool
     
    • Love You Love You x 1
  4. Ce Jayce
    Offline

    Ce Jayce Member

    Joined:
    Jan 24, 2014
    Messages:
    140
    Likes Received:
    14
    lol, wasn't my intention!
    I've done things like that 100 times over (and been stuck on as to why for an age) and will continue to do them forever most likely :p
     
Similar Threads: Silly Error
Forum Title Date
Script Support Probably my 2016 last silly question (Regarding VvV) Dec 10, 2016
New Join Forum Seems silly! Jul 13, 2014
Archived Bug Reports World loading error Oct 11, 2017
Script Support Server throws this error Oct 5, 2017
Script Support Strange error on Vendors Oct 2, 2017
Archived Bug Reports World loading error with latest update Sep 29, 2017
Script Support Anyone can help with this error :) Sep 25, 2017