Raised This Month: $319 Target: $400
 79%   Almost there!

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


Post New Thread Reply   
 
Thread Tools Display Modes
+ARUKARI-
AlliedModders Donor
Join Date: Jul 2004
Location: Japan
Old 04-12-2020 , 05:18   Re: COD: HitMarkers v1.6 [Updated 07/04/2020]
Reply With Quote #61

Let's challenge.
Try to combine Cvar of color setting into one.

(This plugin working on my server.)
__________________

Last edited by +ARUKARI-; 04-12-2020 at 05:19.
+ARUKARI- is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 04-12-2020 , 06:50   Re: COD: HitMarkers v1.6 [Updated 07/04/2020]
Reply With Quote #62

Quote:
Originally Posted by +ARUKARI- View Post
Let's challenge.
Try to combine Cvar of color setting into one.

(This plugin working on my server.)
Currently working on something else, but i'll take that challange, this will be updated in the future
__________________
My Plugins:


Accepting private projects.
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
ForeskinJohn
Junior Member
Join Date: Apr 2020
Old 04-22-2020 , 18:56   Re: COD: HitMarkers v1.6 [Updated 07/04/2020]
Reply With Quote #63

This doesn't seem to work for me, im not sure why, because all of my cvar's are showing up to autocomplete when i type them, furthermore, im sure i have it enabled. is it possible that my custom weapon pack could be interfering with this plugin?
ForeskinJohn is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 04-23-2020 , 08:57   Re: COD: HitMarkers v1.6 [Updated 07/04/2020]
Reply With Quote #64

Quote:
Originally Posted by ForeskinJohn View Post
This doesn't seem to work for me, im not sure why, because all of my cvar's are showing up to autocomplete when i type them, furthermore, im sure i have it enabled. is it possible that my custom weapon pack could be interfering with this plugin?
I'm not sure, you could try to disable all plugins one by one untill my plugin starts working, then you know what plugin is causing you trouble. A second option would be to try and put my plugin at the bottom of your plugins.ini file. Not sure if the second method would help though, but it's worth a try.
__________________
My Plugins:


Accepting private projects.

Last edited by Napoleon_be; 04-23-2020 at 08:57.
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
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 #65

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 #66

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.
__________________
My Plugins:


Accepting private projects.
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Midnight Kid
Junior Member
Join Date: Aug 2017
Location: Chornobay, Ukraine
Old 05-01-2020 , 08:11   Re: COD: HitMarkers v1.6 [Updated 07/04/2020]
Reply With Quote #67

Z-bots don't need a parser in AMXX 1.8.3+. But it would be announced in 1.8.2 and less.
(Unless, of course, this was discussed above.)

Take a script with a parser.
Attached Files
File Type: sma Get Plugin or Get Source (HitMarkers.sma - 67 views - 5.4 KB)

Last edited by Midnight Kid; 06-08-2020 at 16:03.
Midnight Kid is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 05-03-2020 , 12:06   Re: COD: HitMarkers v1.6 [Updated 07/04/2020]
Reply With Quote #68

Quote:
Originally Posted by ForeskinJohn View Post
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
Works on POD and JK_BOTTI as well as HPB.

While YAPB is still being maintained the project has no README and did not give credit to Botman. That speaks volumes!

Quote:
Originally Posted by Midnight Kid View Post
Z-bots don't need a parser in AMXX 1.8.3+. But it would be announced in 1.8.2 and less.
(Unless, of course, this was discussed above.)

Take a script with a parser.
Interesting snippet.
__________________
"It's not the actual programming that's interesting. But it's what you can accomplish with the end results that are important." -Dennis Ritchie
"Mathematics, rightly viewed, possesses not only truth, but supreme beauty a beauty cold and austere, like that of sculpture..." -Bertrand Russell
DJEarthQuake is offline
Midnight Kid
Junior Member
Join Date: Aug 2017
Location: Chornobay, Ukraine
Old 05-04-2020 , 14:47   Re: COD: HitMarkers v1.6 [Updated 07/04/2020]
Reply With Quote #69

Quote:
Originally Posted by DJEarthQuake View Post
Interesting snippet.
I found it here in CSS Flashlight. But it was overloaded with bitsums' code, so the easier version was found in Counter Strike Online: NST and parser was edited a little bit by me.
And in general I use this snippet in all plugins where it's processing data for Z-bots until I'll go to AMXX 1.9+ fully.
Midnight Kid is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 05-04-2020 , 21:03   Re: COD: HitMarkers v1.6 [Updated 07/04/2020]
Reply With Quote #70

@Midnight Kid. You are a gentleman and scholar sharing that much detail. Would something of the sort, similarly make features, possibly work on bot flavors, that do not ordinarily do things, that others can to interface or bridge the gap, so to speak? What I mean... Features that may or may not work on a plethora of bots. For example: parachute or voice synthesis? Just PM me if your off topic meter is buzzing.
__________________
"It's not the actual programming that's interesting. But it's what you can accomplish with the end results that are important." -Dennis Ritchie
"Mathematics, rightly viewed, possesses not only truth, but supreme beauty a beauty cold and austere, like that of sculpture..." -Bertrand Russell
DJEarthQuake is offline
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 07:06.


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