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

Fall Damage


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Kensai
Veteran Member
Join Date: Aug 2005
Location: San Diego, California
Old 11-26-2005 , 13:30   Fall Damage
Reply With Quote #1

Is there a way to eliminate fall damage?
Kensai is offline
Send a message via AIM to Kensai Send a message via MSN to Kensai
haimmaik
Senior Member
Join Date: Jul 2005
Old 11-26-2005 , 13:37  
Reply With Quote #2

yes...
on event damage

Code:
public dmg(id){   new weapon, bodypart, attacker = get_user_attacker(id,weapon,bodypart)   if(attacker==id) // it means that u hit urself (can b only falling damage)   new damage = read_data(2) //here u got the damage }
haimmaik is offline
Kensai
Veteran Member
Join Date: Aug 2005
Location: San Diego, California
Old 11-26-2005 , 13:52  
Reply With Quote #3

Ah okay, so if the attacker is yourself aka you kill yourself from falling, you don't die?

I'm not sure I get your code. I want it so when ANYONE falls the don't get hurt at all, but I don't want like godmode.
Kensai is offline
Send a message via AIM to Kensai Send a message via MSN to Kensai
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 11-26-2005 , 14:28  
Reply With Quote #4

I implemented this to some extent in my surf plugin. The only difference is that I was doing the opposite of what you're trying to do.

Code:
    register_event("ResetHUD","check_hp","be");     register_event("Damage","check_hp","b");

Code:
public check_hp(id) {     if(!get_cvar_num("surf_on"))     {         return 0;     }         new cvar_hp = get_cvar_num("surf_hp");         if(cvar_hp == 0 || surfmap == false || !is_user_alive(id))     {         return 0;     }         new damage = read_data(2), attacker = get_user_attacker(id);         if(attacker != id && get_user_health(id) < cvar_hp )     {         set_user_health(id,cvar_hp);     }     else if(damage > 100)     {         user_kill(id,0);     }         return 0; }

EDIT: surf_hp is declared as 1124, and you can just remove the surf_on part.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Freecode
Never Fall Asleep
Join Date: Jan 2004
Old 11-26-2005 , 15:42  
Reply With Quote #5

umm fall damage would be done by world and world == 0
so if (attacker == 0)
Freecode is offline
Kensai
Veteran Member
Join Date: Aug 2005
Location: San Diego, California
Old 11-26-2005 , 15:52  
Reply With Quote #6

Ok, so how would that look?

Something like this?

Code:
    if(attacker = 0 && get_user_health(id) < cvar_hp)

But I don't want any cvars or anything. Lol I'm confused.
Kensai is offline
Send a message via AIM to Kensai Send a message via MSN to Kensai
Freecode
Never Fall Asleep
Join Date: Jan 2004
Old 11-26-2005 , 16:22  
Reply With Quote #7

just
Code:
if( attacker == 0) {      //Add in the damage back to the HP here }
Freecode is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 11-26-2005 , 18:39  
Reply With Quote #8

This is leakgfhp's:

Code:
#include <amxmodx>  #include <engine>  new bool:Falling[33]  public plugin_init() {     register_plugin("No Fall Damage","0.1","Nobody");  }  public client_PreThink(id) {     if(entity_get_float(id, EV_FL_flFallVelocity) >= 350.0) {         Falling[id] = true     }  }  public client_PostThink(id) {     if(Falling[id]) {         entity_set_int(id, EV_INT_watertype, -3)         Falling[id] = false     }  }

350.0 is Half-Life's default value, Counter- Strike may have a custom one.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX 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:58.


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