Raised This Month: $ Target: $400
 0% 

Need help with flashbang kill


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
avril-lavigne
Banned
Join Date: Apr 2009
Old 03-28-2014 , 21:41   Need help with flashbang kill
Reply With Quote #1

I stuck with error in hamsandwitch ham_killed when player was killed by flashbang
like this

PHP Code:

new entt,owner

RegisterHam
(Ham_Killed,"player","killed"1)           
register_event("ScreenFade""event_flashed""be","4=255","5=255","6=255","7>199")
register_forward(FM_SetModel,"fw_setmodel");    



public 
fw_setmodel(ent,model[])
{
    if(
equal(model"models/w_flashbang.mdl"))
    {        
        
owner pev(entpev_owner);      
    
entt ent  // copy ent id
    
        
return FMRES_SUPERCEDE;
    }    
   
    return 
FMRES_IGNORED;
}

public 
event_flashed(id)
{    
    if ( !
alive(id) || !alive(owner) )    return PLUGIN_CONTINUE;        
      
                              
    if ( 
id != owner )  // we dont care what team , etc. Just kill everyone                                
    
ExecuteHamB(Ham_TakeDamageidenttowner 100.0HIT_GENERIC)    // use our entt id          
    
    
return PLUGIN_CONTINUE;
}


public 
killed(vic,att)
{        
        new 
infl pevvicpev_dmg_inflictor )
    if( 
infl != vic )
    {
        new 
classname[32]
        
pevinfl pev_classnameclassname31 )
        if( 
equaliclassname"grenade" ) )
        {
           new 
Float:flDmgTime
           pev
inflpev_dmgtimeflDmgTime )
           if( 
flDmgTime )
           {
              
// he grenade
                    
}
                  }        

             
but how to get flashbang in inflictor by pev_model  name ?
             
Ham_killed says invalid players id =0 in get_user_weapon(id)
            
         
also  tried
   
               
new wpn[64]
              
        new 
infl pevvicpev_dmg_inflictor )
        
pevinflpev_modelwpn ,63 )
        
client_print(0,3,"inflictor name %s",wpn)
        
// nothing  .....................................

how to detect flashbang id in ham_killed?
"!dmgtime" also didnt work
__________________
VDS in Europe 1 gb/s unmetered.Any configurations.
I accept Paypal, Moneybookers,etc

Last edited by avril-lavigne; 03-28-2014 at 21:42.
avril-lavigne 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 06:04.


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