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

Solved [CSGO] Plugin to Edit Wallbang Damage


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
debr1s
Junior Member
Join Date: Jun 2021
Old 09-03-2022 , 09:14   [CSGO] Plugin to Edit Wallbang Damage
Reply With Quote #1

Is there a plugin where I can increase Wallbang damages? I searched but couldn't find it? Would this be possible?

Last edited by debr1s; 09-15-2022 at 20:11.
debr1s is offline
databomb
Veteran Member
Join Date: Jun 2009
Location: california
Old 09-06-2022 , 19:30   Re: [CSGO] Plugin to Edit Wallbang Damage
Reply With Quote #2

This is possible with a SourceMod plugin. Franc1sco has already answered a similar question that came up on molotovs: https://forums.alliedmods.net/showpo...83&postcount=3

Try a similar approach like this:

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

#define DMG_MULTIPLE 100 // wallbang damage

public void OnPluginStart()
{
    for(
int i 1MaxClientsi++)
    {
        if(
IsClientInGame(i))
        {
            
OnClientPutInServer(i); // late load
        
}
    }
}
public 
OnClientPutInServer(int client)
{
    
SDKHook(clientSDKHook_OnTakeDamageOnTakeDamage);
}
public 
Action OnTakeDamage(int victimint &attackerint &inflictorfloat &damageint &damagetypeint &weaponfloat damageForce[3], float damagePosition[3])
{
    if(
IsValidEntity(inflictor))
    {
       
char sClassName[64];
       if (
GetEdictClassname(inflictorsClassNamesizeof(sClassName)))
       {
           if (
StrEqual(sClassName"flashbang_projectile"false))
           {
              
damage = (damage DMG_MULTIPLE);
              return 
Plugin_Changed;
           }
       }
    }
    return 
Plugin_Continue;

__________________

Last edited by databomb; 09-06-2022 at 19:34. Reason: add code highlighting
databomb is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 09-06-2022 , 22:30   Re: [CSGO] Plugin to Edit Wallbang Damage
Reply With Quote #3

...maybe follow bullet hits event and look tick time, then increase OnTakeDamage if it happen on same tick time ?
Something like that

*edit
Here one kind plugin.
- When ever first bullet impact have a distance to final damageposition,
plugin increase damage by 50%

It's hard coded now: damage *= 1.5;
PHP Code:
#include <sdkhooks>

enum struct BulletImpactInfo
{
    
int tick;
    
float pos[3];
}

BulletImpactInfo impactinfo[MAXPLAYERS];

ConVar mp_friendlyfire;
ConVar mp_teammates_are_enemies;

public 
void OnPluginStart()
{
    
HookEvent("bullet_impact"bullet_impact);

    
mp_friendlyfire FindConVar("mp_friendlyfire");
    
mp_teammates_are_enemies FindConVar("mp_teammates_are_enemies");

    for(
int i 1<= MaxClientsi++)
    {
        if(
IsClientInGame(i)) OnClientPutInServer(i);
    }
}

public 
void OnClientPutInServer(int client)
{
    
SDKHook(clientSDKHook_OnTakeDamageOnTakeDamage);
}

public 
void bullet_impact(Event event, const char[] namebool dontBroadcast)
{
    
int client GetClientOfUserId(event.GetInt("userid"));
    
int tick GetGameTickCount();
    
    if(
impactinfo[client].tick == tick)
        return;

    
//PrintToServer("bullet_impact");

    
impactinfo[client].tick tick;
    
    
impactinfo[client].pos[0] = event.GetFloat("x");
    
impactinfo[client].pos[1] = event.GetFloat("y");
    
impactinfo[client].pos[2] = event.GetFloat("z");
}

public 
Action OnTakeDamage(int victimintattackerintinflictorfloatdamageintdamagetypeintweaponfloat damageForce[3], float damagePosition[3])
{
    if(
attacker <= || attacker MaxClients || victim == attacker || attacker != inflictor)
        return 
Plugin_Continue;

    if(
GetClientTeam(victim) == GetClientTeam(attacker))
    {
        if(
mp_friendlyfire != null &&
            !
mp_friendlyfire.BoolValue)
                return 
Plugin_Continue;

        if(
mp_teammates_are_enemies != null &&
            !
mp_teammates_are_enemies.BoolValue)
                return 
Plugin_Continue;
    }



    
int tick GetGameTickCount();

    if(
impactinfo[attacker].tick != tick)
        return 
Plugin_Continue;

    if(
GetVectorDistance(impactinfo[attacker].posdamagePosition) <= 0.0)
        return 
Plugin_Continue;

    
damage *= 1.5;

    
//PrintToServer("OnTakeDamageAlive %f %i %i\n%f %f %f\n", damage, victim, attacker,
    //                                        damagePosition[0],
    //                                        damagePosition[1],
    //                                        damagePosition[2]);
    //

    
return Plugin_Changed;

__________________
Do not Private Message @me

Last edited by Bacardi; 09-07-2022 at 08:55.
Bacardi is offline
debr1s
Junior Member
Join Date: Jun 2021
Old 09-07-2022 , 10:53   Re: [CSGO] Plugin to Edit Wallbang Damage
Reply With Quote #4

Quote:
Originally Posted by Bacardi View Post
...maybe follow bullet hits event and look tick time, then increase OnTakeDamage if it happen on same tick time ?
Something like that

*edit
Here one kind plugin.
- When ever first bullet impact have a distance to final damageposition,
plugin increase damage by 50%

It's hard coded now: damage *= 1.5;
PHP Code:
#include <sdkhooks>

enum struct BulletImpactInfo
{
    
int tick;
    
float pos[3];
}

BulletImpactInfo impactinfo[MAXPLAYERS];

ConVar mp_friendlyfire;
ConVar mp_teammates_are_enemies;

public 
void OnPluginStart()
{
    
HookEvent("bullet_impact"bullet_impact);

    
mp_friendlyfire FindConVar("mp_friendlyfire");
    
mp_teammates_are_enemies FindConVar("mp_teammates_are_enemies");

    for(
int i 1<= MaxClientsi++)
    {
        if(
IsClientInGame(i)) OnClientPutInServer(i);
    }
}

public 
void OnClientPutInServer(int client)
{
    
SDKHook(clientSDKHook_OnTakeDamageOnTakeDamage);
}

public 
void bullet_impact(Event event, const char[] namebool dontBroadcast)
{
    
int client GetClientOfUserId(event.GetInt("userid"));
    
int tick GetGameTickCount();
    
    if(
impactinfo[client].tick == tick)
        return;

    
//PrintToServer("bullet_impact");

    
impactinfo[client].tick tick;
    
    
impactinfo[client].pos[0] = event.GetFloat("x");
    
impactinfo[client].pos[1] = event.GetFloat("y");
    
impactinfo[client].pos[2] = event.GetFloat("z");
}

public 
Action OnTakeDamage(int victimintattackerintinflictorfloatdamageintdamagetypeintweaponfloat damageForce[3], float damagePosition[3])
{
    if(
attacker <= || attacker MaxClients || victim == attacker || attacker != inflictor)
        return 
Plugin_Continue;

    if(
GetClientTeam(victim) == GetClientTeam(attacker))
    {
        if(
mp_friendlyfire != null &&
            !
mp_friendlyfire.BoolValue)
                return 
Plugin_Continue;

        if(
mp_teammates_are_enemies != null &&
            !
mp_teammates_are_enemies.BoolValue)
                return 
Plugin_Continue;
    }



    
int tick GetGameTickCount();

    if(
impactinfo[attacker].tick != tick)
        return 
Plugin_Continue;

    if(
GetVectorDistance(impactinfo[attacker].posdamagePosition) <= 0.0)
        return 
Plugin_Continue;

    
damage *= 1.5;

    
//PrintToServer("OnTakeDamageAlive %f %i %i\n%f %f %f\n", damage, victim, attacker,
    //                                        damagePosition[0],
    //                                        damagePosition[1],
    //                                        damagePosition[2]);
    //

    
return Plugin_Changed;

Doesn't this only apply to wallbang damage?
debr1s is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 09-07-2022 , 12:14   Re: [CSGO] Plugin to Edit Wallbang Damage
Reply With Quote #5

if distance from first bullet impact
to victim damageposition
is greater than 0.0 unit,
it increase damage 50%

*edit
For debugin, uncomment PrintToSever bottom of code.
You see messages on server console when this behavioud actually happens what I explain above.
__________________
Do not Private Message @me

Last edited by Bacardi; 09-07-2022 at 12:16.
Bacardi 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:54.


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