Advertisement
Tugamars_PT

Sistema de Show Damage v.1.0 By:Tugamars

Dec 23rd, 2013
683
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #define FILTERSCRIPT
  2.  
  3. #include <a_samp>
  4.  
  5. forward HideDamage(playerid);
  6. forward HideDano(playerid);
  7.  
  8. new PlayerText:Damage[MAX_PLAYERS];
  9. new PlayerText:Dano[MAX_PLAYERS];
  10.  
  11. new TimerDamageTuga[MAX_PLAYERS];
  12. new TimerDanoTuga[MAX_PLAYERS];
  13.  
  14. public OnFilterScriptInit()
  15. {
  16.     print("\n--------------------------------------");
  17.     print("          Sistema de Dano               ");
  18.     print("           By: Tugamars                 ");
  19.     print("--------------------------------------\n");
  20.  
  21.     return 1;
  22. }
  23.  
  24. public OnFilterScriptExit()
  25. {
  26.     print("\n--------------------------------------");
  27.     print("          Sistema de Dano               ");
  28.     print("           By: Tugamars                 ");
  29.     print("--------------------------------------\n");
  30.     return 1;
  31. }
  32.  
  33. public OnPlayerConnect(playerid)
  34. {
  35.  
  36.     TimerDamageTuga[playerid] = -1;
  37.     TimerDanoTuga[playerid] = -1;
  38.  
  39.     Damage[playerid] = CreatePlayerTextDraw(playerid, 308.000000, 172.000000, "");
  40.     PlayerTextDrawBackgroundColor(playerid, Damage[playerid], 255);
  41.     PlayerTextDrawFont(playerid, Damage[playerid], 1);
  42.     PlayerTextDrawLetterSize(playerid, Damage[playerid], 0.500000, 1.300000);
  43.     PlayerTextDrawColor(playerid, Damage[playerid], -1);
  44.     PlayerTextDrawSetOutline(playerid, Damage[playerid], 0);
  45.     PlayerTextDrawSetProportional(playerid, Damage[playerid], 1);
  46.     PlayerTextDrawSetShadow(playerid, Damage[playerid], 1);
  47.     PlayerTextDrawSetSelectable(playerid, Damage[playerid], 0);
  48.  
  49.     Dano[playerid] = CreatePlayerTextDraw(playerid, 455.000000, 26.000000, "");
  50.     PlayerTextDrawBackgroundColor(playerid, Dano[playerid], 255);
  51.     PlayerTextDrawFont(playerid, Dano[playerid], 1);
  52.     PlayerTextDrawLetterSize(playerid, Dano[playerid], 0.500000, 1.300000);
  53.     PlayerTextDrawColor(playerid, Dano[playerid], -1);
  54.     PlayerTextDrawSetOutline(playerid, Dano[playerid], 0);
  55.     PlayerTextDrawSetProportional(playerid, Dano[playerid], 1);
  56.     PlayerTextDrawSetShadow(playerid, Dano[playerid], 0xFFFFFFFF);
  57.  
  58.     return 1;
  59. }
  60.  
  61. public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
  62. {
  63.     new damage[128];
  64.     format(damage, sizeof(damage), "%.0f", amount);
  65.  
  66.     PlayerTextDrawSetString(playerid, Damage[playerid], damage);
  67.  
  68.     PlayerTextDrawShow(playerid, Damage[playerid]);
  69.  
  70.     if(TimerDamageTuga[playerid] != -1)
  71.      {
  72.      TimerDamageTuga[playerid] = SetTimerEx("HideDamage", 5000, false, "n", playerid);
  73.      }
  74.  
  75.     return 1;
  76. }
  77. public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
  78. {
  79.     new damage[128];
  80.     format(damage, sizeof(damage), "-%.0f", amount);
  81.  
  82.     PlayerTextDrawSetString(playerid, Dano[playerid], damage);
  83.    
  84.     PlayerTextDrawShow(playerid, Dano[playerid]);
  85.    
  86.     if(TimerDanoTuga[playerid] != -1)
  87.      {
  88.      TimerDanoTuga[playerid] = SetTimerEx("HideDano", 5000, false, "n", playerid);
  89.      }
  90.     return 1;
  91. }
  92.  
  93. public HideDamage(playerid)
  94. {
  95.     PlayerTextDrawSetString(playerid, Damage[playerid], "");
  96.     TimerDamageTuga[playerid] = -1;
  97.     return 1;
  98. }
  99. public HideDano(playerid)
  100. {
  101.     PlayerTextDrawSetString(playerid, Dano[playerid], "");
  102.     TimerDanoTuga[playerid] = -1;
  103.     return 1;
  104. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement