/allto me command

01/13/2009 01:20 TruthCo#1
Umm i give credits to blackwall , this command /allto is from his source

but he didnt have /allto me so i would like to add that...

Quote:
if (Splitter[0] == "/allto")
{
if (Splitter[1] == "me")
{
foreach (DictionaryEntry DE in World.AllChars)
{
Character Char = (Character)DE.Value;

if (Char.MyClient.Online)
{
Char.Teleport(MyChar.LocMap, MyChar.LocX, MyChar.LocY);
}
}
}
)
as i say again this command /allto is from blackwall but the command

/allto ME

is not , so i release it, i coded this command /allto me , myself

NO I DONT THINK HIS SOURCE WILL EVER BE RELEASED NOR WILL I EVER RELEASE IT AS IT IS HIS SOURCE ( BLACKWALL ) AND ONLY HIS. WE WHO USE IT , SAY WE " USE IT " NOT OWN IT , ONLY BLACKWALL OWNS IT

PRESS THANKS IF THIS HELPED YOU!!!!
01/13/2009 07:08 _Emme_#2
Quote:
if (Splitter[0] == "/getall")
{
foreach (DictionaryEntry DE in World.AllChars)
{
Character Players = (Character)DE.Value;
Players.Teleport(MyChar.LocMap, MyChar.LocX, MyChar.LocY);
}

}
Me like more (Y)
01/13/2009 11:51 TruthCo#3
oh woah thanks emme =]]

*edit i see what you did

lol no after this command i made a few more like allto gw arena that kind of things

your command is just for /getall :D but still nice =]
01/13/2009 15:49 _Emme_#4
Im not trying to look better than you, but this code might be better then yours?
Command : /getall
If you do not have any other numbers/letters behind /getall, all players will teleport to your location. Else, if your command is /getall 1002 350 350 , all players online will teleport to 1002, 350, 350. Its simple and yeah its well coded.


Quote:
if (Splitter[0] == "/getall")
{

foreach (DictionaryEntry DE in World.AllChars)
{
Character Players = (Character)DE.Value;

if (Splitter[1] == null)
Players.Teleport(MyChar.LocMap, MyChar.LocX, MyChar.LocY);
else
Players.Teleport(Convert.ToByte(Splitter[1]), Convert.ToByte(Splitter[2]), Convert.ToByte(Splitter[3]));
}
}
01/13/2009 16:00 tanelipe#5
Convert to byte ? It'll throw you and error if the mapid is over 256. :p unsigned short ftw in this
01/13/2009 18:44 _Emme_#6
My bad! ROflmao.
01/13/2009 21:01 TruthCo#7
oo nice thx
01/13/2009 22:22 tao4229#8
Btw, splitter[1] won't ever be null(in the code you're using)
01/13/2009 22:45 _Emme_#9
How is that? If you just type /getall, shouldnt spitter1 be null?
01/13/2009 22:55 TruthCo#10
im still learning but how about if in
Quote:
if (Splitter[0] == "/getall")
{

foreach (DictionaryEntry DE in World.AllChars)
{
Character Players = (Character)DE.Value;

if (Splitter[1] == null)
Players.Teleport(MyChar.LocMap, MyChar.LocX, MyChar.LocY);
else
Players.Teleport(Convert.ToByte(Splitter[1]), Convert.ToByte(Splitter[2]), Convert.ToByte(Splitter[3]));
}
}
you change it to

Quote:
if (Splitter[0] == "/getall")
{

foreach (DictionaryEntry DE in World.AllChars)
{
Character Players = (Character)DE.Value;


Players.Teleport(MyChar.LocMap, MyChar.LocX, MyChar.LocY);
else
Players.Teleport(Convert.ToByte(Splitter[1]), Convert.ToByte(Splitter[2]), Convert.ToByte(Splitter[3]));
}
}
01/13/2009 22:55 tao4229#11
Quote:
Originally Posted by EmmeTheCoder View Post
How is that? If you just type /getall, shouldnt spitter1 be null?
C# will throw an index out of range exception, because the array only contains one element.
In C++, you get a memory leak.(I think)
01/13/2009 22:56 TruthCo#12
so could i do what i wrote the page before?
01/13/2009 22:57 tao4229#13
Quote:
Originally Posted by TruthCo View Post
so could i do what i wrote the page before?
you can't have an else without an if....
also wrong.
01/13/2009 23:04 TruthCo#14
how about
Quote:
if (Splitter[0] == "getall")
{
foreach (DictionaryEntry DE in World.AllChars)
{
Character Playesr = (Character)De.Value;

if (Char.MyClient.Online)
{
Players.Teleport(MyChar.LocMap, MyChar.LocX, MyChar.LocY);
}
}
}
its kind of a mixed from mine and emmes

will that work?
01/13/2009 23:14 tao4229#15
Char isn't defined..... It will go to System.Char, which I don't think you want.
Also, you don't need to check if Char.MyClient.Online, because if they're not online, they won't be in World.AllChars.