RU/setPedHeadless

From Multi Theft Auto: Wiki
Revision as of 18:08, 8 July 2010 by Damage22 (talk | contribs) (Created page with '__NOTOC__ {{RU/Server client function}} {{translate}} С помощью этой функции можно задавать, есть ли у педа голова. ==Syntax== <…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Warning.png This page requires local translation. If page will remain not translated in reasonable period of time it would be deleted.
After translating the page completely, please remove the ‎{{translate}}‎ tag from the page.

С помощью этой функции можно задавать, есть ли у педа голова.

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

Click to collapse [-]
Server

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)

Смотрите также