Raised This Month: $ Target: $400
 0% 

[SOLVED] [TF2] Remove Soldier Self Damage??


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SM9
Veteran Member
Join Date: Sep 2013
Location: United Kingdom
Old 08-04-2014 , 05:46   [SOLVED] [TF2] Remove Soldier Self Damage??
Reply With Quote #1

Is there a possibility that this can be done? I tried using SDKHooks but it breaks the rocket jumping at same time.

Thanks

Last edited by SM9; 08-04-2014 at 07:36. Reason: Solved.
SM9 is offline
floube
SourceMod Donor
Join Date: Jan 2013
Location: Austria
Old 08-04-2014 , 05:58   Re: [TF2] Remove Soldier Self Damage??
Reply With Quote #2

Try these (probably in the player_spawn event hook or OnClientPutInServer), should work AFAIK.

Disable damage:
PHP Code:
SetEntProp(iClientProp_Data"m_takedamage"1); 
Re-enable damage:
PHP Code:
SetEntProp(iClientProp_Data"m_takedamage"2); 
__________________
floube is offline
SM9
Veteran Member
Join Date: Sep 2013
Location: United Kingdom
Old 08-04-2014 , 06:54   Re: [TF2] Remove Soldier Self Damage??
Reply With Quote #3

Edit: It works but it also stops other players damaging him.

Thanks.

Last edited by SM9; 08-04-2014 at 07:36.
SM9 is offline
keyboard1333
Senior Member
Join Date: Aug 2013
Old 08-08-2014 , 05:04   Re: [SOLVED] [TF2] Remove Soldier Self Damage??
Reply With Quote #4

PHP Code:
#pragma semicolon 1
#include <sourcemod>
#include <tf2attributes>
#include <tf2_stocks>

public OnPluginStart()
{
    
HookEvent("post_inventory_application"Event_PostApp);
}

public 
Event_PostApp(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    new 
TFClassType:class = TF2_GetPlayerClass(client);
    if(
IsValidClient(client) && class == TFClass_Soldier)
    {
        
TF2Attrib_SetByName(client"blast dmg to self increased"0.00);    
    }
}

stock IsValidClient(clientbool:replaycheck true)
{
    if (
client <= || client MaxClients) return false;
    if (!
IsClientInGame(client)) return false;
    if (
GetEntProp(clientProp_Send"m_bIsCoaching")) return false;
    if (
replaycheck)
    {   
        if (
IsClientSourceTV(client) || IsClientReplay(client)) return false;
    }
    return 
true;

keyboard1333 is offline
Oshizu
Veteran Member
Join Date: Nov 2012
Location: Warsaw
Old 08-08-2014 , 08:49   Re: [SOLVED] [TF2] Remove Soldier Self Damage??
Reply With Quote #5

Also for above script to work you may need TF2Attributes Plugin .
__________________
...
Oshizu 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 10:38.


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