private void RespawnPlayerRPC(int instigatorId) { if (VRC_PlayerApi.GetPlayerById(instigatorId).isMaster) { GameObject gameObject = Networking.LocalPlayer.get_gameObject(); Networking.RPC(VRC_EventHandler.VrcTargetType.Local, gameObject, "Respawn"); } }
public void TakeOwnership(int instigator_id) { VRC_PlayerApi playerById = VRC_PlayerApi.GetPlayerById(instigator_id); if (!(playerById == null)) { Networking.SetOwner(playerById, this.get_gameObject()); } }
public void RespawnPlayer(int playerId) { if (Networking.LocalPlayer.playerId == playerId) { Networking.RPC(VRC_EventHandler.VrcTargetType.Local, Networking.LocalPlayer.get_gameObject(), "Respawn"); } else if (Networking.IsMaster) { Networking.RPC(VRC_PlayerApi.GetPlayerById(playerId), this.get_gameObject(), "RespawnPlayerRPC"); } }
public void TriggerEvent(VrcEvent e, VrcBroadcastType broadcast, int instagatorId, float fastForward) { if (e == null) { Debug.LogErrorFormat("Cancelling event because it was not valid", new object[0]); } else { VRC_PlayerApi playerById = VRC_PlayerApi.GetPlayerById(instagatorId); if (playerById == null) { Debug.LogErrorFormat("Cancelling event because instagator was not valid", new object[0]); } else { TriggerEvent(e, broadcast, playerById.get_gameObject(), fastForward); } } }