Raised This Month: $ Target: $400
 0% 

Edit falldamage


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
zapparncsgo
Senior Member
Join Date: Dec 2014
Old 07-28-2016 , 09:51   Edit falldamage
Reply With Quote #1

Hello, Is there any way to increase the fall damage, couldn't find anything about it on here. Could only find threads about removing it. Any pointers would be nice!
zapparncsgo is offline
mavemaniac
Junior Member
Join Date: Apr 2016
Old 07-28-2016 , 09:53   Re: Edit falldamage
Reply With Quote #2

I've been looking for something like this aswell! Trying to simulate the 1.6 fall damage!
mavemaniac is offline
shavit
AlliedModders Donor
Join Date: Dec 2011
Location: Israel
Old 07-28-2016 , 10:49   Re: Edit falldamage
Reply With Quote #3

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

#pragma semicolon 1

#pragma newdecls required

public void OnClientPutInServer(int client)
{
	SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamage);
}

public Action OnTakeDamage(int victim, int &attacker, int &inflictor, float &damage, int &damagetype)
{
	if(damagetype & DMG_FALL)
	{
		damage /= 1.5;

		return Plugin_Changed;
	}

	return Plugin_Continue;
}
will divide falldamage by 1.5
__________________
retired

Last edited by shavit; 07-28-2016 at 12:31.
shavit is offline
Nursik
Senior Member
Join Date: Jul 2016
Location: In TF2
Old 07-28-2016 , 11:08   Re: Edit falldamage
Reply With Quote #4

Also use * instead of slash to use multiplying instead of dividing.
Nursik is offline
xerox8521
Senior Member
Join Date: Sep 2011
Old 07-28-2016 , 11:12   Re: Edit falldamage
Reply With Quote #5

damagetype is a bitflag so you should check it with
PHP Code:
if(damagetype DMG_FALL
xerox8521 is offline
shavit
AlliedModders Donor
Join Date: Dec 2011
Location: Israel
Old 07-28-2016 , 12:31   Re: Edit falldamage
Reply With Quote #6

Quote:
Originally Posted by xerox8521 View Post
damagetype is a bitflag so you should check it with
PHP Code:
if(damagetype DMG_FALL
whoops, updated
__________________
retired
shavit 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 03:14.


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