GSC Call of Duty 4 GSC Function | Modded Hitmarker by CabCon

CabCon

Head Administrator
Staff member
Head Staff Team
Messages
4,575
Points
828
Hello guys,
today I will share this hitmarker code with you. :grinning: Feel free to use it. It will work for every call of duty!

Function Overview
  • Toggle Hitmarker | Display/Hide Hitmarker ::func_hitmarker
  • Hitmarker Color | Set the Color of the Hitmarker ::func_hitmarker_color
    • Hitmarker Color Loop | Loops the Hitmarker Color with random colors ::func_hitmarker_colorLoop
  • Flashing Hitmarker | The Hitmarker will move over the screen ::func_hitmarker_flashing_pos
    • ::func_hitmarker_pos_flash_animated
    • ::func_hitmarker_distance
    • ::func_hitmarker_speed
  • Reset Everything | Reset ::func_hitmarker_reset

I recommend to use all functions! You can find this function in the Cabepex Menu!

Function Preview

Add Function

Add this code after the player is spawned. This will set the variables for the functions.
Code:
self.var["hitmarker"] = true; 
self.var["hitmarker_pos_flash"] = false;
self.var["hitmarker_pos_flash_distance"] = 20;
self.var["hitmarker_pos_flash_speed"] = .01;
self.var["hitmarker_pos_flash_animated"] = false;
Add the Function Code.

Code:
/////////////////////////////////////////////////////////////////////////////////////////////////////
// HITMARKER / DAMAGEFEEDBACK Options Created by CabCon
/////////////////////////////////////////////////////////////////////////////////////////////////////
func_hitmarker()
{
    if(self.var["hitmarker_pos_flash"] == true)
        self func_hitmarker_flashing_pos();
    if(self.var["hitmarker"] == false || !isDefined(self.var["hitmarker"]) )
    {
        self.hud_damagefeedback.x = -12;
        self.hud_damagefeedback.y = -12;
        self.var["hitmarker"] = true;
        S("Hitmarker ^2ON");
    }
    else
    {
        self.hud_damagefeedback.x = -99999;
        self.hud_damagefeedback.y = -99999;
        self.var["hitmarker"] = false;
        S("Hitmarker ^1OFF");
    }
}
func_hitmarker_flashing_pos()
{
    if(self.var["hitmarker"] == false || !isDefined(self.var["hitmarker"]))
        self func_hitmarker();
    if(self.var["hitmarker_pos_flash"] == false || !isDefined(self.var["hitmarker_pos_flash"]) )
    {
        self.var["hitmarker_pos_flash"] = true;
        self thread func_hitmarker_flashing_pos_func();
        S("Crazy Hitmarker ^2ON");
    }
    else
    {
        self.var["hitmarker_pos_flash"] = false;
        self notify("hitmarker_pos_flash_stop");
        S("Crazy Hitmarker ^1OFF");
    }
}
func_hitmarker_flashing_pos_func()
{
    self endon("hitmarker_pos_flash_stop");
    while(self.var["hitmarker_pos_flash"])
    {
        if(self.var["hitmarker_pos_flash_animated"])
            self.hud_damagefeedback moveovertime(self.var["hitmarker_pos_flash_speed"]);
        self.hud_damagefeedback.x = -12 + randomIntRange(0-self.var["hitmarker_pos_flash_distance"],self.var["hitmarker_pos_flash_distance"]);
        self.hud_damagefeedback.y = -12 + randomIntRange(0-self.var["hitmarker_pos_flash_distance"],self.var["hitmarker_pos_flash_distance"]);
        wait self.var["hitmarker_pos_flash_speed"];
    }
}

func_hitmarker_pos_flash_animated()
{
    if(self.var["hitmarker_pos_flash"] == false || !isDefined(self.var["hitmarker_pos_flash"]) )
        S("You need to ^2enable^7 Crazy Hitmarker to see which effect this action have.");
    self.var["hitmarker_pos_flash_animated"] = !self.var["hitmarker_pos_flash_animated"];
}
func_hitmarker_distance(i)
{
    if(self.var["hitmarker_pos_flash"] == false || !isDefined(self.var["hitmarker_pos_flash"]) )
        S("You need to ^2enable^7 Crazy Hitmarker to see which effect this action have.");
    self.var["hitmarker_pos_flash_distance"] = i;
}
func_hitmarker_speed(i)
{
    if(self.var["hitmarker_pos_flash"] == false || !isDefined(self.var["hitmarker_pos_flash"]) )
        S("You need to ^2enable^7 Crazy Hitmarker to see which effect this action have.");
    self.var["hitmarker_pos_flash_speed"] = i;
}
func_hitmarker_color(i)
{
    if(self.var["hitmarker"] == false || !isDefined(self.var["hitmarker"]))
        S("You need to ^2enable^7 Hitmarker to see which effect this action have.");
    self notify("func_hitmarker_colorLoop_stop");
    self.hud_damagefeedback.color = i;
    S("Hitmarker Color Changed to ^2"+getOptionName());
}

