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

No Fall Damage


Post New Thread Reply   
 
Thread Tools Display Modes
Author
pa1nq3
Junior Member
Join Date: Aug 2010
Plugin ID:
1965
Plugin Version:
1.0
Plugin Category:
Gameplay
Plugin Game:
Counter-Strike: Source
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    No Fall Damage
    Old 09-22-2010 , 02:17   No Fall Damage
    Reply With Quote #1

    I used the code provided in the script forum.. I credited the author for the use of his code in the plugin..

    The only reason I posted this is because I run a zombiemod server and players falling to their death before the first zombie spawn was causing issues. Also turning mp_falldamage 0 does not work with HL2 or CS:S so I had to get something working. Thanks for the post in the script forums as it works quite well.

    Requires: SDKhooks

    Credits: alexip121093, sourcemod scripting forums.

    I added the compiled version as the compiler on the site does not support sdkhooks
    Attached Files
    File Type: sp Get Plugin or Get Source (nofalldamage.sp - 12566 views - 606 Bytes)
    File Type: smx nofalldamage.smx (2.1 KB, 12051 views)

    Last edited by pa1nq3; 10-09-2010 at 17:18. Reason: added info
    pa1nq3 is offline
    gtamike
    Member
    Join Date: Aug 2009
    Location: UK
    Old 10-09-2010 , 08:14   Re: No Fall Damage
    Reply With Quote #2

    cool
    __________________
    gtamike is offline
    TnTSCS
    AlliedModders Donor
    Join Date: Oct 2010
    Location: Undisclosed...
    Old 05-01-2011 , 10:50   Re: No Fall Damage
    Reply With Quote #3

    can you add a cvar to turn it off or on? That way I can enable it on certain maps and disable it on most others.
    TnTSCS is offline
    TnTSCS
    AlliedModders Donor
    Join Date: Oct 2010
    Location: Undisclosed...
    Old 05-09-2011 , 20:45   Re: No Fall Damage
    Reply With Quote #4

    any update on if you can add a cvar to enable or disable it? that way, I don't have to have it running on every map... just those that players get damaged by falling.
    TnTSCS is offline
    TnTSCS
    AlliedModders Donor
    Join Date: Oct 2010
    Location: Undisclosed...
    Old 05-09-2011 , 21:28   Re: No Fall Damage
    Reply With Quote #5

    I edited it to add a CVAR to enable/disable it, and received compile warning 209, but it still works and now I can turn it on and off.

    //SourceMod Batch Compiler
    // by the SourceMod Dev Team


    //// nofalldamage.sp
    // C:\srcds\orangebox\cstrike\addons\sourcemod\s cripting\nofalldamage.sp(42) : w
    arning 209: function "OnTakeDamage" should return a value
    // Header size: 2192 bytes
    // Code size: 376 bytes
    // Data size: 428 bytes
    // Stack/heap size: 16384 bytes; Total requirements: 19380 bytes
    //
    // 1 Warning.
    //
    // Compilation Time: 0.55 sec
    // ----------------------------------------

    Press enter to exit ...

    I can put the .sp file if you want so you can review and maybe figure out why I'm receiving the warning
    TnTSCS is offline
    Bacardi
    Veteran Member
    Join Date: Jan 2010
    Location: mom's basement
    Old 05-10-2011 , 03:32   Re: No Fall Damage
    Reply With Quote #6

    Quote:
    Originally Posted by TnTSCS View Post
    I edited it to add a CVAR to enable/disable it, and received compile warning 209, but it still works and now I can turn it on and off.



    I can put the .sp file if you want so you can review and maybe figure out why I'm receiving the warning
    added cvar sm_nofalldamage, default value 0 disabled
    PHP Code:
    #pragma semicolon 1

    #include <sourcemod>
    #include <sdktools>
    #include <sdkhooks>

    new Handle:sm_nofalldamage INVALID_HANDLE;
    new 
    bool:nofalldamage;

    #define PLUGIN_VERSION "0.0.1.9"

    public Plugin:myinfo 
    {
        
    name "No Fall Damage",
        
    author "alexip121093",
        
    description "no falling damage",
        
    version PLUGIN_VERSION,
        
    url "www.sourcemod.net"
    }

    public 
    OnPluginStart()
    {
        
    sm_nofalldamage CreateConVar("sm_nofalldamage""0""Enable/disable player fall damage"FCVAR_NONEtrue0.0true1.0);
        
    nofalldamage GetConVarBool(sm_nofalldamage);
        
    HookConVarChange(sm_nofalldamageConVarChanged);
    }

    public 
    ConVarChanged(Handle:convar, const String:oldValue[], const String:newValue[])
    {
        
    nofalldamage GetConVarBool(sm_nofalldamage);
    }

    public 
    OnClientPutInServer(client)
    {
        
    SDKHook(clientSDKHook_OnTakeDamageOnTakeDamage);
    }

    public 
    Action:OnTakeDamage(client, &attacker, &inflictor, &Float:damage, &damagetype)
    {
        if (
    nofalldamage && damagetype DMG_FALL)
        {
            return 
    Plugin_Handled;
        }
        return 
    Plugin_Continue;

    - Then you just add in map config ...maps/cfg/map_name.cfg sm_nofalldamage 1 and reset back sm_nofalldamage 0 from server.cfg

    Last edited by Bacardi; 05-10-2011 at 03:35.
    Bacardi is offline
    TnTSCS
    AlliedModders Donor
    Join Date: Oct 2010
    Location: Undisclosed...
    Old 05-10-2011 , 12:51   Re: No Fall Damage
    Reply With Quote #7

    Thanks a million

    Now I can use a properly edited one instead of mine that had that warning
    TnTSCS is offline
    alencore
    Senior Member
    Join Date: Oct 2011
    Old 04-02-2013 , 01:28   Re: No Fall Damage
    Reply With Quote #8

    nice still working. tnx!
    __________________
    alencore is offline
    stickz
    Senior Member
    Join Date: Oct 2012
    Location: Ontario, Canada
    Old 07-23-2015 , 23:42   Re: No Fall Damage
    Reply With Quote #9

    -Added convar support with transitional syntax. (sm 1.7.x required)
    -Improved code efficiency

    Code:
    #include <sourcemod>
    #include <sdkhooks>
    
    #define PLUGIN_VERSION "0.0.1.9"
    
    ConVar g_NoFallDamage;
    
    public Plugin:myinfo = 
    {
    	name = "No Fall Damage",
    	author = "alexip121093",
    	description = "no falling damage",
    	version = PLUGIN_VERSION,
    	url = "www.sourcemod.net"
    }
    
    #define DMG_FALL   (1 << 5)
    
    public OnPluginStart()
    {
    	g_NoFallDamage = CreateConVar("sm_nofalldamage", "1", "Enable/disable player fall damage", FCVAR_NONE, true, 0.0, true, 1.0);
    }
    
    public OnClientPutInServer(client)
    {
    	SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamage);
    }
    
    public Action:OnTakeDamage(client, &attacker, &inflictor, &Float:damage, &damagetype)
    {
    	return g_NoFallDamage.BoolValue && damagetype & DMG_FALL ? Plugin_Handled : Plugin_Continue;
    }

    Last edited by stickz; 07-23-2015 at 23:49.
    stickz is offline
    SOBgaming
    Senior Member
    Join Date: Jul 2015
    Old 07-18-2016 , 16:05   Re: No Fall Damage
    Reply With Quote #10

    Does this currently work with CS:GO, didn't seem like it?
    __________________
    SOBgaming is offline
    Reply


    Thread Tools
    Display Modes

    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:35.


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