Advertisement
Yton

Untitled

Aug 16th, 2015
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.36 KB | None | 0 0
  1. #include <a_samp>
  2. #include <YSI\y_hooks>
  3. #include <dini>
  4. #include <zcmd>
  5.  
  6. new skaicius[MAX_PLAYERS];
  7. new Text:horTD[3];
  8.  
  9.  
  10. hook OnGameModeInit(playerid)
  11. {
  12. /* Horizontalaus textdraw'o juodas box'as*/
  13. horTD[0] = TextDrawCreate(430.000000, 210.000000, "horizantalus-1");
  14. TextDrawFont(horTD[0], 1);
  15. TextDrawLetterSize(horTD[0], 0.000000, 1.000000);
  16. TextDrawUseBox(horTD[0], 1);
  17. TextDrawBoxColor(horTD[0], 255);
  18. TextDrawTextSize(horTD[0], 526.000000, 0.000000);
  19.  
  20. /* Horizontalaus textdraw'o tamsus raduonas box'as*/
  21. horTD[1] = TextDrawCreate(431.000000, 211.000000, "horizontalus-2");
  22. TextDrawFont(horTD[1], 1);
  23. TextDrawLetterSize(horTD[1], 0.000000, 0.799999);
  24. TextDrawUseBox(horTD[1], 1);
  25. TextDrawBoxColor(horTD[1], 0x5a0c0eFF);
  26. TextDrawTextSize(horTD[1], 525.000000, 0.000000);
  27.  
  28. /* Horizontalaus textdraw'o raduonas box'as - progressbar'as */
  29. horTD[2] = TextDrawCreate(431.000000, 211.000000, "horizantalus-3");
  30. TextDrawFont(horTD[2], 1);
  31. TextDrawLetterSize(horTD[2], 0.000000, 0.799999);
  32. TextDrawUseBox(horTD[2], 1);
  33. TextDrawBoxColor(horTD[2], 0xb4191dFF);
  34. TextDrawTextSize(horTD[2], 476.000000, 0.000000);
  35. return 1;
  36. }
  37.  
  38. stock baras(playerid)
  39. {
  40. new Float:amount; // kintamasis į kuri įrašysim rezultatą
  41.  
  42. /* Horizontalus progressbar'as */
  43. amount = (427.0 + (0 * 0.98));
  44. TextDrawTextSize(horTD[2], amount, 0.0);
  45. TextDrawShowForPlayer(playerid, horTD[2]);
  46. return 1;
  47. }
  48.  
  49. hook OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  50. {
  51. if (newkeys & KEY_SPRINT)
  52. {
  53. TextDrawShowForPlayer(playerid, horTD[2]);
  54. SetTimerEx ( "hideTD" , 1000 , 1 , "i" , playerid );
  55. }
  56. return 1;
  57. }
  58.  
  59. forward hideTD ( playerid );
  60.  
  61. public hideTD ( playerid )
  62. {
  63. skaicius[playerid] += 100;
  64. new string[20];
  65. new Float:amount;
  66.  
  67. TextDrawShowForPlayer(playerid, horTD[2]);
  68. amount = (427.0 + skaicius[playerid] * 0.98);
  69. TextDrawTextSize(horTD[2], amount, 0.0);
  70. TextDrawShowForPlayer(playerid, horTD[2]);
  71. format(string,sizeof(string), "%d", skaicius[playerid]);
  72. TextDrawSetString(horTD[2], string);
  73. {
  74. if(amount == (427.0 + 100 * 0.98)) SendClientMessage(playerid, 0xFFFFFFAA, "{E74C3C}progressbaras pilnas:");
  75. }
  76. }
  77.  
  78.  
  79. CMD:asd( playerid, params[] )
  80. {
  81. baras(playerid);
  82. TextDrawShowForPlayer(playerid, horTD[0]);
  83. TextDrawShowForPlayer(playerid, horTD[1]);
  84. TextDrawShowForPlayer(playerid, horTD[2]);
  85. return 1;
  86. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement