Advertisement
zjqyf

GLQ_PlayerGhost.cs

Aug 10th, 2017
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. using Turbo.Plugins.Default;
  2. //by JackCeparou
  3. namespace Turbo.Plugins.glq
  4. {
  5. public class GLQ_PlayerGhost : BasePlugin, IInGameTopPainter
  6. {
  7. private IBrush bgBrush;
  8. private bool IsGhost;
  9. private bool Dead;
  10. public string DeathSymbol { get; set; }
  11. public IFont TextFontDeath { get; set; }
  12. public GLQ_PlayerGhost()
  13. {
  14. Enabled = true;
  15. }
  16. public override void Load(IController hud)
  17. {
  18. base.Load(hud);
  19. Dead = false;
  20. bgBrush = Hud.Render.CreateBrush(255, 0, 0, 0, 0);
  21. DeathSymbol = "\u271F"; //✟
  22. TextFontDeath = Hud.Render.CreateFont("tahoma", 35, 120, 255, 255, 255, true, false, true);
  23. }
  24.  
  25. public void PaintTopInGame(ClipState clipState)
  26. {
  27. if (clipState != ClipState.BeforeClip) return;
  28. var layout = TextFontDeath.GetTextLayout(DeathSymbol);
  29. foreach (var player in Hud.Game.Players)
  30. {
  31. if (player.IsDeadSafeCheck)
  32. {
  33. var portrait = player.PortraitUiElement.Rectangle;
  34. var x = portrait.Left+ portrait.Width;
  35. var y = portrait.Top+ portrait.Height/4;
  36. TextFontDeath.DrawText(layout, x, y);
  37. }
  38. }
  39. }
  40. }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement