PL/takeWeapon: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{PL/Server function}} | {{PL/Server function}} | ||
Ta funkcja usuwa wybraną broń i (jeśli podana) amunicję z ekwipunku wskazanego gracza. | |||
== | ==Składnia== | ||
<syntaxhighlight lang="lua">bool takeWeapon ( player thePlayer, int weaponId [, int ammo ] )</syntaxhighlight> | <syntaxhighlight lang="lua">bool takeWeapon ( player thePlayer, int weaponId [, int ammo ] )</syntaxhighlight> | ||
=== | ===Wymagane argumenty=== | ||
*'''thePlayer''': | *'''thePlayer''': wskazany [[player|gracz]] | ||
*'''weaponId''': | *'''weaponId''': [[weapon|ID broni]], które chcesz usunąć z ekwipunku | ||
=== | ===Dodatkowe argumenty=== | ||
*'''ammo''': If used, this amount of ammo will be taken instead and the weapon will not be removed. | *'''ammo''': If used, this amount of ammo will be taken instead and the weapon will not be removed. | ||
=== | ===Wynik=== | ||
Returns a ''true'' if the weapon/ammo was removed successfully, ''false'' otherwise. | Returns a ''true'' if the weapon/ammo was removed successfully, ''false'' otherwise. | ||
== | ==Przykład== | ||
This example removes teargas from player. | This example removes teargas from player. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
Line 25: | Line 25: | ||
)</syntaxhighlight> | )</syntaxhighlight> | ||
== | ==Zobacz również== | ||
{{Weapon functions}} | {{Weapon functions}} | ||
[[en:takeWeapon]] | [[en:takeWeapon]] | ||
[[ru:takeWeapon]] | [[ru:takeWeapon]] |
Revision as of 17:49, 13 September 2018
Ta funkcja usuwa wybraną broń i (jeśli podana) amunicję z ekwipunku wskazanego gracza.
Składnia
bool takeWeapon ( player thePlayer, int weaponId [, int ammo ] )
Wymagane argumenty
Dodatkowe argumenty
- ammo: If used, this amount of ammo will be taken instead and the weapon will not be removed.
Wynik
Returns a true if the weapon/ammo was removed successfully, false otherwise.
Przykład
This example removes teargas from player.
addCommandHandler( 'rtear', function( thePlayer ) takeWeapon( thePlayer, 17 ) end )