Raised This Month: $51 Target: $400
 12% 

l4d2 reflect damage request


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
wendigo
Senior Member
Join Date: Nov 2012
Location: Denmark
Old 11-01-2015 , 21:47   l4d2 reflect damage request
Reply With Quote #1

I need such a plugin. One that reflects team damage. So if you play in expert, the damage you deal to an teamplayer, gets reflected back to you.
I've looked around for plugins that already got this feature. I came across this here

https://forums.alliedmods.net/showthread.php?t=80554

But it does too much. And I only want reflect damage feature. There are even people in last page saying it needs rewriting.

I bet the chances are small, but could one of you that makes plugins, make one for me that reflects team damage back?
wendigo is offline
wendigo
Senior Member
Join Date: Nov 2012
Location: Denmark
Old 11-05-2015 , 14:01   Re: l4d2 reflect damage request
Reply With Quote #2

Just as I thought, I am afraid to say. Is there just no love for l4d2 anymore, is that where the main problem is?

How long would it take for anyone of you plugin makers, to make my request into an plugin?

Last edited by wendigo; 11-05-2015 at 14:02.
wendigo is offline
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 11-06-2015 , 12:23   Re: l4d2 reflect damage request
Reply With Quote #3

Stop doing a drama, gwad. Ill do that when I got times, you know, those who script are peoples, just like you and me, and they got stuff to do in life (yes, yes, ...).

An alertnative is to do that yourself and don't hide behind this : "But I have no experience, bla bla bla do it for ME, for FREE, and NOW (piece of ....) !"

There is a lot of exemples / wiki, and seriously, it won't take you more then 2-3 days to learn basic things such as what you requested.

Also, I'm pretty sure this kind of plugin already exist.
__________________
Want to check my plugins ?

Last edited by Arkarr; 11-06-2015 at 12:24.
Arkarr is offline
wendigo
Senior Member
Join Date: Nov 2012
Location: Denmark
Old 11-09-2015 , 14:00   Re: l4d2 reflect damage request
Reply With Quote #4

This kind of plugin doesnt exist with this feature only. Look at my link in #1. That plugin has it among tons of other stuff, which I dont need. Only the reflect damage. But author doesnt wanna seem to update it. People complain it needs to be rewritten. All this despite author is still active but not doing a damn thing to his plugin since 2012.
And when author doesnt want to maintain it, I just wont download it.

That is the only non supported ( broken? ) plugin I know off.

But I appreciate you want to do it. But how long is the time frame? Are we talking a few weeks?
wendigo is offline
DeathChaos25
Senior Member
Join Date: Jan 2014
Location: Puerto Rico
Old 11-09-2015 , 14:48   Re: l4d2 reflect damage request
Reply With Quote #5

I can probably code one real quick, I haven't really logged on to L4D2 in ages, so i don't have a server handy nearby to test for very specific 1 in 1,000 bugs scenario, but I should have one ready soon-ish, do you want simply reflect damage on a Survivor vs Survivor basis?

Edit: here you go

PHP Code:
#pragma semicolon 1

#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
#define PLUGIN_VERSION "1.0"

/* Plugin Information */
public Plugin:myinfo =  {
    
name "[L4D2] Reflect FF"
    
author "DeathChaos25"
    
description "Reflects FF damage for Survivors"
    
url ""
}

public 
OnClientPutInServer(client)  

    
SDKHook(clientSDKHook_OnTakeDamageOnTakeDamage);


public 
OnAllPluginsLoaded()
{
    for (new 
client 1client <= MaxClientsclient++)
    {
        if (
IsClientInGame(client) && IsSurvivor(client))
        {
            
SDKHook(clientSDKHook_OnTakeDamageOnTakeDamage);
        }
    }
}  

public 
Action:OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype, &weaponFloat:damageForce[3], Float:damagePosition[3])

    if (!
IsSurvivor(victim) || !IsSurvivor(attacker))return Plugin_Continue// only survivor vs survivor dmg
    
if (attacker == victim)return Plugin_Continue// block the plugin from triggering on self damage
    
DealDamage(attackerdamageattackerdamagetype);
    return 
Plugin_Handled;


stock bool:IsSurvivor(client)
{
    return 
client && client <= MaxClients && IsClientInGame(client) && GetClientTeam(client) == 2;
}

DealDamage(victim,Float:damage,attacker=0,dmg_type=0,String:weapon[]="")
{
    if(
victim>&& IsValidEdict(victim) && IsClientInGame(victim) && IsPlayerAlive(victim) && damage>0)
    {
        new 
String:dmg_str[16];
        
FloatToString(damage,dmg_str,16);
        new 
String:dmg_type_str[32];
        
IntToString(dmg_type,dmg_type_str,32);
        new 
pointHurt=CreateEntityByName("point_hurt");
        if(
pointHurt)
        {
            
DispatchKeyValue(victim,"targetname","war3_hurtme");
            
DispatchKeyValue(pointHurt,"DamageTarget","war3_hurtme");
            
DispatchKeyValue(pointHurt,"Damage",dmg_str);
            
DispatchKeyValue(pointHurt,"DamageType",dmg_type_str);
            if(!
StrEqual(weapon,""))
            {
                
DispatchKeyValue(pointHurt,"classname",weapon);
            }
            
DispatchSpawn(pointHurt);
            
AcceptEntityInput(pointHurt,"Hurt",(attacker>0)?attacker:-1);
            
DispatchKeyValue(pointHurt,"classname","point_hurt");
            
DispatchKeyValue(victim,"targetname","war3_donthurtme");
            
RemoveEdict(pointHurt);
        }
    }
}

// deal damage source taken from https://forums.alliedmods.net/showthread.php?t=111684 
Requires SDKHooks to compile and work, I'll attach a precompiled.

Do note that this also reflects damage from mollies, so this could potentially be used to grief players who throw one by having people purposely walk into it.

Cheers!
Attached Files
File Type: smx [L4D2] Reflect FF.smx (5.3 KB, 126 views)
__________________

Last edited by DeathChaos25; 11-09-2015 at 15:31.
DeathChaos25 is offline
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 11-09-2015 , 15:29   Re: l4d2 reflect damage request
Reply With Quote #6

Quote:
Originally Posted by DeathChaos25 View Post
I can probably code one real quick, I haven't really logged on to L4D2 in ages, so i don't have a server handy nearby to test for very specific 1 in 1,000 bugs scenario, but I should have one ready soon-ish, do you want simply reflect damage on a Survivor vs Survivor basis?
Please do so, I can provide the L4D2 server (and FTP access), and to wendigo, I am sorry, too much things to do, but be sure, if there is anything 'til sunday, well, I will release it.

Anyway, SDKHooks allow you to do that pretty easyl.
__________________
Want to check my plugins ?
Arkarr is offline
wendigo
Senior Member
Join Date: Nov 2012
Location: Denmark
Old 11-10-2015 , 14:06   Re: l4d2 reflect damage request
Reply With Quote #7

Cheers guys.
Is it possible to make the reflect damage, to bypass the molotov thing?

Just take the time required. I am here to ask for help. So you guys control when its all done.
wendigo is offline
DeathChaos25
Senior Member
Join Date: Jan 2014
Location: Puerto Rico
Old 11-20-2015 , 14:48   Re: l4d2 reflect damage request
Reply With Quote #8

Here you go;

PHP Code:
#pragma semicolon 1

#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
#define PLUGIN_VERSION "1.0"

/* Plugin Information */
public Plugin:myinfo =  {
    
name "[L4D2] Reflect FF"
    
author "DeathChaos25"
    
description "Reflects FF damage for Survivors"
    
url ""
}

public 
OnClientPutInServer(client)  

    
SDKHook(clientSDKHook_OnTakeDamageOnTakeDamage);


public 
OnAllPluginsLoaded()
{
    for (new 
client 1client <= MaxClientsclient++)
    {
        if (
IsClientInGame(client) && IsSurvivor(client))
        {
            
SDKHook(clientSDKHook_OnTakeDamageOnTakeDamage);
        }
    }
}  

public 
Action:OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype, &weaponFloat:damageForce[3], Float:damagePosition[3])

    
//damagetype 8 and 2056 are fire related damage that can be done via molotovs
    
if (!IsSurvivor(victim) || !IsSurvivor(attacker))return Plugin_Continue// only survivor vs survivor dmg
    
if (attacker == victim || damagetype == || damagetype == 2056)return Plugin_Continue// block the plugin from triggering on self damage
    
DealDamage(attackerdamageattackerdamagetype);
    
//PrintToChatAll("dmgtype = %i", damagetype);
    
return Plugin_Handled;


stock bool:IsSurvivor(client)
{
    return 
client && client <= MaxClients && IsClientInGame(client) && GetClientTeam(client) == 2;
}

DealDamage(victim,Float:damage,attacker=0,dmg_type=0,String:weapon[]="")
{
    if(
victim>&& IsValidEdict(victim) && IsClientInGame(victim) && IsPlayerAlive(victim) && damage>0)
    {
        new 
String:dmg_str[16];
        
FloatToString(damage,dmg_str,16);
        new 
String:dmg_type_str[32];
        
IntToString(dmg_type,dmg_type_str,32);
        new 
pointHurt=CreateEntityByName("point_hurt");
        if(
pointHurt)
        {
            
DispatchKeyValue(victim,"targetname","war3_hurtme");
            
DispatchKeyValue(pointHurt,"DamageTarget","war3_hurtme");
            
DispatchKeyValue(pointHurt,"Damage",dmg_str);
            
DispatchKeyValue(pointHurt,"DamageType",dmg_type_str);
            if(!
StrEqual(weapon,""))
            {
                
DispatchKeyValue(pointHurt,"classname",weapon);
            }
            
DispatchSpawn(pointHurt);
            
AcceptEntityInput(pointHurt,"Hurt",(attacker>0)?attacker:-1);
            
DispatchKeyValue(pointHurt,"classname","point_hurt");
            
DispatchKeyValue(victim,"targetname","war3_donthurtme");
            
RemoveEdict(pointHurt);
        }
    }
}

// deal damage source taken from https://forums.alliedmods.net/showthread.php?t=111684 
Attached Files
File Type: smx [L4D2] Reflect FF.smx (5.3 KB, 170 views)
__________________
DeathChaos25 is offline
wendigo
Senior Member
Join Date: Nov 2012
Location: Denmark
Old 11-24-2015 , 12:24   Re: l4d2 reflect damage request
Reply With Quote #9

EDIT 27th november:

I've sent you an PM, about last changes, if you wanted to refine the plugin.
So far, I love this plugin. Thanks for the progress in the plugin. +1

Last edited by wendigo; 11-27-2015 at 05:48.
wendigo is offline
jess
Member
Join Date: Aug 2015
Location: mb
Old 11-28-2015 , 10:36   Re: l4d2 reflect damage request
Reply With Quote #10

There are dozens of l4d2 plugins that do exactly what you already requested, you just have to learn to use the search function. It takes a little bit of effort, but it isn't difficult.
jess 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 07:11.


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