Skip to content

SWEP.Animations["ready"] SoundTable doesn't play for the client picking up a weapon on multiplayer servers #146

Description

@RalphORama

When writing a SWEP with a SoundTable field in the ["ready"] animation sequence, the sounds do not play for the client when in a multiplayer server. They will, however, play for other clients (i.e. you cannot hear yourself rack a slide when picking up a gun, but players around you can).

I believe this is an issue with how sound tables are played in sh_anim.lua.

Example Code

Taken from the Black Ops SWEP pack

SWEP.Animations = {
    ["ready"] = {
        Source = "first_draw",
        Time = 1.5,
        LHIK = false,
        LHIKIn = 1,
        LHIKOut = 1,
        SoundTable = {
            {s = "ArcCW_BO1.AK_Charge", t = 20 / 35}
        },
    },
-- ["reload"], etc.

Steps to reproduce

Sounds working in single player

  1. Subscribe to ArcCW Base and ArcCW Black Ops Weapons Pack
  2. Click "Start New Game" on the main menu in Garry's Mod
  3. In the top right, select "Single Player" from the drop-down
  4. Click "Start Game"
  5. Give yourself any ArcCW weapon from the spawn menu
  6. ready sounds will play when given a weapon in the single player game

Sounds not working in multiplayer

  1. Click "Start New Game" again
  2. In the top right, select "2 players" from the drop down
  3. Select "local server"
  4. Click "Start Game"
  5. Give yourself any ArcCW weapon from the spawn menu
  6. ready sounds will not play when given a weapon in the multiplayer server

Metadata

Metadata

Assignees

Labels

BugSomething isn't working as intendedType: MultiplayerThis issue only happens in Multiplayer

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions