Raised This Month: $32 Target: $400
 8% 

COD: HitMarkers v1.7 [Updated April 29th 2021]


Post New Thread Reply   
 
Thread Tools Display Modes
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 01-22-2020 , 11:56   Re: COD: HitMarkers [First release: 16/01/2020]
Reply With Quote #41

Update 1.4: Added a hitmarker sound which can be enabled/disabled with a cvar.

new .sma file uploaded and the sound has been attached to the first post aswell.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 01-24-2020 , 06:00   Re: COD: HitMarkers [First release: 16/01/2020]
Reply With Quote #42

Quote:
For the people who wonder why i didn't make an extra cvar to change the hitmarker symbol, here's the reason. I tried it and tested it out, the problem is that when i use a pcvar for that, the symbol moves to the right and so the position isn't centered anymore.
This seems extremely unlikely/weird. Are you sure you didn't simply have some spaces in the string/cvar value?
Give it a try again and if you can't figure it out post the code here so we can take a look.

PHP Code:
new iRediGreeniBlue
should be moved inside bShowHitMarker check because that's where you need the variables. If one of the 2 checks is false then they are not needed. Try to limit the scope to where the variable is really needed.

PHP Code:
set_task(0.110"PlaySound"iAttacker TASKID); 
Is your intent to slightly delay the sound? Because if you want it to be played at the same time you can simply do:
PHP Code:
PlaySound(iAttacker
I'm asking because the task time seems weird.
__________________

Last edited by HamletEagle; 01-24-2020 at 06:05.
HamletEagle is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 01-24-2020 , 07:54   Re: COD: HitMarkers [First release: 16/01/2020]
Reply With Quote #43

Okay,

1) I have tried it again using a pcvar and eventually it worked, i was probably doing something wrong before like you said.
2) Done
3) I've been testing the sound for over a 100 times and it appears that the gun shots or knife sounds are louder than the .wav file. I've used multiple sound files and tried them all out and i had the same problem with all of them. So then i began searching when was the right time to trigger the sound, and that's the reason i'm using such a weird value.

Thanks for the suggestions and the feedback.

First post and code got updated, new cvar is called amx_hmsymbol "x"
__________________

Last edited by Napoleon_be; 01-24-2020 at 07:54.
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 01-24-2020 , 08:03   Re: COD: HitMarkers [First release: 16/01/2020]
Reply With Quote #44

About 3: whatever, not like it really matters and I don't want to drag this anymore.

I could not find a similar plugin, if anyone can link to an already existing plugin that has more features then I will reconsider, but for now, I'll approve this one.
__________________
HamletEagle is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 01-24-2020 , 08:06   Re: COD: HitMarkers [First release: 16/01/2020]
Reply With Quote #45

Awesome thanks.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
georgik57
Veteran Member
Join Date: Oct 2008
Location: 🎧Music World
Old 01-25-2020 , 12:39   Re: COD: HitMarkers [Last Update: 24/01/2020]
Reply With Quote #46

Add the following check inside the post-damage hook to make sure the damage hasn't been blocked by another plug-in because the forward will still trigger anyway:
PHP Code:
GetHamReturnStatus() != HAM_SUPERCEDE 
__________________
georgik57 is offline
Send a message via MSN to georgik57 Send a message via Yahoo to georgik57 Send a message via Skype™ to georgik57
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 01-25-2020 , 18:25   Re: COD: HitMarkers [Last Update: 24/01/2020]
Reply With Quote #47

Quote:
Originally Posted by georgik57 View Post
Add the following check inside the post-damage hook to make sure the damage hasn't been blocked by another plug-in because the forward will still trigger anyway:
PHP Code:
GetHamReturnStatus() != HAM_SUPERCEDE 
Will wait for an approver or a mod to see if this should be added, thanks for the suggestion.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 01-29-2020 , 11:59   Re: COD: HitMarkers [Last Update: 24/01/2020]
Reply With Quote #48

Okay so a few questions:

1) Should the check that georgik57 gave me get added?
2) I've been suggested to change the hitmarker to be red when the victim is killed. Allthough, if i add this, a lot of cvars should be added too. (Honestly i think that would be too much for a simple plugin like this, but the modifications will be endless imo.)

