I modified the cs base to change the pitch of the shot sound, the pitch should change according to host_timescale's value.
[CODE]function SWEP:PrimaryAttack()
self.Weapon:SetNextSecondaryFire( CurTime() + self.Primary.Delay )
self.Weapon:SetNextPrimaryFire( CurTime() + self.Primary.Delay )
if ( !self:CanPrimaryAttack() ) then return end
// Play shoot sound
local pitch = GetConVarNumber("host_timescale") * 100
self.Weapon:EmitSound( self.Primary.Sound, 100, pitch)
MsgN("Shooted sound with a pitch of " .. pitch)
// Shoot the bullet
self:CSShootBullet( self.Primary.Damage, self.Primary.Recoil, self.Primary.NumShots, self.Primary.Cone )
// Remove 1 bullet from our clip
self:TakePrimaryAmmo( 1 )
if ( self.Owner:IsNPC() ) then return end
// Punch the player's view
self.Owner:ViewPunch( Angle( math.Rand(-0.2,-0.1) * self.Primary.Recoil, math.Rand(-0.1,0.1) *self.Primary.Recoil, 0 ) )
// In singleplayer this function doesn't get called on the client, so we use a networked float
// to send the last shoot time. In multiplayer this is predicted clientside so we don't need to
// send the float.
if ( (SinglePlayer() && SERVER) || CLIENT ) then
self.Weapon:SetNetworkedFloat( "LastShootTime", CurTime() )
end
end[/CODE]
It actually says the message "Shooted sound with a pitch of : 50" when the host_timescale was 0.5, you get the point...
Yet the pitch of the sound stays the same.
Any ideas ?
Sorry, you need to Log In to post a reply to this thread.