Exemplo n.º 1
0
 public void OnSpawn(PlayerSpawnEvent ev)
 {
     if (ev.Player.TeamRole.Role == Smod2.API.Role.SCP_079)
     {
         this.scp079id = ev.Player.PlayerId;
         if (choise == false)
         {
             ev.Player.SendConsoleMessage("==========SCP079============");
             ev.Player.SendConsoleMessage(".scp         选择本局帮助SCP");
             ev.Player.SendConsoleMessage(".h           选择本局帮助人类");
             ev.Player.SetRank("aqua", "SCP079 - 最大电力:130 | 电力恢复:3AP/s   未选择帮助倾向", null);
             ev.Player.PersonalBroadcast(15, "<color=#FFC0CB>---[SCP079]---</color>\n<color=#00FFFF>HP:无限  </color><color=aqua>你可以耗费电量开门和锁门 \n 清点键盘数字键1左边的~键选择本局所属阵营,如果看不到提示则向上翻</color>", false);
         }
         if (choise == true)
         {
             if (scp == true)
             {
                 ev.Player.SetRank("aqua", "SCP079 -  帮助SCP", null);
                 ev.Player.PersonalBroadcast(15, "<color=#FFC0CB>---[SCP079]---</color>\n<color=#00FFFF>HP:无限  </color><color=aqua>你可以耗费电量开门和锁门 \n 本局079选择帮助SCP</color>", false);
             }
             if (h == true)
             {
                 ev.Player.SetRank("aqua", "SCP079 - 最大电力:130 | 电力恢复:3AP/s   帮助人类", null);
                 ev.Player.PersonalBroadcast(15, "<color=#FFC0CB>---[SCP079]---</color>\n<color=#00FFFF>HP:无限  </color><color=aqua>你可以耗费电量开门和锁门 \n 本局079选择帮助人类</color>", false);
             }
         }
     }
 }
Exemplo n.º 2
0
 public void PlayerSpawn(PlayerSpawnEvent ev)
 {
     if (ev.Player.GetRole() == RoleType.Scp079)
     {
         ev.Player.Broadcast(10, Plugin.SpawnMsg, false);
     }
 }
Exemplo n.º 3
0
 public void OnSpawn(PlayerSpawnEvent ev)
 {
     if (ev.Player.TeamRole.Role == Smod2.API.RoleType.CLASSD)
     {
         ev.Player.ChangeRole(Smod2.API.RoleType.SPECTATOR);
     }
 }
Exemplo n.º 4
0
 internal void Spawn(PlayerSpawnEvent ev)
 {
     if (PluginMain.ammo.ContainsKey(ev.Player))
     {
         PluginMain.ammo.Remove(ev.Player);
     }
 }
Exemplo n.º 5
0
 public void OnSpawn(PlayerSpawnEvent ev)
 {
     if (this.plugin.enable)
     {
         this.plugin.OnCheckRemoveGuns(ev.Player);
     }
 }
Exemplo n.º 6
0
 public void OnSpawn(PlayerSpawnEvent ev)
 {
     /// <summary>
     /// Called when a player spawns into the world
     /// <summary>
     plugin.SendMessageAsync(plugin.GetConfigString("discord_channel_onspawn"), ev.Player.Name + " (" + ev.Player.SteamId + plugin.MultiLanguage(34) + ev.Player.TeamRole.Name + ".");
 }
Exemplo n.º 7
0
 public void OnSpawn(PlayerSpawnEvent ev)
 {
     if (ev.Player.TeamRole.Team == Team.CLASSD || ev.Player.TeamRole.Team == Team.SCIENTIST ||
         ev.Player.TeamRole.Team == Team.NINETAILFOX || ev.Player.TeamRole.Team == Team.CHAOS_INSURGENCY)
     {
         Timing.InTicks(() =>
         {
             List <ItemType> pList = getPlayerItems(ev.Player);
             if (pList != null)
             {
                 foreach (ItemType item in pList)
                 {
                     if (ev.Player.GetInventory().Count < 8)
                     {
                         ev.Player.GiveItem(item);
                     }
                     else
                     {
                         PluginManager.Manager.Server.Map.SpawnItem(item, ev.Player.GetPosition(), Vector.Zero);
                     }
                 }
                 pItems.Remove(ev.Player.SteamId);
             }
         }, 8);
     }
 }
 internal void PlayerSpawn(PlayerSpawnEvent ev)
 {
     if (ev.Player.characterClassManager.CurClass == RoleType.Spectator)
     {
         return;
     }
     ResetRevengeTimer(ev.Player);
 }
