GetPedVoice: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
__NOTOC__
__NOTOC__
{{Client function}}
{{Client function}}
{{Needs Example}}


Gets the current voice of a ped.
Gets the current voice of a ped.


==Syntax==
==Syntax==
<syntaxhighlight lang="lua">string string getPedVoice ( ped thePed )</syntaxhighlight>
<syntaxhighlight lang="lua">string, string getPedVoice ( ped thePed )</syntaxhighlight>


===Required Arguments===
===Required Arguments===
Line 13: Line 12:
===Returns===
===Returns===
If successul, returns the current voice type name and the voice name of the ped (see [[ped voices]] for possible names). Returns ''false'' in case of failure.
If successul, returns the current voice type name and the voice name of the ped (see [[ped voices]] for possible names). Returns ''false'' in case of failure.
==Example==
This example creates a command (/getvoice) that prints to chatbox your ped voice type and name.
<section name="Example" class="client" show="true">
<syntaxhighlight lang="lua">
addCommandHandler ( "getvoice",
function ()
local voicetype, voicename = getPedVoice(localPlayer)
outputChatBox ( "Your ped voice type is " .. tostring(voicetype) .. " and voice name is ".. tostring(voicename).."." )
end
)
</syntaxhighlight>
</section>


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

Latest revision as of 09:56, 21 June 2019

Gets the current voice of a ped.

Syntax

string, string getPedVoice ( ped thePed )

Required Arguments

  • thePed: the ped to get the voice of.

Returns

If successul, returns the current voice type name and the voice name of the ped (see ped voices for possible names). Returns false in case of failure.

Example

This example creates a command (/getvoice) that prints to chatbox your ped voice type and name.

Click to collapse [-]
Example
addCommandHandler ( "getvoice",
	function ()
		local voicetype, voicename = getPedVoice(localPlayer)
		outputChatBox ( "Your ped voice type is " .. tostring(voicetype) .. " and voice name is ".. tostring(voicename).."." )
	end
)

See Also