Audio::setPedFootstepLoud: Difference between revisions

From RAGE Multiplayer Wiki
(Created page with " {{ClientsideJsFunction}} {{JSContainer| ===Required Params=== *'''ped:''' {{RageType|number}} *'''toggle:''' {{RageType|boolean}} ===Return value=== *''' {{RageType|void}} ''' ==Syntax== <syntaxhighlight lang="javascript"> mp.game.audio.setPedFootstepLoud(ped, toggle) </syntaxhighlight> ==Example== <syntaxhighlight lang="javascript"> //todo </syntaxhighlight> }} ==See also== {{Audio_s_function_c}} Category:Clientside API Category:TODO: Example")
 
No edit summary
 
Line 1: Line 1:
{{ClientsideJsFunction}}
{{ClientsideJsFunction}}
{{JSContainer|
{{JSContainer|
==Summary==
The `setPedFootstepLoud` function controls whether a pedestrian's footsteps are loud or soft. When `toggle` is set to `true`, the pedestrian's footsteps become louder, making them more noticeable. This can be used to enhance realism or to emphasize certain NPCs in specific gameplay scenarios.


===Required Params===
===Required Params===
*'''ped:''' {{RageType|number}}
*'''ped:''' {{RageType|number}} — The handle of the pedestrian entity.
*'''toggle:''' {{RageType|boolean}}
*'''toggle:''' {{RageType|boolean}} — Set to `true` to make footsteps loud, or `false` for softer footsteps.


===Return value===
===Return value===
Line 17: Line 19:
==Example==
==Example==
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
//todo
// Make the player's footsteps loud
const playerPed = mp.players.local.handle;
mp.game.audio.setPedFootstepLoud(playerPed, true);
</syntaxhighlight>
</syntaxhighlight>
}}
}}
==See also==
==See also==
{{Audio_s_function_c}}
{{Audio_s_function_c}}
[[Category:Clientside API]]
[[Category:Clientside API]]
[[Category:TODO: Example]]

Latest revision as of 08:42, 10 November 2024

Client-Side
Function

 JavaScript



JavaScript Syntax


Summary

The `setPedFootstepLoud` function controls whether a pedestrian's footsteps are loud or soft. When `toggle` is set to `true`, the pedestrian's footsteps become louder, making them more noticeable. This can be used to enhance realism or to emphasize certain NPCs in specific gameplay scenarios.

Required Params

  • ped: number — The handle of the pedestrian entity.
  • toggle: boolean — Set to `true` to make footsteps loud, or `false` for softer footsteps.

Return value

  • void

Syntax

mp.game.audio.setPedFootstepLoud(ped, toggle)

Example

// Make the player's footsteps loud
const playerPed = mp.players.local.handle;
mp.game.audio.setPedFootstepLoud(playerPed, true);



See also