Exemplo n.º 9
0
 private void OnPlayerSpawned(PlayerSpawnEvent evt)
 {
     if (evt.Player != null)
     {
         // Call universal hook
         Interface.Call("OnPlayerSpawned", evt.Player.IPlayer, evt.Position);
     }
 }
Exemplo n.º 10
0
 public void OnSpawn(PlayerSpawnEvent 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)
          );
 }
Exemplo n.º 11
0
        internal void InvokePlayerSpawnEvent(CrunchPlayer player)
        {
            var ev = new PlayerSpawnEventArgs
            {
                CrunchPlayer = player
            };

            PlayerSpawnEvent?.Invoke(ev);
        }
Exemplo n.º 12
0
 /// <summary> Events callback. Called every time a Player spawns for the first time. Note this is not called when the
 /// player respawns. </summary>
 /// <param name="eventArgs"> the spawn event arguments </param>
 void OnSpawn(PlayerSpawnEvent eventArgs)
 {
     if (!IsActive)
     {
         return;
     }
     _stocks[eventArgs.Player.ID] = stock;
     //eventArgs.Player.PlayerObject.GetComponent<DamageState>().Type = DamageType.Percent;
 }
 public void Event_PlayerSpawnEvent(PlayerSpawnEvent ev)
 {
     if (!_main.IsEnabled)
     {
         return;
     }
     if (ev.Role.IsAnySCP() && ev.Role != RoleType.Scp93989)
     {
         Timing.RunCoroutine(DoChangeScp(ev.Player));
     }
 }
Exemplo n.º 14
0
 public void OnPlayerSpawn(PlayerSpawnEvent ev)
 {
     if (RolesHealth.ContainsKey(ev.Role))
     {
         Timing.CallDelayed(0.5f, () =>
         {
             ev.Player.playerStats.maxHP  = RolesHealth[ev.Role];
             ev.Player.playerStats.health = RolesHealth[ev.Role];
         });
     }
 }
Exemplo n.º 15
0
 public void OnSpawn(PlayerSpawnEvent ev)
 {
     AdminToolbox.AddSpesificPlayer(ev.Player);
     if (AdminToolbox.playerDeathPos.ContainsKey(ev.Player.SteamId))
     {
         AdminToolbox.playerDeathPos[ev.Player.SteamId] = ev.SpawnPos;
     }
     if (AdminToolbox.playerdict[ev.Player.SteamId][0])
     {
         ev.Player.ChangeRole(Role.SPECTATOR);
     }
 }
Exemplo n.º 16
0
        public void OnPlayerSpawn(PlayerSpawnEvent ev)
        {
            string newMsg = $"{ev.Player.nameClean} spawned as {ev.Role}";

            if (_lastSpawnMessage == newMsg)
            {
                return;
            }

            DiscordLab.bot.NewMessage(newMsg);
            _lastSpawnMessage = newMsg;
        }
Exemplo n.º 17
0
 public void OnSpawn(PlayerSpawnEvent ev)
 {
     AdminToolbox.AddMissingPlayerVariables(new List <Player> {
         ev.Player
     });
     if (AdminToolbox.playerdict.ContainsKey(ev.Player.SteamId))
     {
         AdminToolbox.playerdict[ev.Player.SteamId].DeathPos = ev.SpawnPos;
         if (AdminToolbox.playerdict[ev.Player.SteamId].spectatorOnly)
         {
             ev.Player.ChangeRole(Role.SPECTATOR);
         }
     }
 }
