Skip to content

Conversation

@Necktrox
Copy link

@Necktrox Necktrox commented May 12, 2017

Description

This pull request adds a new event called onClientWorldSound. The event is restricted to players and peds. This comes in handy if you want to replace the step sounds whenever a player or ped emits these (doesn't work with server-side created peds).

The provided GTA:SA hook is not able to cancel every sound emitted. While testing I discovered it detects the random gun shooting with a NULL entity, but to my disappointment, you couldn't detect various other sounds.

I have restricted the event to player/ped related sounds. Scripters can use this event to cancel the step sounds (IIRC it was group 5) to add their own sounds (maybe even use the material the player/ped is standing on) or to use the sound position in a popular gamemode called DayZ.

Issues:
#9606: [Request] onPedTakeStep
#7074: onClientWorldSound not canceled (relevant, but not solved due to sound-canceling issues)

Images

onclientworldsound

@CrosRoad95
Copy link

i love you

@qaisjp
Copy link
Contributor

qaisjp commented May 13, 2017

Not sure about the feasibility of this event, but it's probably best to keep the name as "world sound" to make it open to supporting more groups in the future.

@Necktrox
Copy link
Author

I reverted that specific commit to keep the onClientWorldSound event name, but I left the restriction for players and peds there.

@Necktrox Necktrox changed the title Add new event onClientPedSound Add new event onClientWorldSound May 13, 2017
Copy link

@CrosRoad95 CrosRoad95 May 13, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sound can be from example: vehicles, explosion vehicle/barrels/gas station etc, weapons, destroyed objects
so, if element isnt ped/player then source=nil

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • The pull request description tackles this issue: The hooked GTA:SA function doesn't handle a lot of sounds and that's why it is restricted to player/ped entities, because you can only cancel these.
  • The source element can never be nil, it's either the source element or root

@qaisjp qaisjp added the enhancement New feature or request label May 13, 2017
@Necktrox Necktrox force-pushed the feature/world-sound-event branch from 89d1ab1 to d2ca755 Compare July 9, 2017 18:20
@botder botder added refactor new-feature and removed enhancement New feature or request labels Jul 9, 2018
@botder botder changed the title Add new event onClientWorldSound [WIP] Add new event onClientWorldSound Jul 14, 2018
@patrikjuvonen patrikjuvonen added enhancement New feature or request and removed new feature labels Sep 4, 2018
@patrikjuvonen patrikjuvonen changed the title [WIP] Add new event onClientWorldSound WIP: Add new event onClientWorldSound Sep 4, 2018
@botder botder self-assigned this Sep 27, 2018
@botder
Copy link
Member

botder commented Sep 27, 2018

Added in 8302b4c

@botder botder closed this Sep 27, 2018
@botder botder removed the refactor label Sep 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants