Raised This Month: $ Target: $400
 0% 

old origin (fall damage)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
raizo11
BANNED
Join Date: Dec 2013
Location: https://t.me/pump_upp
Old 12-31-2018 , 06:00   Re: old origin (fall damage)
Reply With Quote #2

Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "raizo"

new his_position[33][3]
new last_position[33][3]

new maxplayers

public plugin_init() 
{
    register_plugin(PLUGIN, VERSION, AUTHOR)
    
    RegisterHam(Ham_TakeDamage, "player", "Player_TakeDamage", false);

    maxplayers = get_maxplayers();

    set_task(1.0,"update",0,"",0,"b",0)

}

public update()
{
    for(new id;id < maxplayers;id++)
    {
        if(is_user_alive(id))
	{
            check(id)
        }
    }
}

public Player_TakeDamage(id, iInflictor, iAttacker, Float: fDamage, bitsDamageType) 
{
    if(!is_user_connected(id)) 
    { 
        return HAM_IGNORED;
    }
    
    if(bitsDamageType & DMG_FALL && fDamage >= pev(id, pev_health)) 
    {
        move_to_check(id)
        return HAM_SUPERCEDE;
    }
    
    return HAM_IGNORED;
}

stock move_to_check(id) 
{
	set_pev(id, pev_origin, his_position[id])
}

public check(id)
{
    if(is_user_alive(id))
    {
        if(!(pev(id, pev_flags) & FL_ONGROUND))
	{
	    return PLUGIN_HANDLED;
	}
	last_position[id][0] = his_position[id][0]
        last_position[id][1] = his_position[id][1]
	last_position[id][2] = his_position[id][2]
	pev(id, pev_origin, his_position[id])
	his_position[id][2] += 5
	return PLUGIN_HANDLED;
    }
    return PLUGIN_HANDLED;
}
raizo11 is offline
Send a message via ICQ to raizo11 Send a message via AIM to raizo11 Send a message via MSN to raizo11 Send a message via Yahoo to raizo11 Send a message via Skype™ to raizo11
 



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


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