Advertisement
Guest User

Vida/Colete by:Marllun

a guest
Dec 4th, 2016
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.76 KB | None | 0 0
  1. //=========================== [ Includes ] =====================================
  2. #include <a_samp>
  3.  
  4. #define COR_TEXTDRAW00 0xE6E6FAFF   //aqui você vai colocar a cor do textdraw em hexadecimal.
  5. #define COR_TEXTDRAW01 0xE6E6FAFF //aqui você vai colocar a cor do textdraw em hexadecimal.
  6.  
  7. //========================== [ News ] ==========================================
  8. new PlayerText:vida[MAX_PLAYERS];
  9. new PlayerText:colete[MAX_PLAYERS];
  10. new Total[6];
  11. new Total2[6];
  12. forward updatevida(playerid);
  13.  
  14.  
  15. public OnFilterScriptInit()
  16. {
  17. print("FilterScript de mostra vida/colete em números feito por Marllun");
  18. return 1;
  19. }
  20.  
  21.  
  22. public OnPlayerConnect(playerid)
  23. {
  24. vida[playerid] = CreatePlayerTextDraw(playerid,562.000000, 67.000000, " ");
  25. PlayerTextDrawBackgroundColor(playerid,vida[playerid], 255);
  26. PlayerTextDrawFont(playerid,vida[playerid], 1);
  27. PlayerTextDrawLetterSize(playerid,vida[playerid], 0.290000, 0.899999);
  28. PlayerTextDrawColor(playerid,vida[playerid], COR_TEXTDRAW00);
  29. PlayerTextDrawSetOutline(playerid,vida[playerid], 0);
  30. PlayerTextDrawSetProportional(playerid,vida[playerid], 1);
  31. PlayerTextDrawSetShadow(playerid,vida[playerid], 1);
  32. PlayerTextDrawSetString(playerid,vida[playerid],Total);
  33.  
  34. colete[playerid] = CreatePlayerTextDraw(playerid,562.000000, 44.000000, " ");
  35. PlayerTextDrawBackgroundColor(playerid,colete[playerid], 255);
  36. PlayerTextDrawFont(playerid,colete[playerid], 1);
  37. PlayerTextDrawLetterSize(playerid,colete[playerid], 0.290000, 0.899999);
  38. PlayerTextDrawColor(playerid,colete[playerid], COR_TEXTDRAW01);
  39. PlayerTextDrawSetOutline(playerid,colete[playerid], 0);
  40. PlayerTextDrawSetProportional(playerid,colete[playerid], 1);
  41. PlayerTextDrawSetShadow(playerid,colete[playerid], 1);
  42. PlayerTextDrawSetString(playerid,colete[playerid],Total2);
  43. return 1;
  44. }
  45.  
  46. public OnPlayerDisconnect(playerid, reason)
  47. {
  48. PlayerTextDrawHide(playerid,vida[playerid]);
  49. PlayerTextDrawHide(playerid,colete[playerid]);
  50. return 1;
  51. }
  52.  
  53. public OnPlayerSpawn(playerid)
  54. {
  55. PlayerTextDrawShow(playerid,vida[playerid]);
  56. PlayerTextDrawShow(playerid,colete[playerid]);
  57. return 1;
  58. }
  59. public OnPlayerDeath(playerid, killerid, reason)
  60. {
  61. PlayerTextDrawHide(playerid,vida[playerid]);
  62. PlayerTextDrawHide(playerid,colete[playerid]);
  63. return 1;
  64. }
  65.  
  66. public OnPlayerUpdate(playerid)
  67. {
  68. new Float:vida2;
  69. new Float:colete2;
  70. for(new i; i < MAX_PLAYERS; i++)
  71. {
  72. GetPlayerArmour(i,colete2);
  73. if(colete2 < 1) PlayerTextDrawHide(playerid,colete[playerid]);
  74. if(colete2 > 0) PlayerTextDrawShow(playerid,colete[playerid]);
  75. GetPlayerHealth(i,vida2);
  76. format(Total, sizeof(Total), "%0.1f",vida2);
  77. GetPlayerArmour(i,colete2);
  78. format(Total2, sizeof(Total2), "%0.1f",colete2);
  79. //Textdrawstrings
  80. PlayerTextDrawSetString(i,vida[i],Total);
  81. PlayerTextDrawSetString(i,colete[i],Total2);
  82. return 1;
  83. }
  84. return 1;
  85. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement