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

[REQ] No Water Damage (No Drowning)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
rockstar248
Junior Member
Join Date: Aug 2013
Old 06-03-2017 , 09:53   [REQ] No Water Damage (No Drowning)
Reply With Quote #1

Hello AlliedModders,
I search alot but i could not found any plugin that disables water damage...
Can anyone make a plugin like that or suggest me any plugin as an alternative?

Thankyou .
rockstar248 is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 06-03-2017 , 09:58   Re: [REQ] No Water Damage (No Drowning)
Reply With Quote #2

Exolent code:
PHP Code:
#include <amxmodx>
#include <hamsandwich>

#define DMG_DROWN (1<<14)

public plugin_init()
{
    
register_plugin("No Drown Damage""0.1""Exolent");
    
RegisterHam(Ham_TakeDamage"player""fwd_Ham_TakeDamage");
}

public 
fwd_Ham_TakeDamage(thisinflictorattackerFloat:fDamagebitDamage)
{
    if(
is_user_alive(this) && (bitDamage DMG_DROWN))
    {
        
SetHamParamFloat(40.0);
    }
    return 
HAM_IGNORED;

__________________
Project: Among Us

Last edited by Craxor; 06-03-2017 at 10:00.
Craxor is offline
Send a message via ICQ to Craxor
rockstar248
Junior Member
Join Date: Aug 2013
Old 06-03-2017 , 10:07   Re: [REQ] No Water Damage (No Drowning)
Reply With Quote #3

Quote:
Originally Posted by Craxor View Post
Exolent code:
PHP Code:
#include <amxmodx>
#include <hamsandwich>

#define DMG_DROWN (1<<14)

public plugin_init()
{
    
register_plugin("No Drown Damage""0.1""Exolent");
    
RegisterHam(Ham_TakeDamage"player""fwd_Ham_TakeDamage");
}

public 
fwd_Ham_TakeDamage(thisinflictorattackerFloat:fDamagebitDamage)
{
    if(
is_user_alive(this) && (bitDamage DMG_DROWN))
    {
        
SetHamParamFloat(40.0);
    }
    return 
HAM_IGNORED;

Worked Thanks !
rockstar248 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 06-03-2017 , 18:49   Re: [REQ] No Water Damage (No Drowning)
Reply With Quote #4

You can just do "return bitDamage & DMG_DROWN ? HAM_SUPERCEDE : HAM_IGNORED"
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 06-08-2017 , 11:19   Re: [REQ] No Water Damage (No Drowning)
Reply With Quote #5

why micro-optimizating the source just for some insignificant details wich are readability-only and not about the code functionality ?
__________________
Project: Among Us

Last edited by Craxor; 06-08-2017 at 11:20.
Craxor is offline
Send a message via ICQ to Craxor
DjSoftero
Veteran Member
Join Date: Nov 2014
Location: Lithuania
Old 06-08-2017 , 12:03   Re: [REQ] No Water Damage (No Drowning)
Reply With Quote #6

Quote:
Originally Posted by Craxor View Post
why micro-optimizating the source just for some insignificant details wich are readability-only and not about the code functionality ?
little after little and whole server is gonna be piece of crap
__________________
retired chump
DjSoftero 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 11:17.


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