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

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


Post New Thread Reply   
 
Thread Tools Display Modes
iclassdon
AlliedModders Donor
Join Date: May 2006
Old 01-21-2020 , 00:17   Re: COD: HitMarkers [First release: 16/01/2020]
Reply With Quote #31

Thank you for the sniper edition. It's awesome.
iclassdon is offline
Send a message via MSN to iclassdon
41aaa41
Member
Join Date: Aug 2011
Location: KOCAELİ / TURKEY
Old 01-21-2020 , 04:11   Re: COD: HitMarkers [First release: 16/01/2020]
Reply With Quote #32

Quote:
Originally Posted by Napoleon_be View Post
Call of Duty: HitMarkers

Description.
  • A simple plugin displaying a symbol inside your crosshair everytime you hit an enemy, just like in Call of Duty. Made this plugin since there aren't any of this kind yet. I have published 2 versions, 1 that works with all guns and 1 that only works with sniper rifles.

Plugin Cvars.
  • The whole hitmarker has a bunch of settings that can be changed by cvars, listed below

Code:
amx_hitmarkers "1" - Enables/disables the plugin.
amx_hmrainbow "1" - Enables/disables rainbow colors.
amx_hmrandom "1" - Enables/disables random hitmarker symbols.
amx_hmrcolor "165" - Sets the RGB Red code. (This won't work when amx_hmrainbow = 1)
amx_hmgcolor "165" - Sets the RGB Green code. (This won't work when amx_hmrainbow = 1)
amx_hmbcolor "165" - Sets the RGB Blue code. (This won't work when amx_hmrainbow = 1)
amx_hmxpos "-1.0" - Sets the x position.
amx_hmypos "-1.0" - Sets the y position.
amx_hmholdtime "0.5" - Sets the holdtime of the hitmarker
Hitmarker Symbols.
  • When amx_hmrandom is "1", a random symbol will be picked to display inside your crosshair. When it's "0", a simple "x" will be displayed.
Code:
  • "-"
  • "\"
  • "|"
  • "/"
  • "*"
  • "+"
  • "x"
Updates.
Code:
  • 1.0: First release
  • 1.1: Implented DJEarthQuake's idea
    • Added rainbow colors + cvars
    • Added random symbols + cvars
  • 1.2: Released a version which only works for Sniper rifles.
Credits.
  • DJEarthQuake: random color & random symbol idea.
  • Bugsy: Thanks for showing me how to use bitsums, comes in very handy.

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.

Please, if any bugs occure, let me know. Suggestions and improvements are always welcome too.
hello sir
Can you add pictures about the plugin?
41aaa41 is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 01-21-2020 , 06:33   Re: COD: HitMarkers [First release: 16/01/2020]
Reply With Quote #33

Okay, so i've updated my plugin and adjusted everything nessecary to optimize, and get the sniper cvar to work.

@HamletEagle - Thanks for showing me on how to get that cvar fixed, should've thought about using a bool for that.
@Bugsy - Thanks for optimizing my code a lot. I see what you've done and i understand the whole thing. My problem is that i just keep on writing and when my code is done, i start thinking about optimizations. Allthough not the way you do.
@iclassdon - I would suggest using my updated version of the plugin. There's a new cvar called "amx_hmsnipers" which allow you to enable/disable snipers only.
@41aaa41 - I will add pictures when i get back home from work, won't be any time soon though. I'd say, test it out and see for yourself

Again thanks for all the help, much appreciated.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Midnight Kid
Member
Join Date: Aug 2017
Location: Chornobay, Ukraine
Old 01-21-2020 , 06:38   Re: COD: HitMarkers [First release: 16/01/2020]
Reply With Quote #34

Yeah, that's it. I've taken this.
Thanks, Napoleon_be.

Last edited by Midnight Kid; 01-21-2020 at 06:39.
Midnight Kid is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 01-21-2020 , 08:59   Re: COD: HitMarkers [First release: 16/01/2020]
Reply With Quote #35

Quote:
Originally Posted by Napoleon_be View Post
cvars are there to be changed immediatly, i won't be changing my code which will lead the plugin to require a map change in order for the cvars to change, even though that would optimize my code.
1 script again nice. It looks a lot cleaner. How many times do you predict admins to change the cvars per map?

Quote:
new gWeaponList = (1 << CSW_SCOUT) | (1 << CSW_AWP) | (1 << CSW_SG550) | (1 << CSW_G3SG1)
Code:
    if (get_pcvar_num(g_cvar_iHitSym) == 1 && CSW_ALL_SNIPERRIFLES & (1 << get_user_weapon(iInflictor)) ||

What is wrong with CSW_ALL_SNIPERRIFLES or Inflictor? gWeaponList is already defined with CSW_ALL_SNIPERRIFLES in cstrike_const.inc.

Code:
const CSW_ALL_SNIPERRIFLES = (1<<CSW_SCOUT | 1<<CSW_AWP   | 1<<CSW_G3SG1   | 1<<CSW_SG550);

Starting the color wheel at 10 instead of 0? It does not cause transparency. That's what alpha does. RGB all zeros is black.

Also I donated a matrices so if you want a 'spinner' for counter-strike it is there instead of this overly basic set of symbols that I only use on mods that cannot support real symbols like Counter-Strike.

I tested it last night. These are symbols off my weather plugin that were there for future use. Thank you again for sharing your X script as this was so much more fun than checking the weather!!
__________________
DJEarthQuake is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-21-2020 , 09:17   Re: COD: HitMarkers [First release: 16/01/2020]
Reply With Quote #36

Quote:
Originally Posted by DJEarthQuake View Post
What is wrong with CSW_ALL_SNIPERRIFLES or Inflictor? gWeaponList is already defined with CSW_ALL_SNIPERRIFLES in cstrike_const.inc.
What's wrong is that these constants are defined in 1.9 and not available in 1.8.2.

Quote:
Originally Posted by DJEarthQuake View Post
Starting the color wheel at 10 instead of 0? It does not cause transparency. That's what alpha does. RGB all zeros is black.
There are no black HUD messages in CS. All zeros is completely invisible.
__________________

Last edited by OciXCrom; 01-21-2020 at 09:17.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 01-21-2020 , 16:59   Re: COD: HitMarkers [First release: 16/01/2020]
Reply With Quote #37

Quote:
Originally Posted by DJEarthQuake View Post
1 script again nice. It looks a lot cleaner. How many times do you predict admins to change the cvars per map?
I don't think about that, i think about the efficiency of the plugin. cvars changing immediatly are way more efficient.

Quote:
Originally Posted by DJEarthQuake View Post
What is wrong with CSW_ALL_SNIPERRIFLES or Inflictor? gWeaponList is already defined with CSW_ALL_SNIPERRIFLES in cstrike_const.inc.
What Ocixcrom said.

Quote:
Originally Posted by DJEarthQuake View Post
Starting the color wheel at 10 instead of 0? It does not cause transparency. That's what alpha does. RGB all zeros is black.
Also what ocixcrom said. I've mentioned this earlier when all 3 colorcodes are 0, the hudmessage will be transparent and unable to be seen.

Quote:
Originally Posted by DJEarthQuake View Post
Also I donated a matrices so if you want a 'spinner' for counter-strike it is there instead of this overly basic set of symbols that I only use on mods that cannot support real symbols like Counter-Strike.

I tested it last night. These are symbols off my weather plugin that were there for future use. Thank you again for sharing your X script as this was so much more fun than checking the weather!!
I won't be using those symbols, my only purpose was showing an x and this plugin has transformed in something bigger than that already. Thanks for the feedback though
__________________

Last edited by Napoleon_be; 01-21-2020 at 17:04.
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 01-21-2020 , 18:10   Re: COD: HitMarkers [First release: 16/01/2020]
Reply With Quote #38

Not a functional improvement but you can reduce code:
PHP Code:
public PostTakeDamage(iVictimiInflictoriAttackerFloat:iDamageiDamagebits)
{
    new 
iRediGreeniBlue;
    
    if(
get_pcvar_num(pPlugin) && is_user_connected(iAttacker) && (get_user_team(iVictim) != get_user_team(iAttacker)))
    {
        new 
iSnipersOnly get_pcvar_num(pSnipersOnly);

        if( ( 
iSnipersOnly && ( gWeaponList & (<< get_user_weapon(iAttacker))) ) || !iSnipersOnly )
        {
            if(
get_pcvar_num(pRainbow))
            {
                
iRed iRainbow;
                
iGreen iRainbow;
                
iBlue iRainbow;
            }
            else
            {
                
iRed get_pcvar_num(pColorRed);
                
iGreen get_pcvar_num(pColorGreen);
                
iBlue get_pcvar_num(pColorBlue);
            }
        
            
set_hudmessage(iRediGreeniBlueget_pcvar_float(pXPosition), get_pcvar_float(pYPosition) , 02.0get_pcvar_float(pHoldTime) , 0.00.0, -1);
            
show_hudmessage(iAttacker"%s" get_pcvar_num(pRandomHitmarkers) ? szSymbols[random(sizeof(szSymbols))] : "x");
        }
    }

__________________

Last edited by Bugsy; 01-21-2020 at 18:11.
Bugsy is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 01-21-2020 , 18:21   Re: COD: HitMarkers [First release: 16/01/2020]
Reply With Quote #39

Quote:
Originally Posted by Bugsy View Post
Not a functional improvement but you can reduce code:
PHP Code:
public PostTakeDamage(iVictimiInflictoriAttackerFloat:iDamageiDamagebits)
{
    new 
iRediGreeniBlue;
    
    if(
get_pcvar_num(pPlugin) && is_user_connected(iAttacker) && (get_user_team(iVictim) != get_user_team(iAttacker)))
    {
        new 
iSnipersOnly get_pcvar_num(pSnipersOnly);

        if( ( 
iSnipersOnly && ( gWeaponList & (<< get_user_weapon(iAttacker))) ) || !iSnipersOnly )
        {
            if(
get_pcvar_num(pRainbow))
            {
                
iRed iRainbow;
                
iGreen iRainbow;
                
iBlue iRainbow;
            }
            else
            {
                
iRed get_pcvar_num(pColorRed);
                
iGreen get_pcvar_num(pColorGreen);
                
iBlue get_pcvar_num(pColorBlue);
            }
        
            
set_hudmessage(iRediGreeniBlueget_pcvar_float(pXPosition), get_pcvar_float(pYPosition) , 02.0get_pcvar_float(pHoldTime) , 0.00.0, -1);
            
show_hudmessage(iAttacker"%s" get_pcvar_num(pRandomHitmarkers) ? szSymbols[random(sizeof(szSymbols))] : "x");
        }
    }

Seriously you're a god, i would've never thought of using it that way. But should i use it? I mean my plugin wouldn't be my plugin anymore if i just use codes that get posted here. I would just be copying..
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 01-21-2020 , 18:35   Re: COD: HitMarkers [First release: 16/01/2020]
Reply With Quote #40

It's still your plugin logic/flow, all I am doing is shortening the amount of code/redundancy.
__________________
Bugsy is offline
Old 01-21-2020, 19:23
Napoleon_be
This message has been deleted by Napoleon_be.
Reply


Thread Tools
Display Modes

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 09:31.


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