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

Removing Bomb Damage Completely


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Endoint
Junior Member
Join Date: Oct 2018
Old 11-12-2018 , 03:56   Removing Bomb Damage Completely
Reply With Quote #1

Hi,

I'm after a plugin that removes bomb damage entirely.
I'd basically like the bomb to never effect players on my server, but obviously still have grenade damage, etc.

I have read over this plugin, but it seems that this firstly; only removes bomb damage after the round ends, and secondly, seems to only have the ability to set this for specific admin flags, rather than for the entire server and anyone who enters it.

Does anyone know of any plugin that will do what i'm after?

Thanks.
Endoint is offline
Drixevel
AlliedModders Donor
Join Date: Sep 2009
Location: Somewhere headbangin'
Old 11-12-2018 , 09:25   Re: Removing Bomb Damage Completely
Reply With Quote #2

Code:
#include <sourcemod>
#include <sdkhooks>

#define PLUGIN_VERSION "2.1"

public Plugin myinfo = 
{
	name = "No Bomb Damage",
	author = "Keith Warren (Shaders Allen)",
	description = "Stops all damage from bombs occuring to players.",
	version = PLUGIN_VERSION,
	url = "http://github.com/shadersallen"
}

public void OnPluginStart()
{
	for (int i = 1; i <= MaxClients; i++)
	{
		if (IsClientInGame(i))
			OnClientPutInServer(i);
	}
}

public void OnClientPutInServer(int client)
{	
	SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamage);
}

public Action OnTakeDamage(int victim, int& attacker, int& inflictor, float& damage, int& damagetype)
{
	if (!IsValidEntity(inflictor))
		return Plugin_Continue;
	
	char class[32];
	GetEntityClassname(inflictor, class, sizeof(class));
	
	if (!StrEqual(class, "planted_c4", false))
		return Plugin_Continue;
	
	damage = 0.0;
	return Plugin_Changed;
}
Attached Files
File Type: sp Get Plugin or Get Source (nobombdamage.sp - 344 views - 927 Bytes)

Last edited by Drixevel; 11-12-2018 at 09:26.
Drixevel is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 11-12-2018 , 09:48   Re: Removing Bomb Damage Completely
Reply With Quote #3

There are on some maps env_explosion added in bombsite, to create more effect when c4 explode.
So those can hurt players also when they are too near.
Bacardi is offline
Endoint
Junior Member
Join Date: Oct 2018
Old 11-12-2018 , 17:05   Re: Removing Bomb Damage Completely
Reply With Quote #4

Quote:
Originally Posted by Drixevel View Post
Code:
#include <sourcemod>
#include <sdkhooks>

#define PLUGIN_VERSION "2.1"

public Plugin myinfo = 
{
	name = "No Bomb Damage",
	author = "Keith Warren (Shaders Allen)",
	description = "Stops all damage from bombs occuring to players.",
	version = PLUGIN_VERSION,
	url = "http://github.com/shadersallen"
}

public void OnPluginStart()
{
	for (int i = 1; i <= MaxClients; i++)
	{
		if (IsClientInGame(i))
			OnClientPutInServer(i);
	}
}

public void OnClientPutInServer(int client)
{	
	SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamage);
}

public Action OnTakeDamage(int victim, int& attacker, int& inflictor, float& damage, int& damagetype)
{
	if (!IsValidEntity(inflictor))
		return Plugin_Continue;
	
	char class[32];
	GetEntityClassname(inflictor, class, sizeof(class));
	
	if (!StrEqual(class, "planted_c4", false))
		return Plugin_Continue;
	
	damage = 0.0;
	return Plugin_Changed;
}

Wow thank you kind sir

Quote:
Originally Posted by Bacardi View Post
There are on some maps env_explosion added in bombsite, to create more effect when c4 explode.
So those can hurt players also when they are too near.
Which maps are you talking about? Is there a way around this?
Endoint is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 11-12-2018 , 20:35   Re: Removing Bomb Damage Completely
Reply With Quote #5

Quote:
Originally Posted by Endoint View Post
Which maps are you talking about? Is there a way around this?
well I don't know, which maps have those.
Cs:s has at least in map de_dust2. It's rare object after all.

I just mention it so you would not be suprised if player die at event c4 explosion.
__________________
Do not Private Message @me
Bacardi is offline
godzcsgo
Senior Member
Join Date: Jul 2017
Old 03-02-2019 , 16:24   Re: Removing Bomb Damage Completely
Reply With Quote #6

