Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2020
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. #pragma semicolon 1
  2. #include <sourcemod>
  3. #include <sdktools>
  4.  
  5.  
  6. public OnPluginStart()
  7. {
  8. HookEvent("player_hurt", EnDamage);
  9. }
  10.  
  11. public OnConfigsExecuted()
  12. {
  13. PrecacheDecal("overlays/hitmarker/hitmarker.vtf", true);
  14. PrecacheDecal("overlays/hitmarker/hitmarker.vmt", true);
  15.  
  16. AddFileToDownloadsTable("materials/overlays/hitmarker/hitmarker.vtf");
  17. AddFileToDownloadsTable("materials/overlays/hitmarker/hitmarker.vmt");
  18. }
  19.  
  20. ShowOverlayToClient(client, const char overlaypath[])
  21. {
  22. ClientCommand(client, "r_screenoverlay \"%s\"", overlaypath);
  23. }
  24.  
  25. public EnDamage(Handle event, const char name[], bool dontBroadcast)
  26. {
  27. int attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
  28.  
  29. if (!attacker)
  30. return;
  31.  
  32. ShowOverlayToClient(attacker, "overlays/hitmarker/hitmarker");
  33. CreateTimer(0.5, NoOverlay, attacker);
  34.  
  35.  
  36. }
  37.  
  38. public Action NoOverlay(Handle timer, any:client)
  39. {
  40. if (IsClientInGame(client))
  41. {
  42. ShowOverlayToClient(client, "");
  43. }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement