Raised This Month: $ Target: $400
 0% 

Eye for an Eye!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
RollerBlades
Senior Member
Join Date: Feb 2011
Location: Sweden
Old 07-05-2011 , 05:25   Eye for an Eye!
Reply With Quote #1

is there a plugin wich has Eye for an Eye feature?? i need that for my plugin
RollerBlades is offline
Aykay
Senior Member
Join Date: Jul 2009
Location: Australia
Old 07-05-2011 , 08:02   Re: Eye for an Eye!
Reply With Quote #2

Explain what Eye for an Eye is?
__________________

Aykay is offline
Send a message via MSN to Aykay
RollerBlades
Senior Member
Join Date: Feb 2011
Location: Sweden
Old 07-05-2011 , 08:12   Re: Eye for an Eye!
Reply With Quote #3

have you ever heard the sentence: "if you do bad things then bad things will happen to you".. its the same thing as saying an "Eye for an Eye"

im look for something like if you shoot me you will also be shoot with the same amount off health loss.
RollerBlades is offline
NozerO
Member
Join Date: Jun 2011
Location: NozerO My Couch
Old 07-05-2011 , 08:41   Re: Eye for an Eye!
Reply With Quote #4

Try This
Reflect Chance v1.3b

__________________

NozerO is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 07-05-2011 , 09:41   Re: Eye for an Eye!
Reply With Quote #5

PHP Code:
#include <amxmodx>
#include <csx>
#include <fun>

public plugin_init()
{
    
register_plugin("Eye for an eye""1.0""Jelle")
}

public 
client_damage(attackervictimdamage)
{
    if ( 
victim == attacker ) return
    
    
set_user_health(attackerget_user_health(attacker) - damage)

__________________
No idea what to write here...

Last edited by Jelle; 07-05-2011 at 11:51.
Jelle is offline
Send a message via MSN to Jelle
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-05-2011 , 09:58   Re: Eye for an Eye!
Reply With Quote #6

Quote:
Originally Posted by Jelle View Post
PHP Code:
#include <amxmodx>
#include <csx>
#include <fun>

public plugin_init()
{
    
register_plugin("Eye for an eye""1.0""Jelle")
}

public 
client_damage(attackervictimdamage)
{
    if ( 
victim == attacker ) return
    
    
set_user_health(attackerdamage)

With this, when when the attacker deals 20 damage, his health will be set to 20. When the attacker does another 20 damage, his health will be reset to 20.

I would probably hook Ham_TakeDamage then execute Ham_TakeDamage on the attacker with the same amount of damage.
__________________
fysiks is online now
RollerBlades
Senior Member
Join Date: Feb 2011
Location: Sweden
Old 07-05-2011 , 11:06   Re: Eye for an Eye!
Reply With Quote #7

i have no experience with ham what so ever, so dont be to hard on me...


heres my code:

1.
Code:
#include <amxmodx> #include <hamsandwich> #include <fun> public plugin_init() {     register_plugin("Eye for an Eye", "1.1", "Jelle/RB");         RegisterHam(Ham_TakeDamage, "player", "Karma_Payback"); } public Karma_Payback(attacker, inflictor, victim, damage, damagebits) {     if ( victim == attacker || !is_user_alive(attacker) || !is_user_connected(victim) ) return HAM_IGNORED;         ExecuteHamB(Ham_TakeDamage, victim, inflictor, attacker, set_user_health(attacker, get_user_health(attacker) - damage), damagebits);         return HAM_IGNORED; }

2.
Code:
#include <amxmodx> #include <hamsandwich> #include <fun> public plugin_init() {     register_plugin("Eye for an Eye", "1.1", "Jelle/RB");         RegisterHam(Ham_TakeDamage, "player", "Karma_Payback"); } public Karma_Payback(attacker, inflictor, victim, damage, damagebits) {     if ( victim == attacker || !is_user_alive(attacker) || !is_user_connected(victim) ) return HAM_IGNORED;         ExecuteHamB(Ham_TakeDamage, victim, inflictor, attacker, damage, damagebits);         set_user_health(attacker, get_user_health(attacker) - damage);         return HAM_IGNORED; }



Last edited by RollerBlades; 07-05-2011 at 12:20.
RollerBlades is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 07-05-2011 , 11:48   Re: Eye for an Eye!
Reply With Quote #8

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

public plugin_init()
{
    	register_plugin("Eye for an Eye", "1.1", "Jelle/RB");
    
    	RegisterHam(Ham_TakeDamage, "player", "Karma_Payback");
}

public Karma_Payback(attacker, inflictor, victim, Float:damage, damagebits)
{
    	if ( victim == attacker || !is_user_alive(attacker) || !is_user_connected( victim ) ) return HAM_IGNORED;
    
    	ExecuteHamB( Ham_TakeDamage, victim, inflictor, attacker, damage, damagebits );
    
    	return HAM_IGNORED;
}
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 07-05-2011 , 11:51   Re: Eye for an Eye!
Reply With Quote #9

Edited mine. It should work as you want it to.
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
RollerBlades
Senior Member
Join Date: Feb 2011
Location: Sweden
Old 07-05-2011 , 11:54   Re: Eye for an Eye!
Reply With Quote #10

Final Code??
Code:
#include <amxmodx> #include <hamsandwich> #include <fun> public plugin_init() {     register_plugin("Eye for an Eye", "1.1", "Jelle/RB");         RegisterHam(Ham_TakeDamage, "player", "Karma_Payback"); } public Karma_Payback(attacker, inflictor, victim, damage, damagebits) {     if ( victim == attacker || !is_user_alive(attacker) || !is_user_connected(victim) ) return HAM_IGNORED;         ExecuteHamB(Ham_TakeDamage, victim, inflictor, attacker, damage, damagebits);         SetHamParamEntity( get_user_health(attacker), set_user_health(attacker, get_user_health(attacker) - damage) );         return HAM_IGNORED; }

i think im doing it the wrong way but i will test it

Last edited by RollerBlades; 07-05-2011 at 12:21. Reason: Wrong, it changes values on parameters that are string...
RollerBlades 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 23:11.


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