Raised This Month: $ Target: $400
 0% 

Block knife attack


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Boop
Junior Member
Join Date: Dec 2006
Old 12-28-2006 , 06:12   Re: Block knife attack
Reply With Quote #1

I tried this (everyone is immune) :

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

new bool:knifeImmune[33] = true;

public plugin_init() {
    register_forward(FM_TraceHull,"fw_tracehull");
}

 public fw_tracehull(Float:v1[3],Float:v2[3],noMonsters,hull,skipEnt,ptr) {    
     
    if(!is_user_connected(skipEnt) || !is_user_alive(skipEnt))
        return FMRES_IGNORED;
    
    static hit;
    hit = get_tr(TR_pHit);     // an immune player was not hit  

    if (!hit || hit > 32 || !knifeImmune[hit])      
        return FMRES_IGNORED;     // override  
        
    set_tr(TR_pHit,0);  
    return FMRES_IGNORED;

}
This isn't working : everyone can kill with knife.

I make a test :

When script pass the first condition and get hit, the only hit returned is "-1". I think that it's not a value wanted. No ? Do u know why we have only -1 ?

Thank u

Last edited by Boop; 12-28-2006 at 06:15.
Boop 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 22:22.


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