Results 1 to 2 of 2

Thread: Damage through Teammate/Enemy

  1. #1
    Sergeant serthy's Avatar
    Join Date
    Nov 2012
    Posts
    450
    Thanks
    96
    Thanked 295 Times in 188 Posts

    Damage through Teammate/Enemy

    Hey,

    we just had a discussion about a possible cheater, he shot THROUGH a TEAMMATE and killed a guy behind.
    As far as I can remember, you can shoot through an ENEMY and damage/kill two or more player.
    You can also shoot through a teammate and damage/kill your teammate and an enemy at the same time,
    however, only if friendly fire is set to not 0.

    So I looked through the vanilla game files and couldn't find where it actually determines when friendly fire is on, that the bullet stops at your teammate and does not go any further.

    Here is a snippet from tdm.gsc:

    PHP Code:
    Callback_PlayerDamage(eInflictoreAttackeriDamageiDFlagssMeansOfDeathsWeaponvPointvDirsHitLocpsOffsetTime)
    {
        if(
    self.sessionteam == "spectator")
            return;

        
    // Don't do knockback if the damage direction was not specified
        
    if(!isdefined(vDir))
            
    iDFlags |= level.iDFLAGS_NO_KNOCKBACK;

        
    friendly undefined;

        
    // check for completely getting out of the damage
        
    if(!(iDFlags level.iDFLAGS_NO_PROTECTION))
        {
            if(
    isPlayer(eAttacker) && (self != eAttacker) && (self.pers["team"] == eAttacker.pers["team"]))
            {
                if(
    level.friendlyfire == "0")
                {
                    return;
                }
                else if(
    level.friendlyfire == "1")
                {
                    
    // Make sure at least one point of damage is done
                    
    if(iDamage 1)
                        
    iDamage 1;

                    
    self finishPlayerDamage(eInflictoreAttackeriDamageiDFlagssMeansOfDeathsWeaponvPointvDirsHitLocpsOffsetTime);

                    
    // Shellshock/Rumble
                    
    self thread maps\mp\gametypes\_shellshock::shellshockOnDamage(sMeansOfDeathiDamage);
                    
    self playrumble("damage_heavy");
                } 
    Maybe I dont see it.. can it be, that friendlyfire is somehow special?

    So I looked how it got set and found this in _serversettings.gsc:

    PHP Code:
        level.friendlyfire getCvar("scr_friendlyfire");
        if(
    level.friendlyfire == "")
            
    level.friendlyfire "0";
        
    setCvar("scr_friendlyfire"level.friendlyfiretrue); 
    Why has setCvar 3 parameters?

  2. The Following User Says Thank You to serthy For This Useful Post:

    kung foo man (11th June 2020)

  3. #2
    Sergeant maxdamage99's Avatar
    Join Date
    Aug 2014
    Location
    Russia
    Posts
    426
    Thanks
    78
    Thanked 102 Times in 86 Posts
    If you are sure and checked everything, then most likely the case "finishPlayerDamage".

    I looked at the code in the decompile version, it is very similar if I do not confuse something with the effect of a bullet shot, but if i true remember of it is created without the participation of the function: codecallback_playerdamage->finishDamage (example: spawnprotection break this callback -> bullet effect exist)

    1.0
    Code:
    sub_80F8A04
    1.2
    Code:
    sub_80FB02C
    1.3
    Code:
    sub_80FB170
    PHP Code:
    class CoronaVirus 
    {
       
    CoronaVirus(int m 1): multi(m) { Peoples.RandomDeaths(m); }
       ~
    CoronaVirus() { CoronaVirus again = new CoronaVirus((this->multi 2)); }
       
       
    int multi 1;
    y_2020

  4. The Following User Says Thank You to maxdamage99 For This Useful Post:

    kung foo man (11th June 2020)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •