Exemplo n.º 1
0
 public static void LateUpdate()
 {
     if (!DeadCam.show)
     {
         return;
     }
     if (SpecCam.show)
     {
         return;
     }
     if (DeadCam.go == null)
     {
         DeadCam.go          = null;
         DeadCam.show        = false;
         BasePlayer.deadflag = 0;
         if (Client.ID >= 0)
         {
             PlayerControll.Player[Client.ID].DeadFlag = 0;
         }
         return;
     }
     Camera.main.transform.position = DeadCam.go.transform.position;
     Camera.main.transform.rotation = Quaternion.Euler(DeadCam.go.transform.eulerAngles.x, DeadCam.go.transform.eulerAngles.y + 90f, DeadCam.go.transform.eulerAngles.z + 90f);
     PlayerControll.CheckVisible();
     if (DeadCam.setspectime != 0f && Time.time > DeadCam.setspectime)
     {
         DeadCam.setspectime = 0f;
         SpecCam.SetActive(true);
         SpecCam.SetFPCam();
         Message.badge_name = string.Empty;
     }
 }
Exemplo n.º 2
0
 private static void Choose(int team)
 {
     HUD.PlayStop();
     C4.SendDropBomb();
     if (PlayerPrefs.GetInt("localplay") > 0)
     {
         BasePlayer.team = team;
         BasePlayer.DevSpawn();
     }
     else
     {
         BasePlayer.team = team;
         Client.cs.send_chooseteam(team);
         ChooseTeam.SetActive(false);
         vp_FPWeaponHandler.cs.m_CurrentWeaponID = 0;
         vp_FPInput.cs.Player.SetWeapon.TryStart <int>(0);
         if (ScoreBoard.gamemode == 1 || ScoreBoard.gamemode == 2 || ScoreBoard.gamemode == 3)
         {
             HUD.SetActive(true);
             SpecCam.SetActive(true);
             SpecCam.SetFPCam();
         }
     }
 }
Exemplo n.º 3
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();
    }