TakeAllWeapons: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 17: Line 17:
<syntaxhighlight lang="lua">player = getPlayerFromID ( 1 )
<syntaxhighlight lang="lua">player = getPlayerFromID ( 1 )
takeAllWeapons ( player )  
takeAllWeapons ( player )  
outputChatBox ( "All weapons removed from ", getPlayerName ( player ), "." )</syntaxhighlight>
outputChatBox ( "All weapons removed from " .. getClientName ( player ) .. "." )</syntaxhighlight>


==See Also==
==See Also==
{{Weapon functions}}
{{Weapon functions}}

Revision as of 18:43, 15 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 you want to take them away when the player is alive.

Syntax

takeAllWeapons ( thePlayer )

Required Arguments

  • thePlayer: A player object referencing the specified player

Returns

Returns true if the function succeeded, false otherwise.

Example

player = getPlayerFromID ( 1 )
takeAllWeapons ( player ) 
outputChatBox ( "All weapons removed from " .. getClientName ( player ) .. "." )

See Also