private void OnGesture(UnturnedPlayer pl, UnturnedPlayerEvents.PlayerGesture gesture) { PComponent pc = pl.GetComponent <PComponent>(); if (pc.FlyMode == true) { if (gesture == UnturnedPlayerEvents.PlayerGesture.Salute) { pl.Player.movement.sendPluginGravityMultiplier(1); return; } if (gesture == UnturnedPlayerEvents.PlayerGesture.Point) { double cc = -0.5; float gm = Convert.ToSingle(cc); pl.Player.movement.sendPluginGravityMultiplier(gm); return; } if (gesture == UnturnedPlayerEvents.PlayerGesture.Wave) { pl.Player.movement.sendPluginGravityMultiplier(0); return; } if (gesture == UnturnedPlayerEvents.PlayerGesture.SurrenderStart) { pl.Player.movement.sendPluginSpeedMultiplier(pl.Player.movement.totalSpeedMultiplier + 1); ChatManager.say(pl.CSteamID, "Actual Speed: " + pl.Player.movement.totalSpeedMultiplier, Color.blue, false); return; } if (gesture == UnturnedPlayerEvents.PlayerGesture.Facepalm) { if (pl.Player.movement.speed == 1) { ChatManager.say(pl.CSteamID, Translate("SpeedDownLimit"), Color.red, false); return; } pl.Player.movement.sendPluginSpeedMultiplier(pl.Player.movement.totalSpeedMultiplier - 1); ChatManager.say(pl.CSteamID, "Actual Speed: " + pl.Player.movement.totalSpeedMultiplier, Color.blue, false); return; } } else { return; } }
public void Flymode(IRocketPlayer caller, string[] args) { UnturnedPlayer pl = UnturnedPlayer.FromName(caller.DisplayName); PComponent pc = pl.GetComponent <PComponent>(); if (pc.FlyMode == false) { pc.FlyMode = true; ChatManager.say(pl.CSteamID, Translate("FlyMode-On"), Color.green, false); pl.GodMode = true; } else { pc.FlyMode = false; ChatManager.say(pl.CSteamID, Translate("FlyMode-Off"), Color.red, false); pl.GodMode = false; pl.Player.movement.sendPluginSpeedMultiplier(1); pl.Player.movement.sendPluginGravityMultiplier(1); } }