Raised This Month: $ Target: $400
 0% 

REQUEST - Damage for disconnected/specs


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
granted
New Member
Join Date: Apr 2017
Old 05-17-2017 , 18:30   REQUEST - Damage for disconnected/specs
Reply With Quote #1

I need a plugin for a CSGO server.
I have an issue.

My server doesn't have friendly fire enabled, but people on the same team for example two CTs, one of them buys a molotov, throws it on the ground, disconnects from the server or goes to spectator, and the damage is inflicted on his teammate. It's an easy way to grief without friendly fire being enabled.

How can I prevent this? My only idea is to check on the damage and to check if it's an actual client, but that won't help if they go spectator. Easier solution?

Last edited by granted; 05-17-2017 at 18:31.
granted is offline
Bobakanoosh
Senior Member
Join Date: Sep 2015
Location: United States
Old 05-18-2017 , 15:42   Re: REQUEST - Damage for disconnected/specs
Reply With Quote #2

Pretty sure what I'm thinking of will work, shouldn't take me long here.

Edit: internet is being a bitch atm, will work on it later.

Last edited by Bobakanoosh; 05-18-2017 at 16:38.
Bobakanoosh is offline
VJScope
Senior Member
Join Date: Jul 2012
Location: Finland
Old 05-19-2017 , 06:28   Re: REQUEST - Damage for disconnected/specs
Reply With Quote #3

Maybe you can hook into event player_hurt and check the dmg_health value and return it to victim? Something like this:

Code:
public void OnPluginStart()
{
	HookEvent("player_hurt", Event_PlayerHurt);
}

public Action:Event_PlayerHurt(Handle:event, const String:name[], bool:dontBroadcast)
{
	new att = GetClientOfUserId(GetEventInt(event, "attacker"));
	new vic = GetClientOfUserId(GetEventInt(event, "userid"));
	
	if (!IsClientInGame(att) || !IsClientObserver(att))
	{
		//return HP to client
	}
}
Here is more about that event: https://wiki.alliedmods.net/Counter-...ts#player_hurt
__________________
Strange women lying in ponds distributing swords is no basis for a system of government. Supreme executive power derives from a mandate from the masses, not from some farcical aquatic ceremony.

Last edited by VJScope; 05-19-2017 at 06:29.
VJScope 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 13:50.


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