Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma semicolon 1
- #include <sourcemod>
- #include <sdktools>
- public OnPluginStart()
- {
- HookEvent("player_hurt", EnDamage);
- }
- public OnConfigsExecuted()
- {
- PrecacheDecal("overlays/hitmarker/hitmarker.vtf", true);
- PrecacheDecal("overlays/hitmarker/hitmarker.vmt", true);
- AddFileToDownloadsTable("materials/overlays/hitmarker/hitmarker.vtf");
- AddFileToDownloadsTable("materials/overlays/hitmarker/hitmarker.vmt");
- }
- ShowOverlayToClient(client, const char overlaypath[])
- {
- ClientCommand(client, "r_screenoverlay \"%s\"", overlaypath);
- }
- public EnDamage(Handle event, const char name[], bool dontBroadcast)
- {
- int attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
- if (!attacker)
- return;
- ShowOverlayToClient(attacker, "overlays/hitmarker/hitmarker");
- CreateTimer(0.5, NoOverlay, attacker);
- }
- public Action NoOverlay(Handle timer, any:client)
- {
- if (IsClientInGame(client))
- {
- ShowOverlayToClient(client, "");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement