public void RPCRespawn(int primaryWeaponID, int secondaryWeaponID, int meleeID, int item1ID, int item2ID) { if (photonView.isMine) { Destroy(cam.gameObject); Destroy(viewmodelRoot); PhotonNetwork.Destroy(gameObject); object[] data = new object[5]; if (ServerController.gamemode == ServerController.Gamemode.GG) { int kills = ServerController.GetKills(PhotonNetwork.player); GunInfo ggGun = ServerController.Instance.gunGameGuns[kills]; data[0] = ggGun.ID; data[1] = -1; data[2] = -1; data[3] = -1; data[4] = -1; } else { data[0] = primaryWeaponID; data[1] = secondaryWeaponID; data[2] = meleeID; data[3] = item1ID; data[4] = item2ID; } Spawnpoint spawnpoint = MapController.FindSpawnpoint(PhotonNetwork.player.GetTeam()); GameObject go = PhotonNetwork.Instantiate("Player", spawnpoint.position, spawnpoint.rotation, 0, data); } }
public void SpawnPlayer(int primaryID, int secondaryID, int meleeID, int item1ID, int item2ID) { object[] data = new object[5]; data[0] = primaryID; data[1] = secondaryID; data[2] = meleeID; data[3] = item1ID; data[4] = item2ID; Spawnpoint spawnpoint = MapController.FindSpawnpoint(PhotonNetwork.player.GetTeam()); PhotonNetwork.Instantiate("Player", spawnpoint.position, spawnpoint.rotation, 0, data); }
public static Spawnpoint FindSpawnpoint(PunTeams.Team team) { Spawnpoint spawnpoint = FindSpawnpoint(); if (team != PunTeams.Team.none) { while (spawnpoint.team != team) { spawnpoint = FindSpawnpoint(); } } return(spawnpoint); }
public void Reset() { if (photonView.isMine) { if (isDead) { Respawn(); return; } Spawnpoint spawnpoint = MapController.FindSpawnpoint(PhotonNetwork.player.GetTeam()); transform.position = spawnpoint.position; transform.rotation = spawnpoint.rotation; mouseLook.xRot = 0f; items.Reset(); } }