AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   fall damage sound (https://forums.alliedmods.net/showthread.php?t=164328)

avril-lavigne 08-10-2011 06:29

fall damage sound
 
I know there are alot of no fall damage plugin. but I want just play sound on landing

not just usual landing after jump . but after falling down

I know how to get fall event

PHP Code:


#define FALL_VELOCITY 350

if(entity_get_float(idEV_FL_flFallVelocity) >= FALL_VELOCITY) { 


but what shoud I register .. event damage. or what.

Doc-Holiday 08-10-2011 06:34

Re: fall damage sound
 
Quote:

Originally Posted by avril-lavigne (Post 1529460)
I know there are alot of no fall damage plugin. but I want just play sound on landing

not just usual landing after jump . but after falling down

I know how to get fall event

PHP Code:


#define FALL_VELOCITY 350

if(entity_get_float(idEV_FL_flFallVelocity) >= FALL_VELOCITY) { 

but what shoud I register .. event damage. or what.

Ham_TakeDamge

check the last parameter iDamageBits & DMG_FALL

to eliminate falldamage
PHP Code:

public fwdPlayerHurt(iVictimiInflictoriAttackerFloat:flDamageiDamageBits)
{
     if(
iDamageBits DMG_FALL)
     {
          return 
HAM_SUPERCEDE;
     }



avril-lavigne 08-10-2011 06:46

Re: fall damage sound
 
ok thanks.

Bugsy 08-10-2011 13:03

Re: fall damage sound
 
If you only want to replace fall sound when the player falls and gets damage then you can hook FM_EmitSound for when the normal fall damage sound is played and replace it with your sound.

ConnorMcLeod 08-10-2011 13:47

Re: fall damage sound
 
Quote:

Originally Posted by Bugsy (Post 1529686)
If you only want to replace fall sound when the player falls and gets damage then you can hook FM_EmitSound for when the normal fall damage sound is played and replace it with your sound.

Correct, also TakeDamage could be triggered after the sound so it would be useless to hook it.

Doc-Holiday 08-10-2011 14:22

Re: fall damage sound
 
Quote:

Originally Posted by ConnorMcLeod (Post 1529720)
Correct, also TakeDamage could be triggered after the sound so it would be useless to hook it.

He asked ho to block it too

Bugsy 08-10-2011 14:57

Re: fall damage sound
 
He says he is aware of no fall damage plugins BUT just wants to play sound on landing.

Doc-Holiday 08-10-2011 15:40

Re: fall damage sound
 
Quote:

Originally Posted by Bugsy (Post 1529782)
He says he is aware of no fall damage plugins BUT just wants to play sound on landing.

I miss read that last partmy bad.

avril-lavigne 08-11-2011 13:28

Re: fall damage sound
 
I need code to create fall damage ratio
example
dmg * 0.8 = 80% of fall damage

I need to get fall dmg its easy , then how to reduce it

katna 08-11-2011 13:54

Re: fall damage sound
 
Check Exolent Xp Mod to see


All times are GMT -4. The time now is 03:30.

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