/allto me command

01/13/2009 23:21 TruthCo#16
well anyway the first command i posted works fine =] also has /allto tc and much more
01/14/2009 15:51 tanelipe#17
Code:
if(Splitter[0] == "@getall") {
  ushort MapID = MyChar.LocMap;
  ushort X = MyChar.LocX;
  ushort Y = MyChar.LocY;
  if(Splitter.Length  == 3) {
    ushort.Parse(Splitter[1], out MapID);
    ushort.Parse(Splitter[2], out X);
    ushort.Parse(Splitter[3], out Y);
       
    if(MapID == 0 || X == 0 || Y == 0) return; // Stop executing
  }
  foreach(DictionaryEntry DE in World.AllChars)
  {
    Character Target = (Character)DE.Value;
    if(Target == null) return; // Just incase it is null for some reason.
    Target.Teleport(MapID, X, Y);     
  }
}
This might not look so nice but atleast it has all the proper checks, shouldn't throw any errors unless I made a typo.
01/20/2009 22:38 .Dan.#18
Yes I'm a noob k?

If I put Character Players = (Character)DE.Value;

The 'DE' part gets a red line under it. Which means it isn't in the current context. How do I put the DE, in the currect context?

Thanks,

NubCake~