Advertisement
Guest User

dasdas

a guest
Jul 4th, 2015
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.72 KB | None | 0 0
  1.  
  2.  
  3. new Text:healcina[MAX_PLAYERS];
  4. new Text:armorcina[MAX_PLAYERS];
  5.  
  6. public OnGameModeExit();
  7. {
  8. for(new i; i<GetMaxPlayers(); i++)
  9. {
  10. if(IsPlayerConnected(i))
  11. {
  12. TextDrawDestroy(healcina[i]);
  13. TextDrawDestroy(armorcina[i]);
  14. }
  15. }
  16. return 1;
  17. }
  18. public OnPlayerConnect(playerid)
  19. {
  20. healcina[playerid] = TextDrawCreate(566.000000, 67.000000, "100");
  21. TextDrawBackgroundColor(healcina[playerid], 255);
  22. TextDrawFont(healcina[playerid], 1);
  23. TextDrawLetterSize(healcina[playerid], 0.340000, 0.799998);
  24. TextDrawColor(healcina[playerid], -6291201);
  25. TextDrawSetOutline(healcina[playerid], 1);
  26. TextDrawSetProportional(healcina[playerid], 1);
  27.  
  28. armorcina[playerid] = TextDrawCreate(566.000000, 45.000000, "100");
  29. TextDrawBackgroundColor(armorcina[playerid], 255);
  30. TextDrawFont(armorcina[playerid], 1);
  31. TextDrawLetterSize(armorcina[playerid], 0.340000, 0.799998);
  32. TextDrawColor(armorcina[playerid], 1778319615);
  33. TextDrawSetOutline(armorcina[playerid], 1);
  34. TextDrawSetProportional(armorcina[playerid], 1);
  35. }
  36. public OnPlayerDisconnect(playerid, reason)
  37. {
  38. TextDrawDestroy(healcina[playerid]);
  39. TextDrawDestroy(armorcina[playerid]);
  40. }
  41. public OnPlayerSpawn(playerid)
  42. {
  43. TextDrawShowForPlayer(playerid, healcina[playerid]);
  44.  
  45. new Float:pancir;
  46. GetPlayerArmour(playerid, pancir);
  47. if(pancir >= 1) TextDrawShowForPlayer(playerid, armorcina[playerid]);
  48. else TextDrawHideForPlayer(playerid, armorcina[playerid]);
  49. }
  50. public OnPlayerUpdate(playerid)
  51. {
  52. new Float:energija;
  53. new kurbla[15];
  54. GetPlayerHealth(playerid, energija);
  55. format(kurbla, sizeof(HealthNum), "%.0f", energija);
  56. TextDrawSetString(healcina[playerid], kurbla);
  57. TextDrawShowForPlayer(playerid, healcina[playerid]);
  58.  
  59. new Float:Pancir;
  60. GetPlayerArmour(playerid, Pancir);
  61. if(Pancir >= 1)
  62. {
  63. new Pancirkaaa[15];
  64. format(Pancirkaaa, 15, "%.0f", Pancir);
  65. TextDrawSetString(armorcina[playerid], Pancirkaaa);
  66. TextDrawShowForPlayer(playerid, armorcina[playerid]);
  67. }
  68. else
  69. {
  70. TextDrawHideForPlayer(playerid, armorcina[playerid]);
  71. }
  72. return 1;
  73.  
  74. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement