Raised This Month: $ Target: $400
 0% 

HELP this code


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-23-2009 , 12:04   Re: HELP this code
Reply With Quote #3

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

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

public plugin_init() 
{
    
register_pluginPLUGIN VERSION AUTHOR );
    
register_event"Damage" "fwDamage" "b" "2!0" "3=0" "4!0" )    
}

public 
fwDamage(id)
{    
    static 
iAttackeriAttacker get_user_attackerid );
    static 
iDamageiDamage read_data);    
        
    if ( 
iAttacker && ( id != iAttacker ) ) 
    {
        new 
iExperienceGain;
    
        if( 
iDamage <= 15 )
            
iExperienceGain 2;
        else if( 
75 iDamage 15 )
            
iExperienceGain 8;
        else if( 
100 iDamage >= 75 )
            
iExperienceGain 15;
        else if( 
120 iDamage >= 100 )
            
iExperienceGain 22;
        else if( 
180 iDamage >= 120 )
            
iExperienceGain 35;
        else if( 
250 iDamage >= 180 )
            
iExperienceGain 55;
        else if( 
450 iDamage >= 250 )
            
iExperienceGain 80;
    
        
add_experience(attackeriExperienceGain);
    } 

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

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

public plugin_init() 
{
    
register_pluginPLUGIN VERSION AUTHOR );
    
RegisterHamHam_TakeDamage "player" "fwHamTakeDamage" );
}

public 
fwHamTakeDamageiVictim iInflictor iAttacker FloatfDamage iBitDamageType )
{
    if ( 
iAttacker && ( iVictim != iAttacker ) ) 
    {
        new 
iExperienceGain;
        
        if( 
fDamage <= 15.0 )
            
iExperienceGain 2;
        else if( 
75.0 fDamage 15.0 )
            
iExperienceGain 8;
        else if( 
100.0 fDamage >= 75.0)
            
iExperienceGain 15;
        else if( 
120.0 fDamage >= 100.0)
            
iExperienceGain 22;
        else if( 
180.0 fDamage >= 120.0)
            
iExperienceGain 35;
        else if( 
250.0 fDamage >= 180.0)
            
iExperienceGain 55;
        else if( 
450.0 fDamage >= 250.0)
            
iExperienceGain 80;
        
        
add_experience(attackeriExperienceGain);
    }

__________________

Last edited by Bugsy; 05-23-2009 at 12:12.
Bugsy is offline
 



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 01:32.


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