private void IOnGarageDoorUsed(GarageDoorServer door) { var player = garageUsedBy.GetValue(door); if (player == null) { return; } Interface.CallHook("OnGarageDoorUsed", door, GameManager.Instance.GetSession((uLink.NetworkPlayer)player)); }
private void IOnGarageDoorUsed(GarageDoorServer door) { NetworkPlayer?netPlayer = door.LastUsedBy; if (netPlayer != null) { PlayerSession session = Player.Find((NetworkPlayer)netPlayer); if (session != null) { Interface.CallHook("OnGarageDoorUsed", door, session); } } }
private void IOnGarageDoorUsed(GarageDoorServer door) { NetworkPlayer?player = door.LastUsedBy; if (player == null) { return; } PlayerSession session = Player.Find((uLink.NetworkPlayer)player); if (session != null) { Interface.CallHook("OnGarageDoorUsed", door, session); } }
void OnGarageDoorUsed(GarageDoorServer door, PlayerSession session) { if (door == null || !door.IsOpen) { return; } if (usePermissions && !IsAllowed(session.SteamId.ToString(), permAuto)) { return; } int time; if (!playerPrefs.TryGetValue(session.SteamId.ToString(), out time)) { time = defaultDelay; } if (time == 0) { return; } timer.Once(time, () => { if (!door || !door.IsOpen) { return; } if (cancelOnKill && session.WorldPlayerEntity.GetComponent <PlayerStatManager>().Dead) { return; } door.DoorCollider.enabled = true; door.RemoveRPCsByName("DOP"); door.RPC("DOP", uLink.RPCMode.OthersBuffered, false); door.IsOpen = false; }); }
void OnGarageDoorUsed(GarageDoorServer door, PlayerSession session) { HookCalled("OnGarageDoorUsed"); }
private bool CanUseGarageDoor(PlayerSession session, GarageDoorServer door) { HookCalled("CanUseGarageDoor"); return(true); }
private void IOnGarageDoorUsed(GarageDoorServer door) { var player = door.LastUsedBy; if (player == null) return; Interface.Call("OnGarageDoorUsed", door, GameManager.Instance.GetSession((uLink.NetworkPlayer)player)); }