Raised This Month: $ Target: $400
 0% 

Hitmarker


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
stonedegg
Senior Member
Join Date: Nov 2011
Location: de_dust2
Old 06-02-2012 , 09:41   Hitmarker
Reply With Quote #1

Hello, I made a little and very easy plugin for Eventscripts. It shows a hitmarker when you hit an enemy like in Call of Duty.
Unfortunately, I have no idea of SourceMod scripting, so I open this thread in case someone wants to do it for SourceMod. It was quite easy for Eventscripts, so it should be for SM too.
It's using a texture with r_screenoverlay that I've created.

ES forums link: http://forums.eventscripts.com/viewt...p?f=27&t=45652

Watch the plugin in action: http://www.youtube.com/watch?v=WGBWPvxd4Hk

Last edited by stonedegg; 06-03-2012 at 10:32.
stonedegg is offline
Franc1sco
Veteran Member
Join Date: Oct 2010
Location: Spain (Madrid)
Old 06-03-2012 , 06:04   Re: Hitmarker
Reply With Quote #2

Try this

PHP Code:
#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 String:overlaypath[])
{
    
ClientCommand(client"r_screenoverlay \"%s\""overlaypath);
}

public 
EnDamage(Handle:event, const String:name[], bool:dontBroadcast)
{
        new 
attacker GetClientOfUserId(GetEventInt(event"attacker"));

    if (!
attacker)
        return;

        
ShowOverlayToClient(attacker"overlays/hitmarker/hitmarker");
        
CreateTimer(0.5NoOverlayattacker);


}

public 
Action:NoOverlay(Handle:timerany:client)
{
 if (
IsClientInGame(client))
 {
       
ShowOverlayToClient(client"");
 }

__________________
Veteran Coder -> Activity channel
Coding on CS2 and taking paid and free jobs.

Contact: Steam, Telegram or discord ( franug ).

You like my work? +Rep in my steam profile comments or donate.


Last edited by Franc1sco; 06-03-2012 at 09:28.
Franc1sco is offline
Send a message via MSN to Franc1sco
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 06-03-2012 , 07:05   Re: Hitmarker
Reply With Quote #3

Getclientofuserid -> attacker can be return 0.... world, slayed by one of map triggers...

Last edited by Bacardi; 06-03-2012 at 07:06.
Bacardi is offline
stonedegg
Senior Member
Join Date: Nov 2011
Location: de_dust2
Old 06-03-2012 , 07:31   Re: Hitmarker
Reply With Quote #4

Updated to v1.1.
Shows a hitmarker when you blind an enemy with a flashbang
stonedegg is offline
Franc1sco
Veteran Member
Join Date: Oct 2010
Location: Spain (Madrid)
Old 06-03-2012 , 09:34   Re: Hitmarker
Reply With Quote #5

Quote:
Originally Posted by Bacardi View Post
Getclientofuserid -> attacker can be return 0.... world, slayed by one of map triggers...

I know (you said to me?), however in eventscripts is not normally check it that I remember (and now I wonder why)
__________________
Veteran Coder -> Activity channel
Coding on CS2 and taking paid and free jobs.

Contact: Steam, Telegram or discord ( franug ).

You like my work? +Rep in my steam profile comments or donate.

Franc1sco is offline
Send a message via MSN to Franc1sco
stonedegg
Senior Member
Join Date: Nov 2011
Location: de_dust2
Old 06-03-2012 , 10:34   Re: Hitmarker
Reply With Quote #6

Added a video to see the plugin in action
http://www.youtube.com/watch?v=WGBWPvxd4Hk
stonedegg is offline
Skuzy
Member
Join Date: May 2013
Old 05-17-2013 , 04:43   Re: Hitmarker
Reply With Quote #7

someone can give models of hitmarkers plz?
Skuzy is offline
Franc1sco
Veteran Member
Join Date: Oct 2010
Location: Spain (Madrid)
Old 05-17-2013 , 05:06   Re: Hitmarker
Reply With Quote #8

Quote:
Originally Posted by Skuzy View Post
someone can give models of hitmarkers plz?
Download it in the original plugin post in eventscripts website.

btw, now apparently eventscripts website not work:
Code:
A Database Error Occurred
Unable to connect to your database server using the provided settings.
So be patient


EDIT: now works, download it http://addons.eventscripts.com/addons/view/Hitmarker
__________________
Veteran Coder -> Activity channel
Coding on CS2 and taking paid and free jobs.

Contact: Steam, Telegram or discord ( franug ).

You like my work? +Rep in my steam profile comments or donate.


Last edited by Franc1sco; 05-17-2013 at 05:59.
Franc1sco is offline
Send a message via MSN to Franc1sco
Skuzy
Member
Join Date: May 2013
Old 05-17-2013 , 06:52   Re: Hitmarker
Reply With Quote #9

thx !
Skuzy is offline
Ez_Danny
New Member
Join Date: Aug 2019
Old 05-23-2020 , 18:37   Re: Hitmarker
Reply With Quote #10

Hi,
Franc1sco how put the overlay to the spectaters of attacker too?
Ez_Danny is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:02.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode