This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

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


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ForeskinJohn
Junior Member
Join Date: Apr 2020
Old 05-01-2020 , 05:20   Re: COD: HitMarkers v1.6 [Updated 07/04/2020]
Reply With Quote #1

Could it perhaps just not be compatible with bots? or yapb at least? ive tried just about everything, if not its no biggie though, hit markers can be a little cheaty when wallbanging imo anyways
ForeskinJohn is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 05-01-2020 , 06:25   Re: COD: HitMarkers v1.6 [Updated 07/04/2020]
Reply With Quote #2

Quote:
Originally Posted by ForeskinJohn View Post
Could it perhaps just not be compatible with bots? if not its no biggie though
Here you go
PHP Code:
/* Plugin generated by AMXX-Studio */


/* Credits:
    - DJEarthQuake aka SPiNX: random symbol & rainbow color idea.
    - Bugsy: Thanks for showing me how to use bitsums, comes in very handy & optimizing my code alot.
    - HamletEagle: Thanks for helping me out with the snipers cvar.
    - WarrioR: For delivering me the hitmarker sound.
*/

#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>

#define iRainbow random_num(10, 255)
#define TASKID 85621

#pragma semicolon 1

// pCvars
new pPlugin;
new 
pRainbow;
new 
pRandomHitmarkers;
new 
pSnipersOnly;
new 
pSounds;
new 
pSymbol;
new 
pColorRed;
new 
pColorGreen;
new 
pColorBlue;
new 
pXPosition;
new 
pYPosition;
new 
pHoldTime;
new 
pDeadHitMarker;
new 
pDeadColorRed;
new 
pDeadColorGreen;
new 
pDeadColorBlue;

new const 
szSymbols[][] =
{
    
"-",
    
"\",
    "
|",
    "
/",
    "
*",
    "
+",
    "
x"
};

new const szVersion[] = "
1.6";
new const szSound[] = "
hitmarkers/hitmarkers.wav";

new gWeaponList = (1 << CSW_SCOUT) | (1 << CSW_AWP) | (1 << CSW_SG550) | (1 << CSW_G3SG1);

public plugin_init()
{
    register_plugin("
CODHitMarkers", szVersion, "NapoleoN#");

    
RegisterHam(Ham_TakeDamage"player""PostTakeDamage"1);

    
pPlugin =                 register_cvar("amx_hitmarkers""1"); // Enables/disables plugin
    
pRainbow =                 register_cvar("amx_hmrainbow""1"); // Enables/disables random colors on every hit.
    
pRandomHitmarkers =     register_cvar("amx_hmrandom""1"); //Enables/disables random hit markers.
    
pSnipersOnly =            register_cvar("amx_hmsnipers""1"); // Enables/disables hitmarkers on snipers only.
    
pSounds =                 register_cvar("amx_hmsounds""1"); // Enables/disables hitmarker sound on hit.
    
pSymbol =                 register_cvar("amx_hmsymbol""x"); // Sets the symbol of the hitmarker (only works when amx_hmrandom "0")
    
pColorRed =                register_cvar("amx_hmrcolor""165"); // RGB - Red (This won't work when amx_hmrainbow = 1)
    
pColorGreen =            register_cvar("amx_hmgcolor""165"); // RGB - Green (This won't work when amx_hmrainbow = 1)
    
pColorBlue =            register_cvar("amx_hmbcolor""165"); // RGB - Blue (This won't work when amx_hmrainbow = 1)
    
pDeadHitMarker =         register_cvar("amx_hmdead""1"); // Sets a different color when victim died.
    
pDeadColorRed =         register_cvar("amx_hmdeadrcolor""255"); // RGB Dead - Red
    
pDeadColorGreen =         register_cvar("amx_hmdeadgcolor""0"); // RGB Dead - Green
    
pDeadColorBlue =         register_cvar("amx_hmdeadbcolor""0"); // RGB Dead - Blue
    
pXPosition =             register_cvar("amx_hmxpos""-1.0"); // x pos
    
pYPosition =             register_cvar("amx_hmypos""-1.0"); // y pos
    
pHoldTime =             register_cvar("amx_hmholdtime""0.5"); // hud hold time
}

public 
plugin_precache()
{
    
precache_sound(szSound);
}

#if AMXX_VERSION_NUM < 190
public client_disconnect(id)
#else
public client_disconnected(id)
#endif
{
    if(
task_exists(id TASKID))
    {
        
remove_task(id TASKID);
    }
}

public 
PostTakeDamage(iVictimiInflictoriAttackerFloat:iDamageiDamagebits)
{
    if(
get_pcvar_num(pPlugin) && is_user_connected(iAttacker) && (get_user_team(iVictim) != get_user_team(iAttacker)) && !is_user_bot(iVictim))
    {
        new 
bool:bShowHitMarker;

        if(
get_pcvar_num(pSnipersOnly))
        {
            if(
gWeaponList & (<< get_user_weapon(iAttacker)))
            {
                
bShowHitMarker true;
            }
        }

        else
        {
            
bShowHitMarker true;
        }

        if(
bShowHitMarker)
        {
            new 
isVictimAlive is_user_alive(iVictim);

            new 
iRediGreeniBlueszSymbol[2];
            
get_pcvar_string(pSymbolszSymbolcharsmax(szSymbol));

            if(
isVictimAlive)
            {
                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);
                }
            }

            else if(!
isVictimAlive && get_pcvar_num(pDeadHitMarker))
            {
                
iRed get_pcvar_num(pDeadColorRed);
                
iGreen get_pcvar_num(pDeadColorGreen);
                
iBlue get_pcvar_num(pDeadColorBlue);
            }

            
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))] : szSymbol);

            if(
get_pcvar_num(pSounds))
            {
                
set_task(0.110"PlaySound"iAttacker TASKID);
            }
        }
    }
}

public 
PlaySound(iAttacker)
{
    
iAttacker -= TASKID;
    
client_cmd(iAttacker"spk %s"szSound);

Quote:
Originally Posted by ForeskinJohn View Post
hit markers can be a little cheaty when wallbanging imo anyways
That's how it is in COD.
__________________
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 13:36.


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