1. This forum is ARCHIVED! Visit the new Cloud Sixteen forums, codename Eden, at https://eden.cloudsixteen.com. These forums will remain archived for a few months before being closed down, so try to encourage plugin developers to begin moving their content across to the new forums.
Dismiss Notice
Hi Guest, you need a Steam account to register and post on these forums. Login with Steam at the top of the forums to get started!
Dismiss Notice
Hi Guest, do you want to buy HL2RP or another Clockwork schema? Visit the Cloud Sixteen Store to get started!

Death Sounds?

Discussion in 'Development' started by BananasTheKing, Jun 12, 2018.

  1. BananasTheKing

    BananasTheKing Clockwork Customer

    Heya, I was wondering where I can find the death sounds for the citizen faction, I've looked and I've only found ones for MPF/OTA.
     
  2. gabs

    gabs Clockwork Customer

    The default death sound is in sv_kernel
    Code:
    -- Called just before a player dies.
    function Clockwork:DoPlayerDeath(player, attacker, damageInfo)
        self.player:DropWeapons(player, attacker);
        self.player:SetAction(player, false);
        self.player:SetDrunk(player, false);
      
        local deathSound = self.plugin:Call("PlayerPlayDeathSound", player, player:GetGender());
        local decayTime = self.config:Get("body_decay_time"):Get();
    
        if (decayTime > 0) then
            self.player:SetRagdollState(player, RAGDOLL_KNOCKEDOUT, nil, decayTime, self.kernel:ConvertForce(damageInfo:GetDamageForce() * 32));
        else
            self.player:SetRagdollState(player, RAGDOLL_KNOCKEDOUT, nil, 600, self.kernel:ConvertForce(damageInfo:GetDamageForce() * 32));
        end;
      
        if (self.plugin:Call("PlayerCanDeathClearRecognisedNames", player, attacker, damageInfo)) then
            self.player:ClearRecognisedNames(player);
        end;
      
        if (self.plugin:Call("PlayerCanDeathClearName", player, attacker, damageInfo)) then
            self.player:ClearName(player);
        end;
      
        if (deathSound) then
            player:EmitSound("physics/flesh/flesh_impact_hard"..math.random(1, 5)..".wav", 150);
          
            timer.Simple(FrameTime() * 25, function()
                if (IsValid(player)) then
                    player:EmitSound(deathSound);
                end;
            end);
        end;
      
        player:SetForcedAnimation(false);
        player:SetCharacterData("Ammo", {}, true);
        player:StripWeapons();
        player:Extinguish();
        player.cwSpawnAmmo = {};
        player:StripAmmo();
        player:AddDeaths(1);
        player:UnLock();
      
        if (IsValid(attacker) and attacker:IsPlayer() and player != attacker) then
            if (self.plugin:Call("PlayerCanGainFrag", attacker, player)) then
                attacker:AddFrags(1);
            end;
        end;
    end;
    
    Change this to something else
    player:EmitSound("physics/flesh/flesh_impact_hard"..math.random(1, 5)..".wav", 150);
     
    • Winner Winner x 2
  3. BananasTheKing

    BananasTheKing Clockwork Customer

    Thank you so much!
     

Previous Readers (Total: 0)