Raised This Month: $344 Target: $400
 86%   Almost there!

CS GO Removing Red Circle when being hit


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
NatsUpX
Junior Member
Join Date: Jun 2022
Old 06-23-2022 , 06:29   CS GO Removing Red Circle when being hit
Reply With Quote #1

Hello,

I hope im in the correct section here.

As we run a soccer league recently for csgo and are on to fixing the remaining stuff, we noticed a problem while being hit with the ball you get this red circle as in the picture below.



We used this plugin once

https://forums.alliedmods.net/showthread.php?p=2306414

but it negotiates every damage, but the problem is after a goal has been done the team recieving the goal gets killed and the round gets restarted. With this plugin they are invulnerable and the mod doesnt work correctly.

So is there a way to just get rid of the red circle?

Appreciate any help.
NatsUpX is offline
azalty
AlliedModders Donor
Join Date: Feb 2020
Location: France
Old 06-23-2022 , 20:52   Re: CS GO Removing Red Circle when being hit
Reply With Quote #2

I guess we could technically hijack damage and do our own health&die system, but that's probably not the best solution. There must be another way.
__________________
azalty is offline
Cruze
Veteran Member
Join Date: May 2017
Old 06-24-2022 , 10:44   Re: CS GO Removing Red Circle when being hit
Reply With Quote #3

- Try removing line number 72 from NoDamage plugin and compiling the plugin.
- Hook "player_hurt" with EventHookMode_Pre and add "return Plugin_Handled" statement to it.
__________________
Taking paid private requests! Add me on steam/discord!
AlliedModders Releases | Github | Private Plugins | Steam | Discord
Cruze is offline
NatsUpX
Junior Member
Join Date: Jun 2022
Old 06-24-2022 , 14:12   Re: CS GO Removing Red Circle when being hit
Reply With Quote #4

Quote:
Originally Posted by Cruze View Post
- Try removing line number 72 from NoDamage plugin and compiling the plugin.
- Hook "player_hurt" with EventHookMode_Pre and add "return Plugin_Handled" statement to it.
I tried to remove line 72 and compiled, unfortunately didnt work.
About that Hook, im not a coder i dont really know what to add here.
I tried adding this, which is probably wong

public Event_Player_Hurt(Handle:event, const String:name[], bool:dontBroadcast)
{
HookEvent("player_hurt", Event_Player_Hurt, EventHookMode_Pre);
return Plugin_Handled;
}
NatsUpX is offline
Franc1sco
Veteran Member
Join Date: Oct 2010
Location: Spain (Madrid)
Old 06-24-2022 , 18:13   Re: CS GO Removing Red Circle when being hit
Reply With Quote #5

