GetPedClothes: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
No edit summary |
||
(6 intermediate revisions by 4 users not shown) | |||
Line 5: | Line 5: | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
string string getPedClothes ( ped thePed, int clothesType ) | string, string getPedClothes ( ped thePed, int clothesType ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{OOP||[[ped]]:getClothes||addPedClothes}} | |||
===Required Arguments=== | ===Required Arguments=== | ||
Line 14: | Line 15: | ||
===Returns=== | ===Returns=== | ||
This function returns 2 | This function returns 2 [[string|strings]], the clothes texture and model. The first return value will be ''false'' if this player's clothes type is empty or an invalid player was specified. | ||
==Example== | ==Example== | ||
Line 23: | Line 24: | ||
local texture, model = getPedClothes ( source, clothesType ) | local texture, model = getPedClothes ( source, clothesType ) | ||
if ( texture and model ) then | if ( texture and model ) then | ||
outputChatBox ( | outputChatBox ( getPlayerName(source) .. " is wearing " .. texture .. " " .. model .. | ||
" on his " .. getClothesTypeName(clothesType), source ) | " on his " .. getClothesTypeName(clothesType), source ) | ||
else | else | ||
Line 35: | Line 36: | ||
==See Also== | ==See Also== | ||
{{Ped functions}} | {{Ped functions}} | ||
[[hu:getPedClothes]] | |||
[[pl:GetPedClothes]] |
Latest revision as of 10:48, 22 September 2018
This function is used to get the current clothes texture and model of a certain type on a ped.
Syntax
string, string getPedClothes ( ped thePed, int clothesType )
OOP Syntax Help! I don't understand this!
- Method: ped:getClothes(...)
- Counterpart: addPedClothes
Required Arguments
- thePed: The ped whose clothes you want to retrieve.
- clothesType: The type/slot of clothing you want to get.
Clothing Types
- 0: SHIRT
- 1: HEAD
- 2: TROUSERS
- 3: SHOES
- 4: TATTOOS_LEFT_UPPER_ARM
- 5: TATTOOS_LEFT_LOWER_ARM
- 6: TATTOOS_RIGHT_UPPER_ARM
- 7: TATTOOS_RIGHT_LOWER_ARM
- 8: TATTOOS_BACK
- 9: TATTOOS_LEFT_CHEST
- 10: TATTOOS_RIGHT_CHEST
- 11: TATTOOS_STOMACH
- 12: TATTOOS_LOWER_BACK
- 13: NECKLACE
- 14: WATCH
- 15: GLASSES
- 16: HAT
- 17: EXTRA
Returns
This function returns 2 strings, the clothes texture and model. The first return value will be false if this player's clothes type is empty or an invalid player was specified.
Example
Click to collapse [-]
ServerThis example prints the model and texture of the current clothing on the player who enters the "clothes" command. For example: "clothes 3" for the shoes.
function getClothes ( source, key, clothesType ) local texture, model = getPedClothes ( source, clothesType ) if ( texture and model ) then outputChatBox ( getPlayerName(source) .. " is wearing " .. texture .. " " .. model .. " on his " .. getClothesTypeName(clothesType), source ) else outputChatBox ( "Invalid input.", source ) end end addCommandHandler ( "clothes", getClothes )
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