Cvars that should get added when i do this:
  • amx_hmdead "1" - Will set the red hitmarker enabled/disabled.
  • amx_hmdeadrcolor "255" // Sets the red RGB code for the dead hitmarker.
  • amx_hmdeadgcolor "0" // Sets the green RGB code for the dead hitmarker.
  • amx_hmdeadbcolor "0" // Sets the blue RGB code for the dead hitmarker.

I would like some feedback on this before i add all this.

I have already prepared the code to get updated in case this is a good idea. Code can be found in spoiler
Spoiler


Thanks in advance.
__________________

Last edited by Napoleon_be; 01-29-2020 at 12:08.
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
georgik57
Veteran Member
Join Date: Oct 2008
Location: 🎧Music World
Old 01-29-2020 , 15:54   Re: COD: HitMarkers [Last Update: 24/01/2020]
Reply With Quote #49

Get rid of some cvars by doing the following:

Use amx_hitmarkers as a universal cvar for random, 1 symbol only or to disable the plug-in by using it as a string with the following logic:
amx_hitmarkers set as "-\|/*+x" will choose a random character between those by printing szCVarHitMarkers[random_num(0, strlen(szCVarHitmarkers) - 1)]
amx_hitmarkers set as "" will disable the plug-in.
This way, you've just eliminated the need for amx_hmrandom and amx_hmsymbol and you've added customizability through cvar for the symbols that should be displayed, getting rid of the hardcoded ones.

Use amx_hmsnipers as a cvar for listing the weapons that should be (dis)considered instead of just an integer. Use letters along with read_flags for better readability.
Example: the cvar containing letters "cmsy" will (dis)consider CSW_SCOUT, CSW_SG550, CSW_AWP, CSW_G3SG1 since "c" is the 3rd letter in the alphabet and CSW_SCOUT has ID 3, etc.
PHP Code:
new szHmWeapons[32];
get_pcvar_string(pSnipersOnlyszHmWeaponscharsmax(szHmWeapons))

if (
read_flags(szHmWeapons) & (<< get_user_weapon(iAttacker)))
{
...

Side note: get_user_weapon only returns the weapon the player is currently holding, not the weapon he's done the damage with. So he can do damage with a thrown grenade while holding and AWP and the condition will return true.

Use color cvars do define whether or not to use random colors instead of having a separate cvar for it and it will add the ability to also choose which of the colors to get randomized. Use the following example:
PHP Code:
    set_dhudmessage
    
(
        (
iCVarRed >= 0) ? iCVarRed random_num(-iCVarRed 1255),
        (
iCVarGreen >= 0) ? iCVarGreen random_num(-iCVarGreen 1255),
        (
iCVarBlue >= 0) ? iCVarBlue random_num(-iCVarBlue 1255),
        -
1.00.000.0fCVarInterval + ((fCVarInterval >= 0.2) ? 0.1 0.05), 0.00.0false
    

As for my previous suggestion, try it out yourself. Make a separate plug-in which will block the damage in Ham_TakeDamage Pre and you will see.

PS: You should also cache the string cvars in this case(either per round or once every X seconds), as TakeDamage can be spammed very much.
__________________

Last edited by georgik57; 01-29-2020 at 15:56.
georgik57 is offline
Send a message via MSN to georgik57 Send a message via Yahoo to georgik57 Send a message via Skype™ to georgik57
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 01-30-2020 , 07:18   Re: COD: HitMarkers [Last Update: 24/01/2020]
Reply With Quote #50

1) I will consider using amx_hitmarkers as the universal cvar for this plugin. Seems fair enough to me.
2) Can u explain again what you're trying to do with read_flags() right there? I don't really get it
3) I don't really mind a HE grenade showing a hitmarker as it is also damage done to the victim
4) Won't be using that style, people consider using 255 0 0 to get the red color, the way you're doing it it will always choose a random number if one of the cvars is 0, which is not what we want.
5) I'll take you on your word about the HAM check and add it later on.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
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 00:47.


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