GetPedVoice: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
Jose76Tron (talk | contribs) (Added an example and deleted needs example warning.) |
||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Client function}} | {{Client function}} | ||
Gets the current voice of a ped. | Gets the current voice of a ped. | ||
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. | |||
<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}} |
Revision as of 03:57, 13 September 2017
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.
Click to collapse [-]
ExampleaddCommandHandler ( "getvoice", function () local voicetype, voicename = getPedVoice(localPlayer) outputChatBox ( "Your ped voice type is " .. tostring(voicetype) .. " and voice name is ".. tostring(voicename).."." ) end )
See Also
- canPedBeKnockedOffBike
- getPedAnalogControlState
- getPedAnimation
- getPedBonePosition
- getPedCameraRotation
- getPedControlState
- getPedMoveState
- getPedOxygenLevel
- getPedSimplestTask
- getPedTargetCollision
- getPedTargetEnd
- getPedTargetStart
- getPedTask
- getPedVoice
- getPedWeaponMuzzlePosition
- givePedWeapon
- isPedBleeding
- isPedDoingTask
- isPedReloadingWeapon
- isPedTargetingMarkerEnabled
- setAnalogControlState
- setPedAimTarget
- setPedAnalogControlState
- setPedBleeding
- setPedCameraRotation
- setPedCanBeKnockedOffBike
- setPedControlState
- setPedEnterVehicle
- setPedExitVehicle
- IsPedFootBloodEnabled
- setPedFootBloodEnabled
- setPedLookAt
- setPedOxygenLevel
- setPedTargetingMarkerEnabled
- setPedVoice
- Shared
- addPedClothes
- getPedClothes
- removePedClothes
- createPed
- getPedAmmoInClip
- getPedArmor
- getPedFightingStyle
- getPedOccupiedVehicle
- getPedOccupiedVehicleSeat
- getPedStat
- getPedTarget
- getPedTotalAmmo
- getPedWalkingStyle
- getPedWeapon
- getPedWeaponSlot
- getPedContactElement
- getValidPedModels
- isPedChoking
- isPedDead
- isPedDoingGangDriveby
- isPedDucked
- isPedHeadless
- isPedInVehicle
- isPedOnFire
- isPedOnGround
- isPedWearingJetpack
- killPed
- removePedFromVehicle
- setPedAnimation
- setPedAnimationProgress
- setPedAnimationSpeed
- setPedArmor
- setPedDoingGangDriveby
- setPedFightingStyle
- setPedHeadless
- setPedOnFire
- setPedStat
- setPedWalkingStyle
- setPedWeaponSlot
- warpPedIntoVehicle