What soccermod are you using? Maybe this? and only with that plugin these circle appear?
__________________
Veteran SourceMod Coder -> Activity channel
Taking paid and free jobs.
Contact: Steam, Telegram or discord ( Franc1sco#7876 ).

You like my work? +Rep in my steam profile comments or donate.

Franc1sco is offline
Send a message via MSN to Franc1sco
NatsUpX
Junior Member
Join Date: Jun 2022
Old 06-25-2022 , 05:46   Re: CS GO Removing Red Circle when being hit
Reply With Quote #6

yes thats the one i use, we modded it already but thats the core one.
I dont think its related to that soccermod, after all when i type in " sm_rcon sm plugins unload soccer_mod "
to deactivate it, i still get these red circles.
NatsUpX is offline
Cruze
Veteran Member
Join Date: May 2017
Old 06-26-2022 , 04:29   Re: CS GO Removing Red Circle when being hit
Reply With Quote #7

Try this:
PHP Code:
#include <sourcemod>
#include <sdkhooks>

#pragma newdecls required
#pragma semicolon 1

#define PLUGIN_VERSION    "1.2"
#define PLUGIN_NAME        "NoDamage"

bool g_bLateLoadg_bEnabled;
ConVar g_hEnabled;

public 
Plugin myinfo 
{
    
name PLUGIN_NAME,
    
author "Thomas Ross, fixes by Grey83 & Cruze",
    
description "Stops damage from being taken",
    
version PLUGIN_VERSION,
    
url ""
}

public 
APLRes AskPluginLoad2(Handle myselfbool latechar[] errorint err_max)
{
    
g_bLateLoad late;
    return 
APLRes_Success;
}

public 
void OnPluginStart()
{
    
CreateConVar("sm_nodamage_version"PLUGIN_VERSIONPLUGIN_NAMEFCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY|FCVAR_DONTRECORD);
    
g_hEnabled CreateConVar("sm_nodamage_enabled""1""1 = Plugin enabled, 0 = Disabled"FCVAR_SPONLYtrue0.0true1.0);

    
HookConVarChange(g_hEnabledOnSettingsChange);
    
g_bEnabled g_hEnabled.BoolValue;
    
    
HookEvent("player_hurt"Event_PlayerHurtEventHookMode_Pre);

    if(
g_bLateLoad && g_bEnabled)
    {    
        
LateLoadConnect();
        
g_bLateLoad false;
    }
}

public 
int OnSettingsChange(ConVar cvar, const char[] oldVal, const char[] newVal)
{
    if(
StrEqual(oldValnewVal))
    {
        return;
    }
    
    
g_bEnabled = !!StringToInt(newVal);

    if (
g_bEnabled)
    {
        
LateLoadConnect();
    }
    else
    {
        
LateLoadDisconnect();
    }
}

public 
void OnClientPostAdminCheck(int client)
{
    if(
IsFakeClient(client))
    {
        return;
    }
    
SDKHook(clientSDKHook_OnTakeDamageEvent_OnTakeDamage);
}

 public 
void OnClientDisconnect(int client)
{
    if(
IsFakeClient(client))
    {
        return;
    }
    
SDKUnhook(clientSDKHook_OnTakeDamageEvent_OnTakeDamage);
}

public 
Action Event_PlayerHurt(Event ev, const char[] namebool dbc)
{
    if (
g_bEnabled)
    {
        return 
Plugin_Handled;
    }
    return 
Plugin_Continue;
}

public 
Action Event_OnTakeDamage(int victimint &attackerint &inflictorfloat &damageint &damagetype

    return 
Plugin_Handled;
}

void LateLoadConnect()
{
    for(
int client 1client <= MaxClientsclient++) if(IsClientInGame(client))
    {
        
OnClientPostAdminCheck(client);
    }
}

void LateLoadDisconnect()
{
    for(
int client 1client <= MaxClientsclient++) if(IsClientInGame(client))
    {
        
OnClientDisconnect(client);
    }

Attached Files
File Type: sp Get Plugin or Get Source (nodamage2.sp - 22 views - 2.2 KB)
__________________
Taking paid private requests! Add me on steam/discord!
AlliedModders Releases | Github | Private Plugins | Steam | Discord

Last edited by Cruze; 06-26-2022 at 10:23. Reason: Fixed invalid client index error on lateload
Cruze is offline
NatsUpX
Junior Member
Join Date: Jun 2022
Old 06-26-2022 , 08:58   Re: CS GO Removing Red Circle when being hit
Reply With Quote #8

Quote:
Originally Posted by Cruze View Post
Try this:
PHP Code:
#include <sourcemod>
#include <sdkhooks>

#pragma newdecls required
#pragma semicolon 1

#define PLUGIN_VERSION    "1.2"
#define PLUGIN_NAME        "NoDamage"

bool g_bLateLoadg_bEnabled;
ConVar g_hEnabled;

public 
Plugin myinfo 
{
    
name PLUGIN_NAME,
    
author "Thomas Ross, fixes by Grey83 & Cruze",
    
description "Stops damage from being taken",
    
version PLUGIN_VERSION,
    
url ""
}

public 
APLRes AskPluginLoad2(Handle myselfbool latechar[] errorint err_max)
{
    
g_bLateLoad late;
    return 
APLRes_Success;
}

public 
void OnPluginStart()
{
    
CreateConVar("sm_nodamage_version"PLUGIN_VERSIONPLUGIN_NAMEFCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY|FCVAR_DONTRECORD);
    
g_hEnabled CreateConVar("sm_nodamage_enabled""1""1 = Plugin enabled, 0 = Disabled"FCVAR_SPONLYtrue0.0true1.0);

    
HookConVarChange(g_hEnabledOnSettingsChange);
    
g_bEnabled g_hEnabled.BoolValue;
    
    
HookEvent("player_hurt"Event_PlayerHurtEventHookMode_Pre);

    if(
g_bLateLoad && g_bEnabled)
    {    
        
LateLoadConnect();
        
g_bLateLoad false;
    }
}

public 
int OnSettingsChange(ConVar cvar, const char[] oldVal, const char[] newVal)
{
    if(
StrEqual(oldValnewVal))
    {
        return;
    }
    
    
g_bEnabled = !!StringToInt(newVal);

    if (
g_bEnabled)
    {
        
LateLoadConnect();
    }
    else
    {
        
LateLoadDisconnect();
    }
}

public 
void OnClientPostAdminCheck(int client)
{
    if(
IsFakeClient(client))
    {
        return;
    }
    
SDKHook(clientSDKHook_OnTakeDamageEvent_OnTakeDamage);
}

 public 
void OnClientDisconnect(int client)
{
    if(
IsFakeClient(client))
    {
        return;
    }
    
SDKUnhook(clientSDKHook_OnTakeDamageEvent_OnTakeDamage);
}

public 
Action Event_PlayerHurt(Event ev, const char[] namebool dbc)
{
    if (
g_bEnabled)
    {
        return 
Plugin_Handled;
    }
    return 
Plugin_Continue;
}

public 
Action Event_OnTakeDamage(int victimint &attackerint &inflictorfloat &damageint &damagetype

    return 
Plugin_Handled;
}

void LateLoadConnect()
{
    for(
int clientclient <= MaxClientsclient++) if(IsClientInGame(client))
    {
        
OnClientPostAdminCheck(client);
    }
}

void LateLoadDisconnect()
{
    for(
int clientclient <= MaxClientsclient++) if(IsClientInGame(client))
    {
        
OnClientDisconnect(client);
    }

Unfortunately this didnt work

i made a clip for you so you can see what i am talking about.
Normally when i score an owngoal i get killed so the round can reset. With the plugin loaded nothing happens as im resitent to all damage. When im unloading the plugin then im getting killed right after like an post effect.

https://medal.tv/games/csgo/clips/pW...IsNzE1MjI4MzMs

Maybe that helps but when i try to load the mod after its unloaded i get this error :

] sm_rcon sm plugins load nodamage2
L 06/26/2022 - 12:57:54: [SM] Exception reported: Client index 0 is invalid
L 06/26/2022 - 12:57:54: [SM] Blaming: nodamage2.smx
L 06/26/2022 - 12:57:54: [SM] Call stack trace:
L 06/26/2022 - 12:57:54: [SM] [0] IsClientInGame
L 06/26/2022 - 12:57:54: [SM] [1] Line 98, /home/forums/content/files/2/7/9/4/9/8/195402.attach::LateLoadConnect
L 06/26/2022 - 12:57:54: [SM] [2] Line 40, /home/forums/content/files/2/7/9/4/9/8/195402.attach::OnPluginStart
L 06/26/2022 - 12:57:54: [SM] [4] ServerCommandEx
L 06/26/2022 - 12:57:54: [SM] [5] Line 402, /data/sourcemod/plugins/basecommands.sp::Command_Rcon
[SM] Plugin nodamage2.smx failed to load: Error detected in plugin startup (see error logs).
NatsUpX is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 06-29-2022 , 11:49   Re: CS GO Removing Red Circle when being hit
Reply With Quote #9

Those circles IIRC indicate the direction you took damage from.

SDKHook_OnTakeDamage has a variable similar to this idea:

http://sourcemod.net/new-api/sdkhooks/SDKHookCB

"damagePosition"

Maybe setting it to an invalid map position will make it work, or maybe setting it to the victim's position will make it work ( anything above 65535.0 across should be sufficient to guarantee invalid map position )
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334
eyal282 is offline
NatsUpX
Junior Member
Join Date: Jun 2022
Old 07-03-2022 , 10:03   Re: CS GO Removing Red Circle when being hit
Reply With Quote #10

Quote:
Originally Posted by eyal282 View Post
Those circles IIRC indicate the direction you took damage from.

SDKHook_OnTakeDamage has a variable similar to this idea:

http://sourcemod.net/new-api/sdkhooks/SDKHookCB

"damagePosition"

Maybe setting it to an invalid map position will make it work, or maybe setting it to the victim's position will make it work ( anything above 65535.0 across should be sufficient to guarantee invalid map position )
Thanks eyal282 for the very helpful hint and thanks Cruze for fixing and compiling a plugin for me.
Issue has been solved!
Attached Files
File Type: smx nodamage2.smx (4.0 KB, 5 views)
File Type: sp Get Plugin or Get Source (nodamage2.sp - 13 views - 2.3 KB)
NatsUpX 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 13:54.


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