Advertisement
Kuendo

Damage informer System (FS)

Feb 21st, 2020
1,062
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.26 KB | None | 0 0
  1. // Creditos: Kuendo //
  2. //www.facebook.com/brygarciabg
  3. #include <a_samp>
  4.  
  5. #if defined FILTERSCRIPT
  6.  
  7. public OnFilterScriptInit()
  8. {
  9.  
  10.     return 1;
  11. }
  12.  
  13. public OnFilterScriptExit()
  14. {
  15.     return 1;
  16. }
  17.  
  18. #else
  19.  
  20. main()
  21. {
  22.  
  23. }
  24.  
  25. #endif
  26.  
  27. //news
  28. new Text:Agredir[MAX_PLAYERS];
  29. new Text:Agredido[MAX_PLAYERS];
  30.  
  31. public OnGameModeInit()
  32. {
  33.      for(new i; i < MAX_PLAYERS; ++i)
  34.      {
  35.  
  36.         Agredir[i] = TextDrawCreate(570.000000, 320.000000, "-100");
  37.         TextDrawBackgroundColor(Agredir[i], 255);
  38.         TextDrawFont(Agredir[i], 1);
  39.         TextDrawLetterSize(Agredir[i], 0.500000, 1.000000);
  40.         TextDrawColor(Agredir[i], -16776961);
  41.         TextDrawSetOutline(Agredir[i], 0);
  42.         TextDrawSetProportional(Agredir[i], 1);
  43.         TextDrawSetShadow(Agredir[i], 1);
  44.         TextDrawSetSelectable(Agredir[i], 0);
  45.  
  46.         Agredido[i] = TextDrawCreate(566.000000, 310.000000, "+100");
  47.         TextDrawBackgroundColor(Agredido[i], 255);
  48.         TextDrawFont(Agredido[i], 1);
  49.         TextDrawLetterSize(Agredido[i], 0.500000, 1.000000);
  50.         TextDrawColor(Agredido[i], 16711935);
  51.         TextDrawSetOutline(Agredido[i], 0);
  52.         TextDrawSetProportional(Agredido[i], 1);
  53.         TextDrawSetShadow(Agredido[i], 1);
  54.         TextDrawSetSelectable(Agredido[i], 0);
  55.  
  56.      }
  57.  
  58.      return 1;
  59. }
  60.  
  61. public OnGameModeExit()
  62. {
  63.     return 1;
  64. }
  65.  
  66. forward OnPlayerGiveDamage(playerid, damagedid, Float: amount);
  67. public OnPlayerGiveDamage(playerid, damagedid, Float: amount)
  68. {
  69.     new string[50];
  70.     format(string, 50, "~g~+%.0f", amount);
  71.     PlayerPlaySound(playerid, 5205, 0.0, 0.0, 0.0);
  72.     TextDrawSetString(Agredido[playerid], string);
  73.     TextDrawShowForPlayer(playerid, Agredido[playerid]);
  74.     SetTimerEx("RemoveTextDraw", 2000, false, "i", playerid);
  75.     return 1;
  76. }
  77.  
  78. public OnPlayerTakeDamage(playerid, issuerid, Float: amount)
  79. {
  80.     new string[50];
  81.     format(string, 50, "~r~-%.0f", amount);
  82.     TextDrawSetString(Agredir[playerid], string);
  83.     TextDrawShowForPlayer(playerid, Agredir[playerid]);
  84.     SetTimerEx("RemoveTextDraw", 2000, false, "i", playerid);
  85.     return 1;
  86. }
  87.  
  88. forward RemoveTextDraw(playerid);
  89. public RemoveTextDraw(playerid)
  90. {
  91.     TextDrawHideForPlayer(playerid, Agredir[playerid]);
  92.     TextDrawHideForPlayer(playerid, Agredido[playerid]);
  93.     return 1;
  94. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement