SetPedVoice: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Undo revision 17914 by Arc (Talk))
No edit summary
Line 5: Line 5:


==Syntax==
==Syntax==
<syntaxhighlight lang="lua">bool setPedVoice ( ped thePed, int type, string firstVoice, string lastVoice )</syntaxhighlight>
<syntaxhighlight lang="lua">bool setPedVoice ( ped thePed, string voiceType, string voiceName )</syntaxhighlight>


===Required Arguments===
===Required Arguments===
*'''thePed:''' the ped whose voice to change.
*'''thePed:''' the ped whose voice to change.
*'''type:''' a number from 0 to 4 that specifies a voice type.
*'''voiceType:''' the voice type. See [[ped voices]] for possible types.
*'''firstVoice:''' name of the first voice to use from the type. See [[ped voices]].
*'''voiceName:''' the voice name within the specified type. See [[ped voices]] for possible voices.
*'''lastVoice:''' name of the last voice to use from the type. See [[ped voices]].


===Returns===
===Returns===
Returns ''true'' when the voice was successfully set, ''false'' otherwise.
Returns ''true'' when the voice was successfully set, ''false'' otherwise.
===Example===
<syntaxhighlight lang="lua">addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()),
    function()
        setPedVoice(getLocalPlayer(), "PED_TYPE_GANG", "VOICE_GNG_MACCER")
    end
)</syntaxhighlight>


==See Also==
==See Also==
{{Client ped functions}}
{{Client ped functions}}

Revision as of 23:04, 30 November 2008

Changes the voice of a ped.

Syntax

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

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", getResourceRootElement(getThisResource()),
    function()
        setPedVoice(getLocalPlayer(), "PED_TYPE_GANG", "VOICE_GNG_MACCER")
    end
)

See Also