Raised This Month: $7 Target: $400
 1% 

R Bullet


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ImXinR
Member
Join Date: Dec 2010
Old 01-17-2011 , 03:27   R Bullet
Reply With Quote #1

Reflection of dmg

Last edited by ImXinR; 02-08-2011 at 03:53.
ImXinR is offline
Elusive138
Senior Member
Join Date: Dec 2010
Old 01-17-2011 , 07:34   Re: Bullet Damage Reflector
Reply With Quote #2

This should be in the Plugin Requests section...

Anyway.
Untested.

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

#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>

#define PLUGIN "Damage Reflector"
#define VERSION "1.0"
#define AUTHOR "Elusive"

#define ACCESSLEVEL ADMIN_SLAY


//Thanks Bugsy
//Example: SetPlayerBit( BitFieldVar , # )
#define SetPlayerBit(%1,%2)      (%1 |= (1<<(%2&31)))
#define ClearPlayerBit(%1,%2)    (%1 &= ~(1 <<(%2&31)))
#define CheckPlayerBit(%1,%2)    (%1 & (1<<(%2&31)))

new gReflectbool:gRoundEnd


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_concmd("amx_reflect""CmdToggleReflect"ACCESSLEVEL"name or #userid")
    
RegisterHam(Ham_TakeDamage"player""FwdHamTakeDamage")
    
register_logevent("EventRoundStart"2"1=Round_Start")  
    
register_logevent("EventRoundEnd"2"1=Round_End")
}

public 
CmdToggleReflect(idlevelcid)
{
    if (!
cmd_access(idlevelcid2))
        return 
PLUGIN_CONTINUE
    
    
new args[32]
    
read_args(argscharsmax(args))
    
    new 
target cmd_target(idargsCMDTARGET_ALLOW_SELF)
    if (
CheckPlayerBit(gReflecttarget))
    {
        
ClearPlayerBit(gReflecttarget)
    }
    else
    {
        
SetPlayerBit(gReflecttarget)
    }
    
    return 
PLUGIN_HANDLED
}

public 
FwdHamTakeDamage(thisidinflictoridattacker)
{
    if (!
gRoundEnd && CheckPlayerBit(gReflectthis))
    {
        
SetHamParamEntity(1idattacker)
        
SetHamParamEntity(3this)
    }
}

public 
EventRoundStart()
{
    
gRoundEnd false
}

public 
EventRoundEnd()
{
    
gRoundEnd true


Last edited by Elusive138; 01-18-2011 at 02:48. Reason: Set integer istead of entity... stupid me
Elusive138 is offline
ANTICHRISTUS
kingdom of weird stuff
Join Date: Jun 2010
Location: My kingdom is not in thi
Old 01-17-2011 , 09:25   Re: Bullet Damage Reflector
Reply With Quote #3

Quote:
Originally Posted by Elusive138 View Post
This should be in the Plugin Requests section...
try this too:
https://forums.alliedmods.net/showth...=mirror+damage
https://forums.alliedmods.net/showth...=mirror+damage
__________________
ANTICHRISTUS is offline
Elusive138
Senior Member
Join Date: Dec 2010
Old 01-17-2011 , 10:10   Re: Bullet Damage Reflector
Reply With Quote #4

The first is (probably) to reflect team attacks, the second is called a spawnkill punishment for a reason. Did you even read the whole post(s)?
Elusive138 is offline
ImXinR
Member
Join Date: Dec 2010
Old 01-18-2011 , 04:10   Re: Bullet Damage Reflector
Reply With Quote #5

Thanks! That works.

Last edited by ImXinR; 01-28-2011 at 21:48.
ImXinR 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 06:29.


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