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

jolt player from damag


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Sutar
Senior Member
Join Date: Sep 2010
Old 10-04-2013 , 12:37   jolt player from damag
Reply With Quote #1

How to lock the player shaking and falling blood?

Code:
#include <amxmodx>
#include <hamsandwich>

public plugin_init() 
{
	register_plugin("The Players Function", "1.5", "Sutar")
	
	RegisterHam(Ham_TakeDamage, "player", "cmdDamage", 0)
}

public cmdDamage(victim, inflictor, attacker, Float:dmg, damagebits)
{
	if(get_user_team(victim) == get_user_team(attacker))
		//Blocking blood and shaking
		return HAM_SUPERCEDE

	return HAM_IGNORED
}
Sutar is offline
~Ice*shOt
Veteran Member
Join Date: Mar 2009
Location: Lithuania
Old 10-04-2013 , 13:05   Re: jolt player from damag
Reply With Quote #2

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

#define IsPlayer(%1) (1 <= %1 <= MaxPlayers)

new boolBlockDamage

new MaxPlayers

public plugin_init()
{
    
RegisterHam(Ham_TakeDamage"player""Fwd_TakeDamage")
    
RegisterHam(Ham_TraceAttack"player""Fwd_TraceAttack")

    
MaxPlayers get_maxplayers()
}

public 
Fwd_TakeDamage(VictimInflictorAttackerFloatDamageDamageBits)
{
    if (!
IsPlayer(Attacker) || Victim == Attacker)
        return 
HAM_IGNORED

    
if (BlockDamage)
        return 
HAM_SUPERCEDE

    
return HAM_IGNORED
}

public 
Fwd_TraceAttack(VictimAttackerFloatDamageFloatDirection[3], TraceHandleDamageBits)
{
    if (
Victim == Attacker || !IsPlayer(Attacker))
        return 
HAM_IGNORED

    
if (BlockDamage)
        return 
HAM_SUPERCEDE

    
return HAM_IGNORED

Set BlockDamage to true/false when you need
~Ice*shOt is offline
Send a message via Skype™ to ~Ice*shOt
Sutar
Senior Member
Join Date: Sep 2010
Old 10-04-2013 , 13:27   Re: jolt player from damag
Reply With Quote #3

You can block all but the damage to the head?
Sutar is offline
~Ice*shOt
Veteran Member
Join Date: Mar 2009
Location: Lithuania
Old 10-04-2013 , 13:59   Re: jolt player from damag
Reply With Quote #4

if You want to block damage just to head/or no check hit zones.
~Ice*shOt is offline
Send a message via Skype™ to ~Ice*shOt
Sutar
Senior Member
Join Date: Sep 2010
Old 10-04-2013 , 14:11   Re: jolt player from damag
Reply With Quote #5

TraceHandle need check?

Code:
if(TraceHandle == 2)
...
Sutar 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 06:37.


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