Guest User

Samp Car Health By UltraScripter !

a guest
Dec 30th, 2014
731
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.75 KB | None | 0 0
  1. //Car Health By UltraScripter / / / 1 / 1/1 /1 //1
  2. ////////////////////////////////////////////////////////////////
  3.  
  4. #include <a_samp>
  5.  
  6. new Text:Draw[MAX_PLAYERS];
  7.  
  8. #if defined FILTERSCRIPT
  9.  
  10. #endif
  11.  
  12. public OnFilterScriptInit()
  13. {
  14. print("\n-------------------------------------------------");
  15. print(" Car Health Bar By UltraScripter Loaded!!! !!! !!!");
  16. print("-------------------------------------------------\n");
  17. return 1;
  18. }
  19.  
  20. public OnPlayerConnect(playerid)
  21. {
  22. Draw[playerid] = TextDrawCreate(181.561234634, 421.5531235567, " "); //546.0, 74.0 /// /// ///
  23. TextDrawAlignment(Draw[playerid], 1);
  24. TextDrawLetterSize(Draw[playerid], 0.75000500500, 0.9500500500);
  25. TextDrawFont(Draw[playerid], 1);
  26. TextDrawSetOutline(Draw[playerid], 1);
  27. TextDrawSetShadow(Draw[playerid], 1);
  28. return 1;
  29. }
  30.  
  31. public OnPlayerUpdate(playerid)
  32. {
  33. new Car, State, Float:Health;
  34. Car = GetPlayerVehicleID(playerid);
  35. State = GetPlayerState(playerid);
  36. GetVehicleHealth(Car, Health);
  37. if(State == PLAYER_STATE_DRIVER)
  38. {
  39. TextDrawShowForPlayer(playerid, Draw[playerid]);
  40. if(Health <= 1000)
  41. {
  42. TextDrawColor(Draw[playerid], 0x00FF00FF);
  43. TextDrawSetString(Draw[playerid], "..........");
  44. }
  45. if(Health <= 850)
  46. {
  47. TextDrawColor(Draw[playerid], 0x00FF00FF);
  48. TextDrawSetString(Draw[playerid], ".........");
  49. }
  50. if(Health <= 800)
  51. {
  52. TextDrawColor(Draw[playerid], 0x00FF00FF);
  53. TextDrawSetString(Draw[playerid], "........");
  54. }
  55. if(Health <= 750)
  56. {
  57. TextDrawColor(Draw[playerid], 0xD1C205FF);
  58. TextDrawSetString(Draw[playerid], ".......");
  59. }
  60. if(Health <= 700)
  61. {
  62. TextDrawColor(Draw[playerid], 0xD1C205FF);
  63. TextDrawSetString(Draw[playerid], "......");
  64. }
  65. if(Health <= 650)
  66. {
  67. TextDrawColor(Draw[playerid], 0xD1C205FF);
  68. TextDrawSetString(Draw[playerid], ".....");
  69. }
  70. if(Health <= 600)
  71. {
  72. TextDrawColor(Draw[playerid], 0xD1C205FF);
  73. TextDrawSetString(Draw[playerid], "....");
  74. }
  75. if(Health <= 550)
  76. {
  77. TextDrawColor(Draw[playerid], 0xFF0000FF);
  78. TextDrawSetString(Draw[playerid], "...");
  79. }
  80. if(Health <= 500)
  81. {
  82. TextDrawColor(Draw[playerid], 0xFF0000FF);
  83. TextDrawSetString(Draw[playerid], "..");
  84. }
  85. if(Health <= 450)
  86. {
  87. TextDrawColor(Draw[playerid], 0xFF0000FF);
  88. TextDrawSetString(Draw[playerid], ".");
  89. }
  90. if(Health <= 250)
  91. {
  92. TextDrawColor(Draw[playerid], 0xFFFF00FF);
  93. TextDrawSetString(Draw[playerid], "NONE!");
  94. }
  95. }
  96. else
  97. {
  98. TextDrawHideForPlayer(playerid, Draw[playerid]);
  99. }
  100. return 1;
  101. }
  102.  
  103. //Car Health By UltraScripter / / / 1 / 1/1 /1 //1
  104. ////////////////////////////////////////////////////////////////
Advertisement
Add Comment
Please, Sign In to add comment