RU/setPedArmor

From Multi Theft Auto: Wiki
Revision as of 18:18, 8 July 2010 by Damage22 (talk | contribs) (Created page with '__NOTOC__ {{RU/Server function}} {{translate}} Эта функция позволяет установить количество брони у педа. ==Syntax== <cod…')
(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 setPedArmor ( ped thePed, float armor )

Required Arguments

  • thePed: the ped whose armor you want to modify.
  • armor: the amount of armor you want to set on the ped. Valid values are from 0 to 100.

Returns

Returns true if the armor was changed succesfully. Returns false if an invalid ped was specified, or the armor value specified is out of acceptable range.

Example

This example removes the armor of a player.

function givePlayerArmor ( player, command )
	setPedArmor ( player, 100 )    -- Set player's armor to 100 when he types the command 'addarmor'
end
addCommandHandler ( "addarmor", givePlayerArmor )

function removePlayerArmor ( player, command )
	setPedArmor ( player, 0 )      -- Set player's armor to 0 when he types the command 'removearmor'
end
addCommandHandler ( "removearmor", removePlayerArmor )


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