func_hitmarker_colorLoop()
{
    if(self.var["hitmarker"] == false || !isDefined(self.var["hitmarker"]))
        S("You need to ^2enable^7 Hitmarker to see which effect this action have.");
    self endon("func_hitmarker_colorLoop_stop");
    S("Hitmarker Color Changed to ^2Random Color Loop");
    for(;;)
    {
        self.hud_damagefeedback.color = (randomintrange( 0, 255 )/255,randomintrange( 0, 255 )/255,randomintrange( 0, 255 )/255);
        if(self.var["hitmarker_pos_flash"])
            wait self.var["hitmarker_pos_flash_speed"];
        else
            wait .01;
    }
}
func_hitmarker_reset(i)
{
    self.var["hitmarker_pos_flash_distance"] = 20;
    self.var["hitmarker_pos_flash_speed"] = .01;
    self.var["hitmarker_pos_flash_animated"] = false;
    if(i == false)
    {
        self _loadMenu("main_hitmaker_crazy_settings");
        S("Crazy Hitmarker Settings ^1Reseted");
        return;
    }
    else
    {
        self.var["hitmarker_pos_flash"] = false;
        self.var["hitmarker"] = true; 
        self notify("func_hitmarker_colorLoop_stop");
        self.hud_damagefeedback.color = (1,1,1);
        self _loadMenu("main_hitmaker");
        S("Hitmarker Settings ^1Reseted");
    }
}
S(i)
{
self iprintln(i);
}
/////////////////////////////////////////////////////////////////////////////////////////////////////
Credits
CabCon


Thank you and have a nice day!
:cabconmodding:
 
Last edited:
G

Gentle

Guest
Hello guys,
today I will share this hitmarker code with you. :grinning: Feel free to use it. It will work for every call of duty!

Function Overview
  • Toggle Hitmarker | Display/Hide Hitmarker ::func_hitmarker
  • Hitmarker Color | Set the Color of the Hitmarker ::func_hitmarker_color
    • Hitmarker Color Loop | Loops the Hitmarker Color with random colors ::func_hitmarker_colorLoop
  • Flashing Hitmarker | The Hitmarker will move over the screen ::func_hitmarker_flashing_pos
    • ::func_hitmarker_pos_flash_animated
    • ::func_hitmarker_distance
    • ::func_hitmarker_speed
  • Reset Everything | Reset ::func_hitmarker_reset

I recommend to use all functions! You can find this function in the Cabepex Menu!

Add Function

Add this code after the player is spawned. This will set the variables for the functions.
Code:
self.var["hitmarker"] = true; 
self.var["hitmarker_pos_flash"] = false;
self.var["hitmarker_pos_flash_distance"] = 20;
self.var["hitmarker_pos_flash_speed"] = .01;
self.var["hitmarker_pos_flash_animated"] = false;
Add the Function Code.

