AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   fakedamage problem (https://forums.alliedmods.net/showthread.php?t=295445)

Krtola 03-25-2017 20:36

fakedamage problem
 
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?

Natsheh 03-25-2017 21:28

Re: fakedamage problem
 
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

Krtola 03-26-2017 04:03

Re: fakedamage problem
 
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


wickedd 03-26-2017 04:12

Re: fakedamage problem
 
Quote:

Originally Posted by Krtola (Post 2506839)
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 



All times are GMT -4. The time now is 18:05.

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