Raised This Month: $ Target: $400
 0% 

Radius damage with setting killer/attacker


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GuskiS
Veteran Member
Join Date: Aug 2007
Location: Latvia
Old 08-29-2013 , 16:31   Radius damage with setting killer/attacker
Reply With Quote #1

Is there a stock or funcion that does radius damage and where you can set attacker/killer id? I used radius_damage but it didn't work as planned. Any help appreciated.

EDIT: Or, provide me of any other explosion type something I need to hurt players in radius where player explodes. Currently I'm using stock with env_explosion found on forum, but it seems to work only for one round/explosion :/
__________________
Finished mods:
Trouble in Terrorist Town
MurderMod
The Hidden
Cowboys vs Indians
JailBreak Supreme
Survival Madness

Last edited by GuskiS; 08-29-2013 at 16:39.
GuskiS is offline
RateX
Veteran Member
Join Date: Jun 2012
Location: 0o. SEA .o0
Old 08-30-2013 , 04:11   Re: Radius damage with setting killer/attacker
Reply With Quote #2

This is my radius damage script:
PHP Code:
public plugin_init()
{
    
register_touch("at4rocket""*""fw_rocket_touch")
}

public 
fw_rocket_touch(RocketEnttouch)
{
    if(!
pev_valid(RocketEnt))
        return    
        
    if(
is_user_alive(touch) && pev(RocketEntpev_owner) == touch)
        return
        
    static 
Float:Origin[3]
    
pev(RocketEntpev_originOrigin)    

    static 
owner
    
new FM_NULLENT
    owner 
pev(RocketEntpev_owner)
    new 
Float:aOrigin ]
    while((
find_ent_in_sphere(a,Origin,get_pcvar_float(cvar_radius))) != 0)
    {
        if(
pev(a,pev_takedamage)!=DAMAGE_NO)
        {
            if(
IsValidUser(a))
            {
                
pev apev_originaOrigin )
                new 
Float:flDistance get_distance_f OriginaOrigin )
                new 
Float:damage = (get_pcvar_float(cvar_damage)/get_pcvar_float(cvar_radius))*(get_pcvar_float(cvar_radius)-flDistance)
                if(
damage 0.0ExecuteHam(Ham_TakeDamageaownerownerdamageDMG_BULLET)    
            }
            else 
ExecuteHam(Ham_TakeDamageaownerownerget_pcvar_float(cvar_damage), DMG_BULLET)    
        }
    }        
    
engfunc(EngFunc_RemoveEntityRocketEnt
cvar_damage is max damage
cvar_radius is the radius that player(s) and entity take damage
RateX is offline
GuskiS
Veteran Member
Join Date: Aug 2007
Location: Latvia
Old 08-30-2013 , 05:34   Re: Radius damage with setting killer/attacker
Reply With Quote #3

Sweet dude, works like a charm Thank you
__________________
Finished mods:
Trouble in Terrorist Town
MurderMod
The Hidden
Cowboys vs Indians
JailBreak Supreme
Survival Madness
GuskiS 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 19:09.


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