RU/takeWeapon: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
Enterprise (talk | contribs)
New page: {{Server function}} This function removes a specified weapon from a certain player's inventory. ==Syntax== <syntaxhighlight lang="lua">bool takeWeapon ( player thePlayer, int weaponId )</syntaxhighlight> ===Requ...
 
Enterprise (talk | contribs)
No edit summary
Line 1: Line 1:
{{Server  function}}
{{Server  function}}
{{Translate}}
This function removes a specified weapon from a certain player's inventory.
This function removes a specified weapon from a certain player's inventory.


Line 22: Line 23:
==See Also==
==See Also==
{{RU/Weapon functions}}
{{RU/Weapon functions}}
[[en:takeWeapon]]

Revision as of 10:53, 10 July 2009

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.

This function removes a specified weapon from a certain player's inventory.

Syntax

bool takeWeapon ( player thePlayer, int weaponId )

Required Arguments

  • thePlayer: A player object referencing the specified player.
  • weaponId: An integer that refers to a weapon that you wish to remove.

Returns

Returns a true if the weapon was removed successfully, false otherwise.

Example

This example removes weapon 28 from player ID 1. If successful, it displays a message in the chat box.

thePlayer = getPlayerFromID ( 1 )
if ( takeWeapon ( thePlayer, 28 ) )
    outputChatBox ( "Weapon 28 removed from " .. getClientName ( thePlayer ) .. "." )
end

See Also

Серверные функции

  • giveWeapon - дает указанное оружие игроку или пешеходу
  • takeAllWeapons - удаляет всё оружие с указанного игрока или пешехода
  • takeWeapon - удаляет указанное оружие или боеприпасы с игрока или пешехода
ДО ВЕРСИИ 1.3.1 :
  • takeWeaponAmmo - удаляет определённое кол-во боеприпасов у игрока для указанного оружия
  • giveWeaponAmmo - даёт определённое кол-во боеприпасов игроку для указанного оружия

Клиентские функции

Общие функции

  • getOriginalWeaponProperty - получает исходное свойство указанного типа оружия
  • getPickupWeapon - получает ID оружия из указанного пикапа
  • getSlotFromWeapon - получает слот к которому принадлежит оружие
  • getWeaponIDFromName - получает ID оружия из его названия
  • getWeaponNameFromID - получает название оружия или причину смерти из его ID
  • getWeaponProperty - получает свойство указанного оружия
  • setWeaponAmmo - устанавливает определенное кол-во боеприпасов для указанного оружия
  • setWeaponProperty - устанавливает свойство указанного типа оружия