AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   No fall damage (Eliminates damage from falling!!) (https://forums.alliedmods.net/showthread.php?t=23824)

v3x 02-01-2006 18:29

No fall damage (Eliminates damage from falling!!)
 
1 Attachment(s)
No Fall Damage v0.2 - by v3x

Description:
This plugin simply allows you to control whether or not there is damage from falling to the ground.

Cvars:
mp_falldamage 0
0 - No fall damage
1 - Fall damage


Required Modules:
- Engine

Changelog:
v0.2 - Fixed run time error(s)
v0.1 - Initial release

Note: You probably WILL have to put the cvar in a config file even though the default is 0! I do not know why it does this, sorry.

Credit to leakgfhp for some of the code.

Enjoy! :D

SweatyBanana 02-01-2006 18:34

yet another good plugin based from a suggestion :o

SweatyBanana 02-01-2006 18:38

Ohh...and i have a suggestion for this...

make it have a cvar where u can set the distance ppl can fall from without getting hurt (different from mp_falldamage).

IDK if its a good idea, just something I would like.

eFrigid 02-01-2006 18:57

Nice!

Xanimos 02-01-2006 19:51

If I was on plugin team I would have approved it by now.

v3x 02-01-2006 23:12

Thanks for the positive feedback! :D

Quote:

Originally Posted by SweatyBanana
Ohh...and i have a suggestion for this...

make it have a cvar where u can set the distance ppl can fall from without getting hurt (different from mp_falldamage).

IDK if its a good idea, just something I would like.

Find out the easiest way to get the fall distance and I shall implement it ;)

VEN 02-02-2006 07:17

Code:
// max fall height implementation and reconnect runtime error fix #include <amxmodx> #include <engine> #define FALL_VELOCITY 350.0 #define MAX_FALL_HEIGHT 250 // player would get hurt if he falled over greater height new g_start_falling_height[33] new bool:g_height_reached[33]; public plugin_init() {   register_plugin("No fall damage", "0.1", "v3x");   if(!cvar_exists("mp_falldamage")) {     register_cvar("mp_falldamage", "0");   } } new bool:falling[33]; public client_PreThink(id) {   if(get_cvar_num("mp_falldamage") == 0 && is_user_alive(id)) {     if(entity_get_float(id, EV_FL_flFallVelocity) >= FALL_VELOCITY) {       if(g_height_reached[id])         return       new origin[3]       get_user_origin(id, origin)       if(!falling[id]) {         //server_print("DEBUG: [%d] Start falling at height [%d]", id, origin[2])         falling[id] = true         g_start_falling_height[id] = origin[2]       }       else if(g_start_falling_height[id] - origin[2] > MAX_FALL_HEIGHT) {         /*     server_print("DEBUG: [%d] MAX FALL HEIGHT is reached at height [%d]. Height difference [%d]",     id, origin[2], g_start_falling_height[id] - origin[2])         */     falling[id] = false;         g_height_reached[id] = true       }     } else {       falling[id] = false;       g_height_reached[id] = false     }   } } public client_PostThink(id) {   if(get_cvar_num("mp_falldamage") == 0) {     if(falling[id]) {       entity_set_int(id, EV_INT_watertype, -3);     }   } }

[SS] Oxygen 02-02-2006 07:19

Erm..Just one question..
Does it work for the worldspawn thing (or sometihng i dunno)

Like those maps where there is no floor or something
then there is the ending point at the bottom where you ab-so-lute-ly have to die.
Will you die there?

VEN 02-02-2006 07:21

You'll die because of touching to trigger_hurt entity.
It's absolutely velocity independent.

[SS] Oxygen 02-02-2006 07:22

Just asking..these trigger_hurt entities are the destroyable by those entity destroying plugins?


All times are GMT -4. The time now is 09:29.

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