GetPedArmor: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
No edit summary |
||
(3 intermediate revisions by 3 users not shown) | |||
Line 5: | Line 5: | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua">float getPedArmor ( ped thePed )</syntaxhighlight> | <syntaxhighlight lang="lua">float getPedArmor ( ped thePed )</syntaxhighlight> | ||
{{OOP||[[ped]]:getArmor|armor|setPedArmor}} | |||
===Required Arguments=== | ===Required Arguments=== | ||
Line 17: | Line 18: | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function showArmor ( ) | function showArmor ( ) | ||
local armor = getPedArmor ( localPlayer ) | |||
local armor = getPedArmor ( | |||
outputChatBox( "Your armor: " .. armor ) | outputChatBox( "Your armor: " .. armor ) | ||
end | end | ||
Line 27: | Line 27: | ||
==See Also== | ==See Also== | ||
{{Ped functions}} | {{Ped functions}} | ||
[[hu:getPedArmor]] |
Latest revision as of 16:33, 3 August 2020
This function returns the current armor of the specified ped.
Syntax
float getPedArmor ( ped thePed )
OOP Syntax Help! I don't understand this!
- Method: ped:getArmor(...)
- Variable: .armor
- Counterpart: setPedArmor
Required Arguments
- thePed: The ped whose armor you want to check
Returns
A float with the armor, false if an invalid ped was given.
Example
Click to collapse [-]
ClientThis example defines a "showarmor" console command that shows the player that executes it how much armor he has.
function showArmor ( ) local armor = getPedArmor ( localPlayer ) outputChatBox( "Your armor: " .. armor ) end addCommandHandler ( "showarmor", showArmor )
See Also
- 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