TakeAllWeapons: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 3: | Line 3: | ||
This function removes every weapons from a specified player, rendering him unarmed. | This function removes every weapons from a specified player, rendering him unarmed. | ||
''Note: weapons are removed when a player dies by default. This means that | ''Note: weapons are removed when a player dies by default. This means that it is only appropriate to use this function while a player is alive.'' | ||
==Syntax== | ==Syntax== | ||
Line 15: | Line 15: | ||
==Example== | ==Example== | ||
This example removes all weapons from every player | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
takeAllWeapons ( getRootElement() ) --remove all the weapons | |||
outputChatBox ( "Weapons are not permitted!" ) --tell the players why they lost their weapons</syntaxhighlight> | |||
outputChatBox ( " | |||
==See Also== | ==See Also== | ||
{{Weapon functions}} | {{Weapon functions}} |
Revision as of 15:48, 29 August 2007
This function removes every weapons from a specified player, rendering him unarmed.
Note: weapons are removed when a player dies by default. This means that it is only appropriate to use this function while a player is alive.
Syntax
takeAllWeapons ( player thePlayer )
Required Arguments
- thePlayer: A player object referencing the specified player
Returns
Returns true if the function succeeded, false otherwise.
Example
This example removes all weapons from every player
takeAllWeapons ( getRootElement() ) --remove all the weapons outputChatBox ( "Weapons are not permitted!" ) --tell the players why they lost their weapons
See Also
- getWeaponProperty
- getPickupWeapon
- getOriginalWeaponProperty
- getSlotFromWeapon
- getWeaponIDFromName
- getWeaponNameFromID
- setWeaponAmmo
- setWeaponProperty