Raised This Month: $ Target: $400
 0% 

Mirror Damage <hamsandwich>


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 03-02-2013 , 10:23   Mirror Damage <hamsandwich>
Reply With Quote #1

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

#define IsPlayer(%0) (1 <= %0 <= g_iMaxPlayers)

new g_iMaxPlayers;
new 
p_FriendlyFire;

public 
plugin_init()
{
    
register_plugin("Team Damage Mirror",AMXX_VERSION_STR,"SmileY");
    
    
RegisterHam(Ham_TakeDamage,"player","fw_HamTakeDamage");
    
    
g_iMaxPlayers get_maxplayers();
    
    
p_FriendlyFire get_cvar_pointer("mp_friendlyfire");
}

public 
fw_HamTakeDamage(iVictim,iInflictor,iAttacker,Float:fDamage,iDmgBits)
{
    if(
iVictim != iAttacker && IsPlayer(iAttacker) && is_user_alive(iAttacker) && get_user_team(iVictim) == get_user_team(iAttacker) && get_pcvar_num(p_FriendlyFire))
    {
        
SetHamParamEntity(1,iAttacker);
        
        return 
HAM_HANDLED;
    }
    return 
HAM_IGNORED;

Its a correct way and secure?
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
 



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 21:39.


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