Exemplo n.º 18
0
 public void OnSpawn(PlayerSpawnEvent ev)
 {
     if (isEnabled)
     {
         Vector pos = GetProperSpawnPos(ev.Player);
         if (ev.Player.TeamRole.Team == Smod2.API.Team.TUTORIAL)
         {
             Timing.RunCoroutine(SpawnDelay(ev.Player, pos, tutorialSpawnDelay));
         }
         else
         {
             ev.SpawnPos = pos;
         }
     }
 }
Exemplo n.º 19
0
 public void OnSpawn(PlayerSpawnEvent ev)
 {
     // Only runs if not already running
     if (!plugin.spawning.Contains(ev.Player.SteamId))
     {
         plugin.spawning.Add(ev.Player.SteamId);
         new Task(async() =>
         {
             await Task.Delay(plugin.delay);
             plugin.TryGiveItems(plugin.config, new List <string> {
                 ev.Player.SteamId, ev.Player.GetRankName(), ev.Player.TeamRole.Role.ToString()
             }, ev.Player);
             plugin.spawning.Remove(ev.Player.SteamId);
         }).Start();
     }
 }
Exemplo n.º 20
0
 public void OnSpawn(PlayerSpawnEvent ev)
 {
     if (ev.Player != null && ev.Player is Player)
     {
         AdminToolbox.AddMissingPlayerVariables(new List <Player> {
             ev.Player
         });
     }
     if (AdminToolbox.playerdict.ContainsKey(ev.Player.SteamId))
     {
         AdminToolbox.playerdict[ev.Player.SteamId].DeathPos = ev.SpawnPos;
         if (AdminToolbox.playerdict[ev.Player.SteamId].overwatchMode)
         {
             ev.Player.OverwatchMode = true;
         }
     }
 }
Exemplo n.º 21
0
        public void OnSpawn(PlayerSpawnEvent ev)
        {
            /// <summary>
            /// Called when a player spawns into the world
            /// <summary>
            Dictionary <string, string> variables = new Dictionary <string, string>
            {
                { "spawnpos", ev.SpawnPos.ToString() },
                { "ipaddress", ev.Player.IpAddress },
                { "name", ev.Player.Name },
                { "playerid", ev.Player.PlayerId.ToString() },
                { "steamid", ev.Player.SteamId },
                { "class", ev.Player.TeamRole.Role.ToString() },
                { "team", ev.Player.TeamRole.Team.ToString() }
            };

            plugin.SendMessage(Config.GetArray("channels.onspawn"), "player.onspawn", variables);
        }
Exemplo n.º 22
0
 public void OnSpawn(PlayerSpawnEvent ev)
 {
     if (GamemodeManager.GamemodeManager.GetCurrentMode().Equals(plugin))
     {
         if (ev.Player.TeamRole.Role != Role.CLASSD && ev.Player.TeamRole.Role != Role.SCP_173)
         {
             if (ev.Player.TeamRole.Role == Role.FACILITY_GUARD || ev.Player.TeamRole.Role == Role.SCIENTIST)
             {
                 ev.Player.ChangeRole(Role.CLASSD);
                 ev.Player.Teleport(plugin.pluginManager.Server.Map.GetRandomSpawnPoint(Role.CLASSD));
             }
             else
             {
                 ev.Player.ChangeRole(Role.SCP_173);
                 ev.Player.Teleport(plugin.pluginManager.Server.Map.GetRandomSpawnPoint(Role.SCP_173));
                 ev.Player.AddHealth(300000);
             }
         }
     }
 }
Exemplo n.º 23
0
 public void OnSpawn(PlayerSpawnEvent ev)
 {
     plugin.luaHookCall.Function.Call("OnSpawn", ev.Player, ev.SpawnPos);
 }
Exemplo n.º 24
0
        public void OnSpawn(PlayerSpawnEvent ev)
        {
            // Only runs if not already running
            if (!plugin.spawning.Contains(ev.Player.SteamId))
            {
                plugin.spawning.Add(ev.Player.SteamId);
                new Task(async() =>
                {
                    // Delays execution until smod has created the object
                    await Task.Delay(500);
                    await Task.Delay(plugin.delay);

                    Player player = plugin.Server.GetPlayers(ev.Player.SteamId)[0];
                    if (player == null)
                    {
                        plugin.Warn("Could not find spawning player '" + ev.Player.Name + "', did they disconnect?");
                        plugin.spawning.Remove(ev.Player.SteamId);
                        return;
                    }
                    try
                    {
                        // Check each registered permission node
                        JProperty[] permissionNodes = plugin.loadouts.Properties().ToArray();
                        foreach (JProperty permissionNode in permissionNodes)
                        {
                            if (player.HasPermission("customloadouts." + permissionNode.Name))
                            {
                                try
                                {
                                    // Check if their role has a custom loadout registered
                                    JProperty[] roles = permissionNode.Value.Value <JObject>().Properties().ToArray();
                                    foreach (JProperty role in roles)
                                    {
                                        if (player.TeamRole.Role.ToString() == role.Name || role.Name == "all")
                                        {
                                            try
                                            {
                                                plugin.GiveItems(role.Value, ev.Player);
                                            }
                                            catch (Exception e)
                                            {
                                                plugin.Error("Error giving items: " + e.ToString());
                                            }
                                        }
                                    }
                                }
                                catch (Exception e)
                                {
                                    plugin.Error("Error checking role: " + e.ToString());
                                }
                            }
                        }
                    }
                    catch (Exception e)
                    {
                        plugin.Error("Error checking permission: " + e.ToString());
                    }
                    plugin.spawning.Remove(ev.Player.SteamId);
                }).Start();
            }
        }
        public void OnSpawn(PlayerSpawnEvent ev)
        {
            // 判断有木有SCP-181
            if (GlobalVar.scp181 == null)
            {
                return;
            }

            // 判断玩家是不是SCP-181 不是则退出本次事件
            if (ev.Player.Name.Equals(GlobalVar.scp181.Name) == false)
            {
                return;
            }

            if (ev.Player.PlayerId != GlobalVar.scp181.PlayerId)
            {
                return;
            }

            if (GlobalVar.scp181_escape == false)
            {
                return;
            }

            // 如果debug模式开启了
            if (Plugin.GetConfigBool("scp181_debug") == true)
            {
                Plugin.Info("======================SCP-181 OnSpawn [Debug]======================");
                Plugin.Info("SCP-181: " + ev.Player.Name + "(" + ev.Player.PlayerId + ")");
                Plugin.Info("Escape:  " + GlobalVar.scp181_escape);
                Plugin.Info("Team: " + ev.Player.TeamRole.Name);
            }


            // 如果加入了 NTF
            if (ev.Player.TeamRole.Team == Smod2.API.Team.NINETAILFOX)
            {
                // 设置成NTF科学家
                ev.Player.ChangeRole(Role.NTF_SCIENTIST);

                // 给个电磁炮
                ev.Player.GiveItem(ItemType.MICROHID);

                // 温馨提示
                GlobalVar.scp181.PersonalBroadcast(
                    8,
                    "<color=orange>[SCP-181]</color> <color=blue>作为 [NTF-氪学家] 你获得了:</color>\n<color=pink>MicroHID 电磁炮*1</color>",
                    false
                    );

                GlobalVar.scp181 = null;
                return;
            }


            // 如果加入了 CI
            if (ev.Player.TeamRole.Team == Smod2.API.Team.CHAOS_INSURGENCY)
            {
                ev.Player.GiveItem(ItemType.FLASHBANG);
                ev.Player.GiveItem(ItemType.WEAPON_MANAGER_TABLET);
                ev.Player.GiveItem(ItemType.E11_STANDARD_RIFLE);
                ev.Player.SetAmmo(AmmoType.DROPPED_5, 300);

                ev.Player.PersonalBroadcast(
                    8,
                    "<color=orange>[SCP-181]</color> <color=green>作为 [馄饨叛乱者] 你获得了:</color>\n<color=pink>手雷*1 | 面板*1 | E11步枪&300发子弹</color>",
                    false
                    );

                GlobalVar.scp181 = null;
                return;
            }
        }