Raised This Month: $ Target: $400
 0% 

fakedamage problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Krtola
Veteran Member
Join Date: Oct 2013
Location: Serbia
Old 03-25-2017 , 20:36   fakedamage problem
Reply With Quote #1

PHP Code:
public fw_TakeDamage(victiminflictorattackerFloat:damagedamagetype)

    new 
iOwnerTeam get_user_team(attacker)

    if(
damagetype DMG_HEGRENADE)
            return 
HAM_IGNORED

    
if(iOwnerTeam == get_user_team(victim)) 
            return 
HAM_IGNORED

    
new Float:vOrigin[3
    
pev(victimpev_originvOrigin)

    if(
get_user_weapon(attacker) == CSW_AWP)
    {

                new 
iOrigin], vorigin[3],srco[3]
        
get_user_originvictimiOrigin );

                
get_user_origin(victim,vorigin);
        
vorigin[2] -= 26
        srco
[0] = vorigin[0] + 150
        srco
[1] = vorigin[1] + 150
        srco
[2] = vorigin[2] + 800
        
        
new iRadius get_pcvar_numgCvarRadius );
    
        
UTIL_CreateBeamCylinderiOrigin120gCylinderSprite006160random255 ), random255 ), random255 ), 255);
        
UTIL_CreateBeamCylinderiOrigin320gCylinderSprite006160random255 ), random255 ), random255 ), 255);
        
UTIL_CreateBeamCylinderiOriginiRadiusgCylinderSprite006160random255 ), random255 ), random255 ), 255);
        
        
UTIL_Blast_ExplodeDamagevictimget_pcvar_floatgCvarDamage ), floatiRadius ) );   
    }
    return 
HAM_HANDLED      

PHP Code:
stock UTIL_Blast_ExplodeDamageentidFloat:damageFloat:range 
{
    new 
Float:flOrigin1];
    
entity_get_vectorentidEV_VEC_originflOrigin1 );

    new 
Float:flDistance;
    new 
Float:flTmpDmg;
    new 
Float:flOrigin2];

    for( new 
1<= gMaxPlayersi++ ) 
    {
        if( 
is_user_alive) && get_user_teamentid ) == get_user_team) )
        {
            
entity_get_vectoriEV_VEC_originflOrigin2 );
            
flDistance get_distance_fflOrigin1flOrigin2 );
            
            static const 
szWeaponName[] = "Thunderbolt Strike";
        
            if( 
flDistance <= range 
            {
                
flTmpDmg damage - ( damage range ) * flDistance;
                
fakedamageiszWeaponNameflTmpDmgDMG_BLAST );                    
            }
        }
    }       
}

stock UTIL_CreateBeamCylinderorigin], addradspritestartfrateframeratelifewidthamplituderedgreenbluebrightnessspeed )
{
    
message_beginMSG_PVSSVC_TEMPENTITYorigin ); 
    
write_byteTE_BEAMCYLINDER );
    
write_coordorigin] );
    
write_coordorigin] );
    
write_coordorigin] );
    
write_coordorigin] );
    
write_coordorigin] );
    
write_coordorigin] + addrad );
    
write_shortsprite );
    
write_bytestartfrate );
    
write_byteframerate );
    
write_byte(life );
    
write_bytewidth );
    
write_byteamplitude );
    
write_bytered );
    
write_bytegreen );
    
write_byteblue );
    
write_bytebrightness );
    
write_bytespeed );
    
message_end();

When a player is killed by the explosion nothing happens with frags in scoreboard.
How do set up when the explosion kill player = add frag to killer and reduce frag to victim?
Krtola is offline
Send a message via Skype™ to Krtola
Natsheh
Veteran Member
Join Date: Sep 2012
Old 03-25-2017 , 21:28   Re: fakedamage problem
Reply With Quote #2

I would not use this stock
UTIL_Blast_ExplodeDamage
Just to make a radius dmg instead use find ent by classname

And instead of this
if(damagetype & DMG_HEGRENADE)
return HAM_IGNORED

Check if inflictor != attacker then return
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Krtola
Veteran Member
Join Date: Oct 2013
Location: Serbia
Old 03-26-2017 , 04:03   Re: fakedamage problem
Reply With Quote #3

good suggestion
PHP Code:
Check if inflictor != attacker then return 
I will use this.
But now I really need help with this
PHP Code:
How do set up when the explosion kill player add frag to killer and reduce frag to victim
Krtola is offline
Send a message via Skype™ to Krtola
wickedd
Veteran Member
Join Date: Nov 2009
Old 03-26-2017 , 04:12   Re: fakedamage problem
Reply With Quote #4

Quote:
Originally Posted by Krtola View Post
But now I really need help with this
PHP Code:
How do set up when the explosion kill player add frag to killer and reduce frag to victim
PHP Code:
set_user_fragskillerget_user_fragskiller ) + any_number )
set_user_fragsvictimget_user_fragsvictim ) - any_number 
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd 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 18:05.


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