public override void OnUpdate() { MultiplayerPlayerInformation multiplayerPlayerInformation = (MultiplayerPlayerInformation)GameObject.Find("Player").GetComponent(typeof(MultiplayerPlayerInformation)); MultiplayerPlayerScript[] multiplayerPlayerScript = (MultiplayerPlayerScript[])UnityEngine.Object.FindObjectsOfType(typeof(MultiplayerPlayerScript)); Color colour = Main.cycleColour; if (multiplayerPlayerScript.Length > 0) { foreach (var clients in multiplayerPlayerScript) { if (rainbowEveryone.Value) { clients.modelmat.SetColor("_PrimaryMaskColor", colour); clients.modelmat.SetColor("_SecondaryMaskColor", colour); clients.modelmat.SetColor("_DetailMaskColor", colour); } else { if (clients.name == multiplayerPlayerInformation.myplayer.name) { clients.modelmat.SetColor("_PrimaryMaskColor", colour); clients.modelmat.SetColor("_SecondaryMaskColor", colour); clients.modelmat.SetColor("_DetailMaskColor", colour); } } } } }
public override void OnUpdate() { playerHealthManagement = (PlayerHealthManagement)GameObject.Find("Player").GetComponent(typeof(PlayerHealthManagement)); MultiplayerPlayerInformation multiplayerPlayerInformation = (MultiplayerPlayerInformation)GameObject.Find("Player").GetComponent(typeof(MultiplayerPlayerInformation)); MultiplayerPlayerScript[] multiplayerPlayerScripts = (MultiplayerPlayerScript[])UnityEngine.Object.FindObjectsOfType(typeof(MultiplayerPlayerScript)); switch (modes.Selected) { case "BUILTIN": //Shitty built in godmode when health reaches 0 and below you go invisible. if (!playerHealthManagement.Equals(null)) { playerHealthManagement.godmode = true; } break; case "PICKUP": //Now works when none host. Just annoying with its sound and stuff. if (!playerHealthManagement.Equals(null) && playerHealthManagement.myhealth < 200f) { PlayerPickupScript script = (PlayerPickupScript)GameObject.Find("Player").GetComponent(typeof(PlayerPickupScript)); if (!script.Equals(null)) { fakeHealth = new GameObject(); fakeHealth.AddComponent <DummyClass>(); fakeHealth.tag = "HolyHealthTag"; fakeHealth.transform.position = multiplayerPlayerInformation.myplayer.transform.position; script.pickupholyhealth(fakeHealth); } } break; case "CLIENT": //Works only when host. if (multiplayerPlayerScripts.Length > 0) { foreach (var clients in multiplayerPlayerScripts) { if (clients.name == multiplayerPlayerInformation.myplayer.name) { clients.myhealth = health.GetValueFloat(); clients.myarmor = armour.GetValueFloat(); } } } break; case "CLIENTPICKUP": //Works none host and no annoying sounds plus other players can't hear it. if (multiplayerPlayerScripts.Length > 0 && !playerHealthManagement.Equals(null) && playerHealthManagement.myhealth < 200f) { foreach (var clients in multiplayerPlayerScripts) { if (clients.name == multiplayerPlayerInformation.myplayer.name) { clients.CallCmdSetHealth(health.GetValueFloat(), armour.GetValueFloat()); } } } break; } }
public override void OnUpdate() { targetPos.Clear(); playerPos = ((MyControllerScript[])UnityEngine.Object.FindObjectsOfType(typeof(MyControllerScript)))[0].transform.position; MultiplayerPlayerInformation multiplayerPlayerInformation = (MultiplayerPlayerInformation)GameObject.Find("Player").GetComponent(typeof(MultiplayerPlayerInformation)); foreach (var client in (MultiplayerPlayerScript[])UnityEngine.Object.FindObjectsOfType(typeof(MultiplayerPlayerScript))) { if (multiplayerPlayerInformation.myplayer.name != client.myplayer.name) { targetPos.Add(client.transform.position); } } }
public override void OnUpdate() { MultiplayerPlayerInformation multiplayerPlayerInformation = (MultiplayerPlayerInformation)GameObject.Find("Player").GetComponent(typeof(MultiplayerPlayerInformation)); MultiplayerPlayerScript[] multiplayerPlayerScripts = (MultiplayerPlayerScript[])UnityEngine.Object.FindObjectsOfType(typeof(MultiplayerPlayerScript)); if (multiplayerPlayerScripts.Length > 0) { foreach (var clients in multiplayerPlayerScripts) { if (!everyone.Value && multiplayerPlayerInformation.myplayer.name != clients.name) { continue; } switch (mode.Selected) { case "SNAKE": if (frameCounter >= snake.Length) { frameCounter = 0; } FrameIncrease(snake, clients); break; case "BUBBLES": if (frameCounter >= bubbles.Length) { frameCounter = 0; } FrameIncrease(bubbles, clients); break; case "RAINBOW": //TODO make rainbow names. break; case "SET": clients.Networkplayername = setName.Value; clients.Networkplainname = setName.Value; break; } } } }
public override void OnEnable() { multiplayerPlayerInformation = (MultiplayerPlayerInformation)GameObject.Find("Player").GetComponent(typeof(MultiplayerPlayerInformation)); MultiplayerPlayerScripts = (MultiplayerPlayerScript[])UnityEngine.Object.FindObjectsOfType(typeof(MultiplayerPlayerScript)); foreach (var clients in MultiplayerPlayerScripts) { if (clients.name == multiplayerPlayerInformation.myplayer.name) { if (noneHost.Value) { clients.CmdIncreaseKills(116123); } clients.CmdWinRound(multiplayerPlayerInformation.myplayer.name); clients.CmdSendChatMessage("ez!"); clients.CmdSendChatMessage("So ez!!!1!"); } } Main.ModuleManager.Toggle(this); }
public override void OnUpdate() { MultiplayerPlayerInformation multiplayerPlayerInformation = (MultiplayerPlayerInformation)GameObject.Find("Player").GetComponent(typeof(MultiplayerPlayerInformation)); NetworkPlayer[] networkPlayers = (NetworkPlayer[])UnityEngine.Object.FindObjectsOfType(typeof(NetworkPlayer)); if (networkPlayers.Length > 0 && !multiplayerPlayerInformation.Equals(null)) { foreach (NetworkPlayer player in networkPlayers) { if (!player.Equals(null) && !string.IsNullOrEmpty(player.igName)) { if (player.igName == multiplayerPlayerInformation.myplayer.name) { player.NetworksteamId = UInt64.MaxValue; player.steamName = "player"; } } } } }