Code:
/////////////////////////////////////////////////////////////////////////////////////////////////////
// HITMARKER / DAMAGEFEEDBACK Options Created by CabCon
/////////////////////////////////////////////////////////////////////////////////////////////////////
func_hitmarker()
{
    if(self.var["hitmarker_pos_flash"] == true)
        self func_hitmarker_flashing_pos();
    if(self.var["hitmarker"] == false || !isDefined(self.var["hitmarker"]) )
    {
        self.hud_damagefeedback.x = -12;
        self.hud_damagefeedback.y = -12;
        self.var["hitmarker"] = true;
        S("Hitmarker ^2ON");
    }
    else
    {
        self.hud_damagefeedback.x = -99999;
        self.hud_damagefeedback.y = -99999;
        self.var["hitmarker"] = false;
        S("Hitmarker ^1OFF");
    }
}
func_hitmarker_flashing_pos()
{
    if(self.var["hitmarker"] == false || !isDefined(self.var["hitmarker"]))
        self func_hitmarker();
    if(self.var["hitmarker_pos_flash"] == false || !isDefined(self.var["hitmarker_pos_flash"]) )
    {
        self.var["hitmarker_pos_flash"] = true;
        self thread func_hitmarker_flashing_pos_func();
        S("Crazy Hitmarker ^2ON");
    }
    else
    {
        self.var["hitmarker_pos_flash"] = false;
        self notify("hitmarker_pos_flash_stop");
        S("Crazy Hitmarker ^1OFF");
    }
}
func_hitmarker_flashing_pos_func()
{
    self endon("hitmarker_pos_flash_stop");
    while(self.var["hitmarker_pos_flash"])
    {
        if(self.var["hitmarker_pos_flash_animated"])
            self.hud_damagefeedback moveovertime(self.var["hitmarker_pos_flash_speed"]);
        self.hud_damagefeedback.x = -12 + randomIntRange(0-self.var["hitmarker_pos_flash_distance"],self.var["hitmarker_pos_flash_distance"]);
        self.hud_damagefeedback.y = -12 + randomIntRange(0-self.var["hitmarker_pos_flash_distance"],self.var["hitmarker_pos_flash_distance"]);
        wait self.var["hitmarker_pos_flash_speed"];
    }
}

func_hitmarker_pos_flash_animated()
{
    if(self.var["hitmarker_pos_flash"] == false || !isDefined(self.var["hitmarker_pos_flash"]) )
        S("You need to ^2enable^7 Crazy Hitmarker to see which effect this action have.");
    self.var["hitmarker_pos_flash_animated"] = !self.var["hitmarker_pos_flash_animated"];
}
func_hitmarker_distance(i)
{
    if(self.var["hitmarker_pos_flash"] == false || !isDefined(self.var["hitmarker_pos_flash"]) )
        S("You need to ^2enable^7 Crazy Hitmarker to see which effect this action have.");
    self.var["hitmarker_pos_flash_distance"] = i;
}
func_hitmarker_speed(i)
{
    if(self.var["hitmarker_pos_flash"] == false || !isDefined(self.var["hitmarker_pos_flash"]) )
        S("You need to ^2enable^7 Crazy Hitmarker to see which effect this action have.");
    self.var["hitmarker_pos_flash_speed"] = i;
}
func_hitmarker_color(i)
{
    if(self.var["hitmarker"] == false || !isDefined(self.var["hitmarker"]))
        S("You need to ^2enable^7 Hitmarker to see which effect this action have.");
    self notify("func_hitmarker_colorLoop_stop");
    self.hud_damagefeedback.color = i;
    S("Hitmarker Color Changed to ^2"+getOptionName());
}

func_hitmarker_colorLoop()
{
    if(self.var["hitmarker"] == false || !isDefined(self.var["hitmarker"]))
        S("You need to ^2enable^7 Hitmarker to see which effect this action have.");
    self endon("func_hitmarker_colorLoop_stop");
    S("Hitmarker Color Changed to ^2Random Color Loop");
    for(;;)
    {
        self.hud_damagefeedback.color = (randomintrange( 0, 255 )/255,randomintrange( 0, 255 )/255,randomintrange( 0, 255 )/255);
        if(self.var["hitmarker_pos_flash"])
            wait self.var["hitmarker_pos_flash_speed"];
        else
            wait .01;
    }
}
func_hitmarker_reset(i)
{
    self.var["hitmarker_pos_flash_distance"] = 20;
    self.var["hitmarker_pos_flash_speed"] = .01;
    self.var["hitmarker_pos_flash_animated"] = false;
    if(i == false)
    {
        self _loadMenu("main_hitmaker_crazy_settings");
        S("Crazy Hitmarker Settings ^1Reseted");
        return;
    }
    else
    {
        self.var["hitmarker_pos_flash"] = false;
        self.var["hitmarker"] = true; 
        self notify("func_hitmarker_colorLoop_stop");
        self.hud_damagefeedback.color = (1,1,1);
        self _loadMenu("main_hitmaker");
        S("Hitmarker Settings ^1Reseted");
    }
}
S(i)
{
self iprintln(i);
}
/////////////////////////////////////////////////////////////////////////////////////////////////////
Credits
CabCon


Thank you and have a nice day!
:cabconmodding:
Hot Stuff
 

Top