altmp / altv-issues

Issues and roadmap for alt:V project
93 stars 16 forks source link

Audio addOutput on a prop crash the client #988

Closed Arochka closed 1 year ago

Arochka commented 3 years ago

Client/server version

rc/4.0-rc1

Current behavior Adding audio output on a prop is crashing the game

Expected behavior Not crashing the client

Steps to reproduce ` native.requestModel(alt.hash('prop_tennis_ball')) //Omited on this example, but i'm waiting that model is loaded using a promise calling native.hasModelLoaded(alt.hash('prop_tennis_ball'))

  const handle = native.createObject(alt.hash('prop_tennis_ball'), pos.x, pos.y, pos.z, false, false, false)
  const audio = new alt.Audio('https://listen.radioking.com/radio/514/stream/63685', 1, 'radio', false),
  audio.addOutput(handle) //Crash at this line

`

Context (environment) I'm trying to play sound at a specific pos, to achieve this i'm spawning a dumb entity, set invisible + no collisions and attach the audio on it

Possible solution Maybe just allow to play sound on a specific position without the need to attach to an entity and in this case creating a dumb prop just to attach sound on it

Arochka commented 3 years ago

Just to let you know that i give a try on dev14 and still crashing

C0kkie commented 3 years ago

It wasnt fixed in dev14, but probably in dev15

Arochka commented 3 years ago

On dev15, addOutput on a prop no longer crash the game but I got this error in console now: The specified entity has no audio emitter!

BTW, can it be possible to addOutput on a position ? Cause on my case i’m using a dumb entity to achieve that, pretty ugly

C0kkie commented 1 year ago

Should work in v15