public void OnSCP914Activate(SCP914ActivateEvent ev) { /// <summary> /// This is the event handler for when a SCP914 is activated /// </summary> plugin.SendMessageAsync(plugin.GetConfigString("discord_channel_onscp914activate"), plugin.MultiLanguage(43) + ev.KnobSetting + "."); }
public void OnSCP914Activate(SCP914ActivateEvent ev) { if (!SI_Config.si_914enable) { return; } Scp914 scp914 = GameObject.FindObjectOfType <Scp914>(); if (scp914 == null) { plugin.Error("914 cannot be found."); return; } foreach (UnityEngine.Collider collider in ev.Inputs) { if (collider.GetComponent <Inventory>() != null) { Smod2.API.Player play = new ServerMod2.API.SmodPlayer(collider.gameObject); if (SI_Config.si_914handorinv == 1) // Don't know if passing the collider will work the way I want it to work so I'm just gonna pray to the unity gods for a bug free experience. { _914Manager.DoHand914(collider, ev.OutputPos, ev.KnobSetting, scp914); } else if (SI_Config.si_914handorinv == 2) { _914Manager.DoInventory914(collider, ev.OutputPos, ev.KnobSetting, scp914); } else if (SI_Config.si_914handorinv == 0) { CheckSteamIDItemNum[play.SteamId].TransferItems(collider.gameObject); CheckSteamIDItemNum[play.SteamId].ApplyTransferedItems(collider.gameObject, true); } } } }
void IEventHandlerSCP914Activate.OnSCP914Activate(SCP914ActivateEvent ev) { send(ev, new IdMapping() .appendId(Lib.EVENT_USER_ID, ev.User) .appendId(Lib.EVENT_USER_SCPDATA_ID, ev.User.Scp079Data) .appendId(Lib.EVENT_USER_TEAMROLE_ID, ev.User.TeamRole) ); }
public void OnSCP914Activate(SCP914ActivateEvent ev) { if (!enabled) { return; } object[] inputs = ev.Inputs; Scp914 objectOfType = UnityEngine.Object.FindObjectOfType <Scp914>(); if ((UnityEngine.Object)objectOfType == (UnityEngine.Object)null) { this.plugin.Error("Couldnt find SCP-914"); return; } // string[] strArray = new string[5] { "Very Rough", "Rough", "1 to 1", "Fine", "Very Fine" }; // for (byte index1 = 0; index1 < objectOfType.recipes.Length; ++index1) //item id // { // this.plugin.Debug("==== Recipe for: " + component.availableItems[index1].label + " ===="); // for (byte index2 = 0; index2 < objectOfType.recipes[index1].outputs.Count; ++index2) //knob setting id // { // foreach(sbyte itm in objectOfType.recipes[index1].outputs[index2].outputs) //output item id // { // this.plugin.Debug(strArray[index2] + ": " + (itm == -1 ? "NULL" : component.availableItems[itm].label)); // } // } // } foreach (UnityEngine.Collider collider in inputs) { Pickup component1 = collider.GetComponent <Pickup>(); if ((UnityEngine.Object)component1 == (UnityEngine.Object)null) { NicknameSync component2 = collider.GetComponent <NicknameSync>(); CharacterClassManager component3 = collider.GetComponent <CharacterClassManager>(); PlyMovementSync component4 = collider.GetComponent <PlyMovementSync>(); PlayerStats component5 = collider.GetComponent <PlayerStats>(); if ((UnityEngine.Object)component2 != (UnityEngine.Object)null && (UnityEngine.Object)component3 != (UnityEngine.Object)null && ((UnityEngine.Object)component4 != (UnityEngine.Object)null && (UnityEngine.Object)component5 != (UnityEngine.Object)null) && (UnityEngine.Object)collider.gameObject != (UnityEngine.Object)null) { UnityEngine.GameObject gameObject = collider.gameObject; ServerMod2.API.SmodPlayer player = new ServerMod2.API.SmodPlayer(gameObject); if (player.TeamRole.Team != Smod2.API.Team.SCP && player.TeamRole.Team != Smod2.API.Team.NONE && player.TeamRole.Team != Smod2.API.Team.SPECTATOR) { if (currentonly) { Smod2.API.Item item = player.GetCurrentItem(); doRecipe(item, objectOfType, player, ev.KnobSetting); } else { foreach (Smod2.API.Item item in player.GetInventory()) { doRecipe(item, objectOfType, player, ev.KnobSetting); } } } } } } }
/// <summary> /// This is the event handler for when a SCP914 is activated /// </summary> public void OnSCP914Activate(SCP914ActivateEvent ev) { Dictionary <string, string> variables = new Dictionary <string, string> { { "knobsetting", ev.KnobSetting.ToString() } }; this.plugin.SendMessage(Config.GetArray("channels.onscp914activate"), "environment.onscp914activate", variables); }
public void OnActivate(SCP914ActivateEvent ev) { if (!Sitrep.Events.Contains("scp914activateevent")) { return; } if (!Sitrep.CustomChannelIds.TryGetValue("scp914activateevent", out ulong channel)) { channel = Sitrep.EventsId; } Send($":clock: [{ev.Player.Role.AsString()}] {ev.Player.Nick.DiscordSanitize()} ({ev.Player.ParsedUserId}) aktivoval SCP-914.", channel); }
public void OnSCP914Activate(SCP914ActivateEvent ev) { /// <summary> /// This is the event handler for when a SCP914 is activated /// </summary> Dictionary <string, string> variables = new Dictionary <string, string> { { "knobsetting", ev.KnobSetting.ToString() } }; plugin.SendMessageToBot(Config.channels.onscp914activate, "environment.onscp914activate", variables); }
public void OnSCP914Activate(SCP914ActivateEvent ev) { List <GameObject> objects = new List <GameObject>(); List <SmodPlayer> players = new List <SmodPlayer>(); foreach (Collider collider in ev.Inputs) { if (collider.GetType() == typeof(CapsuleCollider)) { if (collider.gameObject.name == "Player") { players.Add(new SmodPlayer(collider.gameObject)); } } } plugin.luaHookCall.Function.Call("OnSCP914Activate", players, ev.KnobSetting, ev.Intake, ev.Outtake); }
public void OnSCP914Activate(SCP914ActivateEvent ev) { scp914activates++; }