Guest User

Untitled

a guest
May 4th, 2013
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.16 KB | None | 0 0
  1. /*Health , Ime i Pancir by FarkiAS :D
  2. ----------------------------------*/
  3.  
  4.  
  5. //------------------------------------------>>>>
  6. // INCLUDE
  7. //------------------------------------------>>>>
  8. #include <a_samp>
  9. #include <zcmd>
  10. #define PLAYERS 100
  11. //------------------------------------------>>>>
  12. // NEWS
  13. //------------------------------------------>>>>
  14. new Text:ImeIgraca;
  15. new Text:Health;
  16. new Text:Pancir;
  17. new strt[256];
  18. new Float:AR;
  19. new Float:health;
  20. //------------------------------------------>>>>
  21. // FORWARD
  22. //------------------------------------------>>>>
  23. forward prvojerahealtha();
  24. //------------------------------------------>>>>
  25. // PUBLIC
  26. //------------------------------------------>>>>
  27. public OnPlayerConnect(playerid)
  28. {
  29. ImeIgraca = TextDrawCreate(1.000000, 328.000000," ");
  30. TextDrawBackgroundColor(ImeIgraca, 255);
  31. TextDrawFont(ImeIgraca, 2);
  32. TextDrawLetterSize(ImeIgraca, 0.500000, 1.000000);
  33. TextDrawColor(ImeIgraca, -16776961);
  34. TextDrawSetOutline(ImeIgraca, 1);
  35. TextDrawSetProportional(ImeIgraca, 1);
  36.  
  37. Health = TextDrawCreate(1.000000, 311.000000, " ");
  38. TextDrawBackgroundColor(Health, 255);
  39. TextDrawFont(Health, 2);
  40. TextDrawLetterSize(Health, 0.500000, 1.000000);
  41. TextDrawColor(Health, -16776961);
  42. TextDrawSetOutline(Health, 1);
  43. TextDrawSetProportional(Health, 1);
  44.  
  45. Pancir = TextDrawCreate(1.000000, 294.000000, " ");
  46. TextDrawBackgroundColor(Pancir, 255);
  47. TextDrawFont(Pancir, 2);
  48. TextDrawLetterSize(Pancir, 0.500000, 1.000000);
  49. TextDrawColor(Pancir, -16776961);
  50. TextDrawSetOutline(Pancir, 1);
  51. TextDrawSetProportional(Pancir, 1);
  52. return 1;
  53. }
  54. public OnPlayerSpawn(playerid)
  55. {
  56. SetTimer("prvojerahealtha", 1000, 1);
  57. }
  58. public OnPlayerDisconnect(playerid, reason)
  59. {
  60. TextDrawHideForAll(ImeIgraca);
  61. TextDrawHideForAll(Health);
  62. TextDrawHideForAll(Pancir);
  63. return 1;
  64. }
  65. public prvojerahealtha()
  66. {
  67. for(new i=0; i<PLAYERS; i++)
  68. {
  69. GetPlayerHealth(i, health);
  70. GetPlayerArmour(i, AR);
  71. format(strt,sizeof(strt),"HP: ~w~%.1f",health);
  72. TextDrawSetString(Health,strt);
  73. format(strt,sizeof(strt),"Pancir: ~w~%0.1f",AR);
  74. TextDrawSetString(Pancir,strt);
  75. }
  76. return 0;
  77. }
  78. //------------------------------------------>>>>
  79. // COMMANDS
  80. //------------------------------------------>>>>
  81. CMD:tdon(playerid,params[])
  82. {
  83. new name[MAX_PLAYER_NAME];
  84. GetPlayerHealth(playerid, health);
  85. GetPlayerName(playerid,name,sizeof(name));
  86. GetPlayerArmour(playerid, AR);
  87. format(strt,sizeof(strt),"Ime igraca: ~w~%s",name);
  88. TextDrawSetString(ImeIgraca,strt);
  89. format(strt,sizeof(strt),"HP: ~w~%.1f",health);
  90. TextDrawSetString(Health,strt);
  91. format(strt,sizeof(strt),"Pancir: ~w~%0.1f",AR);
  92. TextDrawSetString(Pancir,strt);
  93. TextDrawShowForPlayer(playerid,ImeIgraca);
  94. TextDrawShowForPlayer(playerid,Health);
  95. TextDrawShowForPlayer(playerid,Pancir);
  96. return 1;
  97. }
  98. CMD:tdoff(playerid,params[])
  99. {
  100. TextDrawHideForPlayer(playerid,ImeIgraca);
  101. TextDrawHideForPlayer(playerid,Health);
  102. TextDrawHideForPlayer(playerid,Pancir);
  103. return 1;
  104. }
  105. //-------------------------------------------------->>>>
  106. // KRAJ SKRIPTE :)
  107. //---------------------------------------------------->>>>
Advertisement
Add Comment
Please, Sign In to add comment