SendSpawn() public method

public SendSpawn ( byte id, string name, ushort x, ushort y, ushort z, byte rotx, byte roty ) : void
id byte
name string
x ushort
y ushort
z ushort
rotx byte
roty byte
return void
Exemplo n.º 1
0
        // Code to run when used by a player
        public override void Use(Player p, string message)
        {
            if (message == "")
            {
                if (dList.ContainsKey(p.name))
                {
                    p.SendMessage("Stopped following: " + dList[p.name]);
                    Player oldPlayer = Player.Find(dList[p.name]);
                    if (oldPlayer != null)
                    {
                        p.SendSpawn(oldPlayer.id, oldPlayer.name, oldPlayer.pos[0], oldPlayer.pos[1], oldPlayer.pos[2], oldPlayer.rot[0], oldPlayer.rot[1]);
                    }
                    dList.Remove(p.name);
                    return;
                }
                else
                {
                    Help(p);
                    return;
                }
            }

            Player who = Player.Find(message);

            if (who == null)
            {
                p.SendMessage("No such player!");
                return;
            }
            else
            {
                if (who.hidden)
                {
                    p.SendMessage("No such player!");
                    return;
                }
                else if (who.name == p.name)
                {
                    p.SendMessage("You have a better chance at chasing your tail than following yourself!");
                    return;
                }
            }

            if (!dList.ContainsKey(p.name))
            {
                if (!p.hidden)
                {
                    Command.all.Find("hide").Use(p, "");
                }
                p.SendDie(who.id);
                dList.Add(p.name, who.name);
                p.SendMessage("Now following: " + who.color + who.name);
                p.SendMessage("--Make sure you have flight turned ON!--");
                p.SendMessage("--Otherwise expect jittery movement!--");
            }
            else
            {
                Player oldPlayer = Player.Find(dList[p.name]);
                if (oldPlayer != null)
                {
                    p.SendSpawn(oldPlayer.id, oldPlayer.name, oldPlayer.pos[0], oldPlayer.pos[1], oldPlayer.pos[2], oldPlayer.rot[0], oldPlayer.rot[1]);
                }
                dList[p.name] = who.name;
                p.SendDie(who.id);
            }
        }
Exemplo n.º 2
0
        // Code to run when used by a player
        public override void Use(Player p, string message)
        {
            if (message == "")
            {
                if (dList.ContainsKey(p.name))
                {
                    p.SendMessage("Stopped following: " + dList[p.name]);
                    Player oldPlayer = Player.Find(dList[p.name]);
                    if (oldPlayer != null)
                    {
                        p.SendSpawn(oldPlayer.id, oldPlayer.name, oldPlayer.pos[0], oldPlayer.pos[1], oldPlayer.pos[2], oldPlayer.rot[0], oldPlayer.rot[1]);
                    }
                    dList.Remove(p.name);
                    return;
                }
                else
                {
                    Help(p);
                    return;
                }
            }

            Player who = Player.Find(message);

            if (who == null)
            {
                p.SendMessage("No such player!");
                return;
            }
            else
            {
                if (who.hidden)
                {
                    p.SendMessage("No such player!");
                    return;
                }
                else if (who.name == p.name)
                {
                    p.SendMessage("You have a better chance at chasing your tail than following yourself!");
                    return;
                }
            }

            if (!dList.ContainsKey(p.name))
            {
                if (!p.hidden)
                {
                    Command.all.Find("hide").Use(p, "");
                }
                p.SendDie(who.id);
                dList.Add(p.name, who.name);
                p.SendMessage("Now following: " + who.color + who.name);
                p.SendMessage("--Make sure you have flight turned ON!--");
                p.SendMessage("--Otherwise expect jittery movement!--");
            }
            else
            {
                Player oldPlayer = Player.Find(dList[p.name]);
                if (oldPlayer != null)
                {
                    p.SendSpawn(oldPlayer.id, oldPlayer.name, oldPlayer.pos[0], oldPlayer.pos[1], oldPlayer.pos[2], oldPlayer.rot[0], oldPlayer.rot[1]);
                }
                dList[p.name] = who.name;
                p.SendDie(who.id);
            }
        }