Raised This Month: $ Target: $400
 0% 

semi godmode


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 10-31-2007 , 18:38   Re: semi godmode
Reply With Quote #1

this should work fine:

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

new g_max_players

public plugin_init(){
    
register_plugin"NoWeaponDmg""1.0""Sylwester")
    
register_forward(FM_TraceLine"traceline")
    
register_forward(FM_TraceHull"tracehull"1)
    
register_event("Damage""damage_event""b""2!0")

    
g_max_players get_maxplayers()
}

//block bullets
public traceline(Float:v1[3], Float:v2[3], noMonsterspentToSkip){
    new 
iAttacker pentToSkip
    
new iVictim get_tr(TR_pHit)

    if ( 
iVictim >= && iVictim <= g_max_players && iAttacker >= && iAttacker <= g_max_players){
        
set_tr(TR_flFraction1.0)
        return 
FMRES_SUPERCEDE
    
}
    return 
FMRES_IGNORED
}

//block knife
public tracehull(Float:v1[3], Float:v2[3], noMonstershullNumberpentToSkip){
    new 
iAttacker pentToSkip
    
new iVictim get_tr(TR_pHit)

    if ( 
iVictim >= && iVictim <= g_max_players && iAttacker >= && iAttacker <= g_max_players){
        
set_tr(TR_flFraction1.0)
        return 
FMRES_SUPERCEDE
    
}
    return 
FMRES_IGNORED
}

//block HE grenades
public damage_event(id){
    if(
id || id g_max_players)
        return 
PLUGIN_CONTINUE
    
new weapon
    
new bodypart
    
new attacker get_user_attacker(idweaponbodypart)
    if(
attacker || attacker g_max_players)
        return 
PLUGIN_CONTINUE

    
new damage read_data(2)
    if(
weapon==4//grenade
        
set_user_health(idget_user_health (attacker) + damage)
    
    return 
PLUGIN_HANDLED

__________________
Impossible is Nothing
Sylwester 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 01:20.


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