예제 #1
0
 void IEventHandlerWarheadKeycardAccess.OnWarheadKeycardAccess(WarheadKeycardAccessEvent ev)
 {
     send(ev, new IdMapping()
          .appendId(Lib.PLAYER_ID, ev.Player)
          .appendId(Lib.PLAYER_EVENT_SCPDATA_ID, ev.Player.Scp079Data)
          .appendId(Lib.PLAYER_EVENT_TEAM_ROLE_ID, ev.Player.TeamRole)
          );
 }
예제 #2
0
 public void OnAccess(WarheadKeycardAccessEvent ev)
 {
     if (!Sitrep.Events.Contains("warheadkeycardaccessevent"))
     {
         return;
     }
     if (!Sitrep.CustomChannelIds.TryGetValue("warheadkeycardaccessevent", out ulong channel))
     {
         channel = Sitrep.EventsId;
     }
     Send($":credit_card: [{ev.Player.Role.AsString()}] {ev.Player.Nick.DiscordSanitize()} ({ev.Player.ParsedUserId}) použil Alpha Warhead panel.", channel);
 }
예제 #3
0
        public static void InvokeWarheadKeycardAccess(GameObject player, ref bool allow, ref string requiredPermission)
        {
            if (WarheadKeycardAccessEvent == null)
            {
                return;
            }

            WarheadKeycardAccessEvent ev = new WarheadKeycardAccessEvent()
            {
                Player        = player.GetPlayer(),
                Allow         = allow,
                RequiredPerms = requiredPermission
            };

            WarheadKeycardAccessEvent.InvokeSafely(ev);

            allow = ev.Allow;
            requiredPermission = ev.RequiredPerms;
        }