[Help]Can't get command to work

09/24/2008 05:55 FuzionZero#1
Hey guys. I'm trying to get a /revive command to work so you revive at the same spot. I got a command going but it only revives me back to the same spot that clicking Revive would. I tried looking around to see if I can find some hint as to how to do it. I tried looking to see how it's done in Lab because I know in there you revive on the spot. This is what I have, although I'm sure I'm probably going about it the completely wrong way

Code:
                                            if (Splitter[0] == "/revive")
                                            {
                                                MyChar.Revive(true);
                                            }
Also if it's not to much trouble could someone explain to me how I would make it so if I do just "/revive" it revives myself, but if I put in a name at the end it revives them instead? Thanks much.
09/24/2008 06:06 pegaeu#2
if (Splitter[0] == "/revive")
{
ushort ThisMap = MyChar.LocMap;
ushort ThisX = MyChar.LocX;
ushort ThisY = MyChar.LocY;
MyChar.Revive(true);
MyChar.Teleport(ThisMap, ThisX, ThisY);
}
09/24/2008 06:07 FuzionZero#3
Thanks. I knew it was something like that unfortunately I still have a lot to learn so I wasn't sure how to do that.
09/24/2008 07:00 FuzionZero#4
K. Well instead of making a new topic I'll post here. I'm now working on a command for GMs to change other people's name. But when I use it, it changes my name, then after a restart it then changes their name. Can anyone help me out so it changes there name and makes the changes viewable to everyone instantly? This is what I have so far.

Code:
 if (Splitter[0] == "/changeother")
                                            {
                                                foreach (DictionaryEntry DE in World.AllChars)
                                                {
                                                    Character Char = (Character)DE.Value;
                                                    if (Char.Name == Splitter[1])
                                                    {
                                                        string newname = Splitter[2];
                                                        Char.Name = newname;
                                                        SendPacket(General.MyPackets.CharacterInfo(Char));
                                                        Char.SendEquips(false);
                                                        break;
                                                    }
                                                }
                                            }
09/24/2008 07:07 reborn666#5
if (Splitter[0] == "/changename")
{
string newname = Splitter[1];
MyChar.Name = newname;
SendPacket(General.MyPackets.CharacterInfo(MyChar) );
World.SpawnMeToOthers(MyChar, false);
MyChar.SendEquips(false);
}
09/24/2008 07:15 FuzionZero#6
Quote:
Originally Posted by reborn666 View Post
if (Splitter[0] == "/changename")
{
string newname = Splitter[1];
MyChar.Name = newname;
SendPacket(General.MyPackets.CharacterInfo(MyChar) );
World.SpawnMeToOthers(MyChar, false);
MyChar.SendEquips(false);
}
That's the command for people to change there own name. I'm trying to make a command for GMs to change other player's names.
09/24/2008 09:49 Rechocto#7
dont do the mychar.locX, that "true" is for teleporting the char or not MyChar.Revive(false) will revive without teleporting, this will stop items from dissapearing and remove all the lag associated with reviving.
09/24/2008 14:36 _Emme_#8
* Already helped Fuzion with ;
Better revive command,more simple and less nooby
Changename command

#Close
09/24/2008 21:20 YukiXian#9
You may can try add : World.SpawnMeToOthers(Char, false);