Advertisement
Guest User

Health & Armour

a guest
Nov 23rd, 2014
764
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.55 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. //==============================================================================
  4.  
  5. new Text:Textdraw0;
  6. new Text:Textdraw1;
  7. new Text:Textdraw2;
  8. new Text:Textdraw3;
  9.  
  10. //==============================================================================
  11.  
  12. forward Update();
  13.  
  14. //==============================================================================
  15.  
  16. public OnFilterScriptInit()
  17. {
  18. Textdraw0 = TextDrawCreate(536.799743, 417.386627, "Health:");
  19. TextDrawLetterSize(Textdraw0, 0.464399, 1.734400);
  20. TextDrawAlignment(Textdraw0, 1);
  21. TextDrawColor(Textdraw0, 16777215);
  22. TextDrawSetShadow(Textdraw0, 0);
  23. TextDrawSetOutline(Textdraw0, 1);
  24. TextDrawBackgroundColor(Textdraw0, 51);
  25. TextDrawFont(Textdraw0, 1);
  26. TextDrawSetProportional(Textdraw0, 1);
  27.  
  28. //==========================================================================
  29.  
  30. Textdraw1 = TextDrawCreate(600.000000, 418.133300, "100");
  31. TextDrawLetterSize(Textdraw1, 0.366800, 1.629866);
  32. TextDrawAlignment(Textdraw1, 1);
  33. TextDrawColor(Textdraw1, -16776961);
  34. TextDrawSetShadow(Textdraw1, 0);
  35. TextDrawSetOutline(Textdraw1, 1);
  36. TextDrawBackgroundColor(Textdraw1, 51);
  37. TextDrawFont(Textdraw1, 2);
  38. TextDrawSetProportional(Textdraw1, 1);
  39.  
  40. //==========================================================================
  41.  
  42. Textdraw2 = TextDrawCreate(536.000183, 431.573242, "Armor:");
  43. TextDrawLetterSize(Textdraw2, 0.476400, 1.659733);
  44. TextDrawAlignment(Textdraw2, 1);
  45. TextDrawColor(Textdraw2, 16777215);
  46. TextDrawSetShadow(Textdraw2, 0);
  47. TextDrawSetOutline(Textdraw2, 1);
  48. TextDrawBackgroundColor(Textdraw2, 51);
  49. TextDrawFont(Textdraw2, 1);
  50. TextDrawSetProportional(Textdraw2, 1);
  51.  
  52. //==========================================================================
  53.  
  54. Textdraw3 = TextDrawCreate(600.000122, 432.319946, "100");
  55. TextDrawLetterSize(Textdraw3, 0.382000, 1.585066);
  56. TextDrawAlignment(Textdraw3, 1);
  57. TextDrawColor(Textdraw3, -16776961);
  58. TextDrawSetShadow(Textdraw3, 0);
  59. TextDrawSetOutline(Textdraw3, 1);
  60. TextDrawBackgroundColor(Textdraw3, 51);
  61. TextDrawFont(Textdraw3, 2);
  62. TextDrawSetProportional(Textdraw3, 1);
  63.  
  64. //==========================================================================
  65.  
  66. SetTimer("Update", 50, true);
  67.  
  68. //==========================================================================
  69. return 1;
  70. }
  71.  
  72. //==============================================================================
  73.  
  74. public Update()
  75. {
  76. new playerid;
  77. new Float:Health;
  78. new Float:Armour;
  79. GetPlayerHealth(playerid, Health);
  80. GetPlayerArmour(playerid, Armour);
  81. new New[41];
  82. format(New, sizeof(New), "%f", Health);
  83. TextDrawSetString(Textdraw1, New);
  84. format(New, sizeof(New), "%f", Armour);
  85. TextDrawSetString(Textdraw3, New);
  86.  
  87. //--------------------------------------------------------------------------
  88.  
  89. TextDrawShowForPlayer(playerid, Textdraw0);
  90. TextDrawShowForPlayer(playerid, Textdraw1);
  91. TextDrawShowForPlayer(playerid, Textdraw2);
  92. TextDrawShowForPlayer(playerid, Textdraw3);
  93.  
  94. //--------------------------------------------------------------------------
  95. }
  96.  
  97. //==============================================================================
  98.  
  99. public OnPlayerSpawn(playerid)
  100. {
  101. TextDrawShowForPlayer(playerid, Textdraw0);
  102. TextDrawShowForPlayer(playerid, Textdraw1);
  103. TextDrawShowForPlayer(playerid, Textdraw2);
  104. TextDrawShowForPlayer(playerid, Textdraw3);
  105. return 1;
  106. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement