Exemplo n.º 1
0
        void TeleportPlayerToSpawns(IPlayer plr)
        {
            IObject[] spawnAreas = Game.GetObjectsByName("SpawnPlayer");
            int       rnd        = m_rnd.Next(0, spawnAreas.Length);

            SFDGameScriptInterface.Vector2 place = spawnAreas[rnd].GetWorldPosition();
            plr.SetWorldPosition(place);
        }
Exemplo n.º 2
0
        // If falling thing is HALE, then tp to safety
        public void KillZoneTrigger(TriggerArgs args)
        {
            if (MODE)
            {
                Game.RunCommand("/MSG " + "Jotain rajalla");
            }
            if (args.Sender == HALE)
            {
                int newHealth;
                if (HALENAMES[HALETYPE] == "Sick Father")
                {
                    newHealth = (int)HALE.GetHealth() - 25;
                }
                else
                {
                    newHealth = (int)HALE.GetHealth() - 50;
                }
                HALE.SetHealth(newHealth);
                IObject[] spawnAreas = Game.GetObjectsByName("SpawnPlayer");
                int       rnd        = m_rnd.Next(0, spawnAreas.Length);
                SFDGameScriptInterface.Vector2 place = spawnAreas[rnd].GetWorldPosition();

                if (newHealth < 0)
                {
                    Game.RunCommand("/MSG " + "Ai saatana :( t. " + HALE.GetUser().Name);
                }
                else
                {
                    Game.RunCommand("/MSG " + "EN KUOLE SAATANA t. " + HALE.GetUser().Name);
                    HALE.SetWorldPosition(place);
                }
            }
            else if (zombifyHumansOnDeath == true)
            {
                if (args.Sender is IPlayer)
                {
                    IPlayer plr = args.Sender as IPlayer;
                    if (plr.GetTeam() == PlayerTeam.Team1)
                    {
                        TeleportPlayerToSpawns(plr);
                        plr.Kill();
                        // render(plr.GetUser());
                    }
                }
            }
        }