SetPedVoice: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
m (fix link)
 
Line 3: Line 3:


Changes the voice of a ped.
Changes the voice of a ped.
{{Note|A ped voice is one of the GTA built in voice character types. Not to be confused with a [[https://wiki.multitheftauto.com/wiki/Resource:Voice player voice]]}}
{{Note|A ped voice is one of the GTA built in voice character types. Not to be confused with a [[Resource:Voice|player voice]].}}
==Syntax==
==Syntax==
<syntaxhighlight lang="lua">bool setPedVoice ( ped thePed, string voiceType, string voiceName )</syntaxhighlight>
<syntaxhighlight lang="lua">bool setPedVoice ( ped thePed, string voiceType, string voiceName )</syntaxhighlight>

Latest revision as of 20:43, 15 December 2021

Changes the voice of a ped.

[[{{{image}}}|link=|]] Note: A ped voice is one of the GTA built in voice character types. Not to be confused with a player voice.

Syntax

bool setPedVoice ( ped thePed, string voiceType, string voiceName )

OOP Syntax Help! I don't understand this!

Method: ped:setVoice(...)


Required Arguments

  • thePed: the ped whose voice to change.
  • voiceType: the voice type. See ped voices for possible types.
  • voiceName: the voice name within the specified type. See ped voices for possible voices.

Returns

Returns true when the voice was successfully set, false otherwise.

Example

addEventHandler("onClientResourceStart", resourceRoot,
    function()
        setPedVoice(localPlayer, "PED_TYPE_GANG", "VOICE_GNG_MACCER")
    end
)

See Also