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

Stopping sticky damage plugin failing to work


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
iSimon
Junior Member
Join Date: Aug 2010
Old 10-24-2010 , 19:50   Stopping sticky damage plugin failing to work
Reply With Quote #1

The plugin has no errors when compiling, but fails once tested. Damage doesnt change.

The plugin is to make it so stickybombs do not do damage. (for jumping im guessing)

Can you guys spot anything wrong?

Requires sdkhooks

PHP Code:
#include <sourcemod>
#include <sdkhooks>
 
public Plugin:myinfo =
{
    
name "Stickybomb Damage Blocker",
    
author "iSimon",
    
description "Stop's Demoman Stickybomb Damage",
    
version "1.0.0.0",
    
url "http://www.sourcemod.net/"
};

new 
Handle:sm_stopsticky_damage INVALID_HANDLE

public OnPluginStart()
{
    
sm_stopsticky_damage CreateConVar("sm_stopsticky_damage""0""No sticky damage")
    
AutoExecConfig(true"plugin_stopsticky")
}

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

public 
Action:OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype)
{
    if (
GetConVarBool(sm_stopsticky_damage))
    {
        return 
Plugin_Continue;
    }
    
decl String:sWeapon[32];
    
GetEdictClassname(inflictorsWeaponsizeof(sWeapon));
    
    if(
StrEqual(sWeapon"tf_weapon_pipebomblauncher"))
    {
        
damage 0.0;
        return 
Plugin_Changed;
    }
    
    return 
Plugin_Continue;

iSimon is offline
Send a message via MSN to iSimon Send a message via Skype™ to iSimon
iSimon
Junior Member
Join Date: Aug 2010
Old 10-24-2010 , 19:55   Re: Stopping sticky damage plugin failing to work
Reply With Quote #2

If someone could please move this out of the AMX section, i'd appreciate it
iSimon is offline
Send a message via MSN to iSimon Send a message via Skype™ to iSimon
DarthNinja
SourceMod Plugin Approver
Join Date: Mar 2009
Location: PreThinkHook()
Old 10-24-2010 , 19:55   Re: Stopping sticky damage plugin failing to work
Reply With Quote #3

PHP Code:
#include <sourcemod>
#include <sdkhooks>
 
public Plugin:myinfo =
{
    
name "Stickybomb Damage Blocker",
    
author "iSimon",
    
description "Prevents Demoman Stickybomb Damage",
    
version "1.0.0.0",
    
url "http://www.sourcemod.net/"
};

new 
Handle:vEnable INVALID_HANDLE

public OnPluginStart()
{
    
vEnable CreateConVar("sm_stopsticky_damage""0""No sticky damage")
}

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

public 
Action:OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype)
{
    if (!
GetConVarBool(vEnable))
    {
        return 
Plugin_Continue;
    }
    
decl String:sWeapon[32];
    
GetEdictClassname(inflictorsWeaponsizeof(sWeapon));
    
    if(
StrEqual(sWeapon"tf_weapon_pipebomblauncher"))
    {
        
//damage = 0.0;
        
return Plugin_Handled;
    }
    
    return 
Plugin_Continue;

Also:
Code:
[21:27] <@psychonic> inflictor would be the sticky
[21:27] <@psychonic> not the sticky launcher
__________________

Last edited by DarthNinja; 10-24-2010 at 21:31.
DarthNinja is offline
iSimon
Junior Member
Join Date: Aug 2010
Old 10-25-2010 , 07:02   Re: Stopping sticky damage plugin failing to work
Reply With Quote #4

Ahh so it's the wrong weapon, I see.

I'll try when I get home from school
iSimon is offline
Send a message via MSN to iSimon Send a message via Skype™ to iSimon
tigerox
AlliedModders Donor
Join Date: Oct 2008
Location: Canada
Old 10-25-2010 , 14:49   Re: Stopping sticky damage plugin failing to work
Reply With Quote #5

Instead of hooking OnTakeDamage for each client, just look at the sticky bombs.

This should work.

PHP Code:
#include <sourcemod>
#include <sdkhooks>
 
public Plugin:myinfo =
{
    
name "Stickybomb Damage Blocker",
    
author "iSimon",
    
description "Prevents Demoman Stickybomb Damage",
    
version "1.0.0.0",
    
url "http://www.sourcemod.net/"
};

new 
Handle:vEnable INVALID_HANDLE

public OnPluginStart()
{
    
vEnable CreateConVar("sm_stopsticky_damage""0""No sticky damage")
}

public 
OnEntityCreated(iSticky, const String:classname[])
{
    if(
GetConVarBool(vEnable) && StrEqual(classname"tf_projectile_pipe_remote"))
    {
        
SDKHook(iStickySDKHook_StartTouchStickyTouch);
    }
    
}

public 
StickyTouch(iSticky)
{
    
SetEntPropFloat(iStickyProp_Send"m_flDamage"0.0);

__________________

Last edited by tigerox; 10-25-2010 at 14:53.
tigerox is offline
iSimon
Junior Member
Join Date: Aug 2010
Old 10-26-2010 , 22:43   Re: Stopping sticky damage plugin failing to work
Reply With Quote #6

Thank you for the assistance, ive fixed things up
iSimon is offline
Send a message via MSN to iSimon Send a message via Skype™ to iSimon
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 08:41.


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