Raised This Month: $ Target: $400
 0% 

Grenade think 2 calls


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
avril-lavigne
Banned
Join Date: Apr 2009
Old 11-19-2014 , 16:09   Re: Grenade think 2 calls
Reply With Quote #6

just part

PHP Code:
RegisterHam(Ham_TakeDamage"player""fw_takedamage_pre",0)
RegisterHam(Ham_Think"grenade""fw_think")
register_forward(FM_SetModel,"fw_setmodel",1);


public 
fw_takedamage_previc iInflictor att Float:DamagebitsDamageType )
if( 
bitsDamageType DMG_GRENADE )  SetHamParamFloat(40.0)   // we have our custom dmg 

public fw_setmodel(ent,model[])
{       
    if(
equal(model"models/w_hegrenade.mdl"))
    
set_pdata_int(ent41pev(entpev_owner), 4)
    
    return 
FMRES_SUPERCEDE
}


public 
fw_think(ent)

    static 
Float:dmgtime
        pev
(entpev_dmgtimedmgtime
    
    if (
dmgtime get_gametime()) return HAM_IGNORED    
    
    
if(is_flash(ent))        
    
flashowner get_pdata_int(ent414) , flash ent    
      
    
if(is_he(ent))
    {
             
server_print("HE THINK")      
         
heowner get_pdata_int(ent414
         static 
Float:or[3]
         
pev(ent,pev_origin,or)
         new 
target = -1
         
static  Float:flDistanceFloat:flDamage
         
while(( target find_ent_in_sphere(target, or, grenadelvl[heowner]*50.0) ))  
             {  
                   if(!
alive(target)) continue       
             
           
flDistance entity_range(enttarget );
                   
flDamage UTIL_FloatRadius100.0grenadelvl[heowner]*50.0flDistance );            
           
ExecuteHamB(Ham_TakeDamagetargetentheowner ,  flDamage DMG_CLUB)
 
           
server_print("radius %.2f damage %.2f"grenadelvl[heowner]*50.0flDamage)            
             }        
         }
        return 
HAM_IGNORED    
}

public 
bool:is_he(ent)
{
    static 
model[32]
    
pev(entpev_modelmodel31)
    return 
bool:(containi(model"w_hegrenade.mdl") != -1)

In a moment of HE explosion I want to make damage once. I dont know why after throwing HE grenade right in explosion moment I see
debug message server_print("HE THINK") two times ....Therefore I suppose my radius damage also calculates two times

also I ask someone fix UTIL_FloatRadius because it calculates wrong radius damage im sure 100% .
__________________
VDS in Europe 1 gb/s unmetered.Any configurations.
I accept Paypal, Moneybookers,etc

Last edited by avril-lavigne; 11-19-2014 at 16:16.
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 17:32.


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