SetPedHeadless: Difference between revisions
Jump to navigation
Jump to search
m (Needs example) |
|||
Line 13: | Line 13: | ||
==Example== | ==Example== | ||
<section name="Server" class="server" show="true"> | |||
This example enables a player to behead themselves, and give them their head back. | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
-- | function removeMyHead(thePlayer) | ||
setPedHeadless(thePlayer, true) -- Removes the players head | |||
outputChatBox("You have been beheaded!", thePlayer, 255, 0, 0) -- A confirmation message for the player | |||
end | |||
addCommandHandler("beheadme", removeMyHead) | |||
function giveBackHead(thePlayer) | |||
setPedHeadless(thePlayer, false) -- Gives the player a head | |||
outputChatBox("You have been given a head!", thePlayer, 255, 0, 0) -- A confirmation message for the player | |||
end | |||
addCommandHandler("headmeup", giveBackHead) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Revision as of 16:54, 30 December 2009
With this function, you can set if a ped has a head or not.
Syntax
bool setPedHeadless ( ped thePed, bool headState )
Required Arguments
- thePed: The ped to check.
- headState: head state, use true if you want the ped be headless, use false to give back the head.
Returns
Returns true if successful, false otherwise
Example
<section name="Server" class="server" show="true"> This example enables a player to behead themselves, and give them their head back.
function removeMyHead(thePlayer) setPedHeadless(thePlayer, true) -- Removes the players head outputChatBox("You have been beheaded!", thePlayer, 255, 0, 0) -- A confirmation message for the player end addCommandHandler("beheadme", removeMyHead) function giveBackHead(thePlayer) setPedHeadless(thePlayer, false) -- Gives the player a head outputChatBox("You have been given a head!", thePlayer, 255, 0, 0) -- A confirmation message for the player end addCommandHandler("headmeup", giveBackHead)
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