Is this for CS:GO or CS:S?
godzcsgo is offline
CliptonHeist
Senior Member
Join Date: Feb 2016
Old 03-02-2019 , 19:44   Re: Removing Bomb Damage Completely
Reply With Quote #7

Quote:
Originally Posted by godzcsgo View Post
Is this for CS:GO or CS:S?
Both
CliptonHeist is offline
Drumanid
Junior Member
Join Date: Mar 2017
Location: Russia
Old 03-07-2019 , 12:18   Re: Removing Bomb Damage Completely
Reply With Quote #8

Code:
#include <sourcemod>

public Plugin myinfo =
{
	name = "No bomb damage",
	author = "Drumanid",
	version = "1.0.0",
	url = "Discord: Drumanid#9108"
};

public void OnPluginStart()
{
	HookEvent("bomb_exploded", view_as<EventHook>(BombExploded), EventHookMode_Pre);
}

#define OFF 0
#define ON 2
void BombExploded()
{
	Damage(OFF);
	RequestFrame(view_as<RequestFrameCallback>(BombExplodedFrame));
}

void BombExplodedFrame()
{
	Damage(ON);
}

void Damage(int iType)
{
	for(int iClient = 1; iClient <= MaxClients; ++iClient)
		if(IsClientInGame(iClient) && IsPlayerAlive(iClient))
			SetEntProp(iClient, Prop_Data, "m_takedamage", iType);
}
__________________
Sorry for my english, I use google translate

Last edited by Drumanid; 03-07-2019 at 12:20.
Drumanid is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 03-08-2019 , 12:57   Re: Removing Bomb Damage Completely
Reply With Quote #9

Quote:
Originally Posted by Drumanid View Post
Code:
#include <sourcemod>

public Plugin myinfo =
{
	name = "No bomb damage",
	author = "Drumanid",
	version = "1.0.0",
	url = "Discord: Drumanid#9108"
};

public void OnPluginStart()
{
	HookEvent("bomb_exploded", view_as<EventHook>(BombExploded), EventHookMode_Pre);
}

#define OFF 0
#define ON 2
void BombExploded()
{
	Damage(OFF);
	RequestFrame(view_as<RequestFrameCallback>(BombExplodedFrame));
}

void BombExplodedFrame()
{
	Damage(ON);
}

void Damage(int iType)
{
	for(int iClient = 1; iClient <= MaxClients; ++iClient)
		if(IsClientInGame(iClient) && IsPlayerAlive(iClient))
			SetEntProp(iClient, Prop_Data, "m_takedamage", iType);
}
Never use such a pathetic method especially when:

1. There are working alternatives.
2. This will enforce disabling godmode on all players.
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334
eyal282 is offline
Drumanid
Junior Member
Join Date: Mar 2017
Location: Russia
Old 03-09-2019 , 06:53   Re: Removing Bomb Damage Completely
Reply With Quote #10

Quote:
Originally Posted by eyal282 View Post
Never use such a pathetic method especially when:

1. There are working alternatives.
2. This will enforce disabling godmode on all players.
I do not think that this method is 'pathetic'.

1. What is higher? - No
Better than checking for damage every time.
2. What prevents to make a check?

There is a better option, suggest
Not agree - criticize, criticize - offer, offer - do, do - answer.

Another view implementation:
Code:
#include <sourcemod>
#include <sdkhooks>

public Plugin myinfo =
{
	name = "No bomb damage",
	author = "Drumanid",
	version = "1.0.0",
	url = "Discord: Drumanid#9108"
};

public void OnPluginStart()
{
	HookEvent("bomb_exploded", view_as<EventHook>(Event_BombExploded), EventHookMode_Pre);
}

#define EVENT(%0) \
for(int iClient = 1; iClient <= MaxClients; ++iClient)\
if(IsClientInGame(iClient) && IsPlayerAlive(iClient))\
%0(iClient, SDKHook_OnTakeDamageAlive, OnTakeDamageAlive)

void Event_BombExploded()
{
	EVENT(SDKHook);
	RequestFrame(view_as<RequestFrameCallback>(BombExplodedFrame));
}

void BombExplodedFrame()
{
	EVENT(SDKUnhook);
}

Action OnTakeDamageAlive(int iVictim, int &iAttacker, int &iInflictor, float &fDamage, int &iDamageType)
{
	return iDamageType == 64 ? Plugin_Handled:Plugin_Continue;
}
__________________
Sorry for my english, I use google translate

Last edited by Drumanid; 03-09-2019 at 07:45.
Drumanid is offline
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 15:22.


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