示例#1
0
 public static void SetActive(bool val)
 {
     if (SpecCam.show)
     {
         return;
     }
     if (val)
     {
         BasePlayer.deadflag = 1;
         HUD.sHealth         = "0";
         PlayerControll.Player[Client.ID].DeadFlag = 1;
         vp_FPInput.cs.AllowGameplayInput          = false;
         bool deathRD = false;
         if (ScoreBoard.gamemode == 3 && BasePlayer.team == 0)
         {
             deathRD = true;
         }
         DeadCam.go = PlayerControll.CreatePlayerRD(Client.ID, 0, 0, deathRD);
         if (DeadCam.go == null)
         {
             return;
         }
         DeadCam.ChangeLayersRecursively(DeadCam.go, LayerMask.NameToLayer("Hidden"));
         DeadCam.go   = GameObject.Find(DeadCam.go.name + "/Bip001/Bip001 Pelvis/Bip001 Spine/Bip001 Spine1/Bip001 Neck/Bip001 Head");
         DeadCam.show = true;
         if (DeadCam.go == null)
         {
             MonoBehaviour.print("gameobject no found");
         }
         vp_FPWeaponHandler.cs.m_CurrentWeaponID = -1;
         vp_FPInput.cs.Player.SetWeapon.TryStart <int>(0);
         ScoreTop.UpdateData();
         GameObject gameObject = GameObject.Find("WeaponCamera");
         gameObject.GetComponent <Camera>().cullingMask = 0;
         Message.SetDead(true);
         PlayerNames.hideradar = true;
         if ((ScoreBoard.gamemode == 1 || ScoreBoard.gamemode == 2 || ScoreBoard.gamemode == 3) && GameData.restartroundmode != 1)
         {
             DeadCam.setspectime = Time.time + 3f;
         }
     }
     else
     {
         DeadCam.go          = null;
         DeadCam.show        = false;
         BasePlayer.deadflag = 0;
         if (Client.ID != -1)
         {
             PlayerControll.Player[Client.ID].DeadFlag = 0;
         }
         GameObject gameObject2 = GameObject.Find("WeaponCamera");
         gameObject2.GetComponent <Camera>().cullingMask = -2147483648;
         DeadCam.setspectime = 0f;
     }
 }
示例#2
0
    public static void Spawn(float x, float y, float z, float angle)
    {
        GameObject      gameObject      = GameObject.Find("LocalPlayer");
        vp_FPCamera     vp_FPCamera     = (vp_FPCamera)UnityEngine.Object.FindObjectOfType(typeof(vp_FPCamera));
        vp_FPController vp_FPController = (vp_FPController)UnityEngine.Object.FindObjectOfType(typeof(vp_FPController));

        gameObject.transform.position = new Vector3(x, y, z);
        vp_FPCamera.SetRotation(new Vector2(0f, angle), true, true);
        ChooseTeam.SetActive(false);
        vp_FPCamera.SetMouseFreeze(false);
        vp_FPController.m_CharacterController.enabled = true;
        BasePlayer.health = 100;
        Crosshair.SetActive(true);
        Crosshair.forceLockCursor = true;
        HUD.SetActive(true);
        HUD.cs.OnResize();
        BasePlayer.deadflag = 0;
        if (Client.ID != -1)
        {
            PlayerControll.Player[Client.ID].DeadFlag = 0;
        }
        vp_FPInput.cs.AllowGameplayInput = true;
        BasePlayer.selectedGrenade       = 0;
        vp_FPInput.grenadeThrowStarting  = false;
        vp_FPInput.grenadeThrowEnding    = false;
        vp_FPInput.fastGrenade           = false;
        vp_FPInput.mouseDown             = false;
        vp_FPInput.mouseUp = false;
        if (GameData.restartroundmode != 1 && ScoreBoard.gamemode != 0)
        {
            vp_FPWeapon.RemoveAllMapWeapon();
            vp_FPWeapon.RemoveAllMapSmoke();
        }
        CutoffFX.RemoveFX();
        vp_FPCamera.cs.SetFlashFX(0f, 3.5f);
        BlackScreen.SetActive(false);
        Zombie.SetInfectedScreen(false);
        Zombie.repelVector = Vector2.zero;
        if (Client.ID != -1)
        {
            PlayerControll.Player[Client.ID].bomb = false;
        }
        if (Client.ID != -1)
        {
            PlayerControll.Player[Client.ID].defuse = false;
        }
        ScoreTop.UpdateData();
        if (BasePlayer.weapon[0] == null)
        {
            BasePlayer.weapon[0] = null;
        }
        else
        {
            BasePlayer.weapon[0] = new CWeapon(WeaponData.GetData(BasePlayer.weapon[0].data.wid));
        }
        if (BasePlayer.weapon[1] == null)
        {
            BasePlayer.weapon[1] = new CWeapon(WeaponData.GetData(1));
        }
        else
        {
            BasePlayer.weapon[1] = new CWeapon(WeaponData.GetData(BasePlayer.weapon[1].data.wid));
        }
        if (BasePlayer.weapon[2] == null)
        {
            BasePlayer.weapon[2] = new CWeapon(WeaponData.GetData(28));
        }
        BasePlayer.weapon[3] = null;
        if (BasePlayer.weapon[4] == null)
        {
            BasePlayer.weapon[4] = null;
        }
        BasePlayer.weapon[5] = null;
        BasePlayer.weapon[6] = null;
        if (BasePlayer.weapon[7] == null)
        {
            BasePlayer.weapon[7] = new CWeapon(WeaponData.GetData(31));
        }
        if (BasePlayer.weapon[9] == null)
        {
            BasePlayer.weapon[9] = new CWeapon(WeaponData.GetData(26));
        }
        BasePlayer.currweapon = null;
        BasePlayer.CalcAmmo();
        vp_FPWeaponHandler.cs.m_CurrentWeaponID = 0;
        if (BasePlayer.weapon[0] != null)
        {
            vp_FPInput.cs.Player.SetWeaponByName.Try(BasePlayer.weapon[0].data.selectName);
        }
        else if (BasePlayer.weapon[1] != null)
        {
            vp_FPInput.cs.Player.SetWeaponByName.Try(BasePlayer.weapon[1].data.selectName);
        }
        else if (BasePlayer.weapon[2] != null)
        {
            vp_FPInput.cs.Player.SetWeaponByName.Try(BasePlayer.weapon[2].data.selectName);
        }
        BasePlayer.lastdroppeduid = -1;
        BuyMenu.ShowBuy(x, y, z);
        HitEffect.Reset();
        SpecCam.SetActive(false);
        DeadCam.SetActive(false);
        DeadCam.setspectime = 0f;
        Message.ResetMessage();
        HUD.ResetRespawnBar();
        Award.lastaward = 0;
        global::Console.cs.Command("hud 1");
        HUD.PlayStop();
        Message.SetDead(false);
        PlayerNames.hideradar = false;
        C4.GetPlants();
        C4.isplanting        = false;
        C4.isdiffusing       = false;
        BasePlayer.spawntime = Time.time;
        CC.CheckOnce();
    }