Raised This Month: $ Target: $400
 0% 

[Request] Hitmarker when hitting an enemy.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Limesays
Junior Member
Join Date: Apr 2010
Old 11-06-2012 , 10:58   [Request] Hitmarker when hitting an enemy.
Reply With Quote #1

Hello fellow Allied Modders,

I would like the request a "Hitmarker Plugin" for counter-strike 1.6 / condition-zero.
I do not want the hitmarker to show the damage done to the enemy, just simply appear when you hit someone head on or behind a wall etc and make a "BUMP" sound just like in call of duty: modern warfare 2.

Hitmarker Example:

Code:
http://t2ak.roblox.com/9746e57f394d14c71c1496feed27d743
Yes, I have already searched the forum and the only post I have found containing Hitmarker was a full Modern Warfare 2 mod, which I do not want.

Thanks in Advance guys.

Last edited by Limesays; 11-06-2012 at 16:16.
Limesays is offline
pokemonmaster
princess milk
Join Date: Nov 2010
Location: Somewhere in this world
Old 11-07-2012 , 07:35   Re: [Request] Hitmarker when hitting an enemy.
Reply With Quote #2

Try this

PHP Code:
#include <amxmodx>

public plugin_init()
    
register_event("Damage""eDamage""b""2>0")

public 
eDamage(id)
{
    new 
iAttacker get_user_attacker(id)
    
    if(!
iAttacker)
        return;
    
    
set_hudmessage(85255255, -1.0, -1.006.00.1)
    
show_hudmessage(iAttacker"x")

__________________
اَشْهَدُ اَنْ لَّآ اِلٰهَ اِلَّا اللہُ وَحْدَه لَا شَرِيْكَ لَه وَ اَشْهَدُ اَنَّ مُحَمَّدًا عَبْدُه وَرَسُوْلُه
No longer active in AMXX. Sorry.
pokemonmaster is offline
Limesays
Junior Member
Join Date: Apr 2010
Old 11-07-2012 , 08:18   Re: [Request] Hitmarker when hitting an enemy.
Reply With Quote #3

I appreciate your work a lot pokemonmaster, the code compiled perfectly but unfortunatly I am not at my home computer to test this out.

@pokemonmaster: Could you also add this bullet hit sound for when a target gets hit and the hitmarker shows up?

Code:
http://www.mediafire.com/?ruvhyw8bwlueyj7
@everyone else: Could someone be so kind to test this code for me, I would really appreciate it!
Limesays is offline
pokemonmaster
princess milk
Join Date: Nov 2010
Location: Somewhere in this world
Old 11-07-2012 , 08:54   Re: [Request] Hitmarker when hitting an enemy.
Reply With Quote #4

Tested and worked .. Also I added the sound, but its too short to be heard ...
(Put the sound in sound folder)



PHP Code:
#include <amxmodx>

#define BIGGER_X
#if defined BIGGER_X
    #include <dhudmessage>
#endif


public plugin_precache()
    
precache_sound("bullet_hit_2.wav")

public 
plugin_init() 
    
register_event("Damage""eDamage""b""2>0"

public 
eDamage(id

    new 
iAttacker get_user_attacker(id
    
    if(!
iAttacker
        return; 
        
    if(
is_user_bot(id))
        return;
        
    
#if defined BIGGER_X
    
set_dhudmessage(85255255, -1.0, -1.006.01.0
    
show_dhudmessage(iAttacker"x")
    
#else
    
set_hudmessage(85255255, -1.0, -1.006.01.0
    
show_hudmessage(iAttacker"x")
    
#endif
    
    
client_cmd(id"spk ^"bullet_hit_2^"")

Attached Files
File Type: inc dhudmessage.inc (3.4 KB, 722 views)
__________________
اَشْهَدُ اَنْ لَّآ اِلٰهَ اِلَّا اللہُ وَحْدَه لَا شَرِيْكَ لَه وَ اَشْهَدُ اَنَّ مُحَمَّدًا عَبْدُه وَرَسُوْلُه
No longer active in AMXX. Sorry.

Last edited by pokemonmaster; 11-07-2012 at 09:05.
pokemonmaster is offline
Limesays
Junior Member
Join Date: Apr 2010
Old 11-07-2012 , 09:58   Re: [Request] Hitmarker when hitting an enemy.
Reply With Quote #5

Thank you so much for testing it for me and adding the sound. I understand that the sound is too short but doesn't the sound come everytime you hit the target? For example, if I hit a target 3 times, does the bullet_hit_2 sound play 3 times or just once? Again thank you pokemonmaster!
Limesays is offline
Torge
Veteran Member
Join Date: Oct 2011
Old 11-07-2012 , 10:38   Re: [Request] Hitmarker when hitting an enemy.
Reply With Quote #6

Nice idea

But isn't Ham_TakeDamage better than event damage ?
Torge is offline
pokemonmaster
princess milk
Join Date: Nov 2010
Location: Somewhere in this world
Old 11-07-2012 , 11:37   Re: [Request] Hitmarker when hitting an enemy.
Reply With Quote #7

Quote:
Originally Posted by Limesays
I understand that the sound is too short but doesn't the sound come everytime you hit the target?
It plays each time you hit a target, but I couldn't hear it, it was too low, or my headphones sucks.
Also, yes it does show the hitmarker when you damage through wall, but, I didn't test it with ham version. (It may be better, I don't really know)

Quote:
Originally Posted by Torge View Post
Nice idea

But isn't Ham_TakeDamage better than event damage ?
I really don't know if ham is better, but I guess yes it is better so here is the ham version

Spoiler
__________________
اَشْهَدُ اَنْ لَّآ اِلٰهَ اِلَّا اللہُ وَحْدَه لَا شَرِيْكَ لَه وَ اَشْهَدُ اَنَّ مُحَمَّدًا عَبْدُه وَرَسُوْلُه
No longer active in AMXX. Sorry.

Last edited by pokemonmaster; 11-07-2012 at 12:31.
pokemonmaster is offline
Limesays
Junior Member
Join Date: Apr 2010
Old 11-07-2012 , 12:33   Re: [Request] Hitmarker when hitting an enemy.
Reply With Quote #8

Thanks a lot Pokemonmaster!
Limesays is offline
MineMan9810
New Member
Join Date: Dec 2017
Old 12-27-2017 , 14:28   Re: [Request] Hitmarker when hitting an enemy.
Reply With Quote #9

Where do I put this code? I am new to coding/modding and I dont know where to put this code. Sorry, but thanks!
MineMan9810 is offline
ticking like a metronome
Junior Member
Join Date: Sep 2017
Old 12-27-2017 , 16:52   Re: [Request] Hitmarker when hitting an enemy.
Reply With Quote #10

Quote:
Originally Posted by MineMan9810 View Post
Where do I put this code? I am new to coding/modding and I dont know where to put this code. Sorry, but thanks!
  • Download a compiler (amxxpc.exe) (it comes with the AmxModX installation);
  • Save the code as .sma and drag it over amxxpc.exe.

Alternatively, start AMX Mod X Studio, configure it and compile the .sma file from there.
ticking like a metronome 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 16:55.


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