TakeAllWeapons: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
m (Can also be used on Peds)
Line 1: Line 1:
__NOTOC__
__NOTOC__
{{Server function}}
{{Server function}}
This function removes every weapons from a specified player, rendering him unarmed.
This function removes every weapons from a specified ped, rendering it 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.}}
{{Note|Weapons are removed when a ped dies by default. This means that it is only appropriate to use this function while a ped is alive.}}


==Syntax==
==Syntax==
<syntaxhighlight lang="lua">bool takeAllWeapons ( player thePlayer )</syntaxhighlight>
<syntaxhighlight lang="lua">bool takeAllWeapons ( ped thePed )</syntaxhighlight>


===Required Arguments===
===Required Arguments===
*'''thePlayer''': A [[player]] object referencing the specified player
*'''thePlayer''': A [[ped]] element referencing the specified ped


===Returns===
===Returns===

Revision as of 14:20, 23 April 2013

This function removes every weapons from a specified ped, rendering it unarmed.

[[{{{image}}}|link=|]] Note: Weapons are removed when a ped dies by default. This means that it is only appropriate to use this function while a ped is alive.

Syntax

bool takeAllWeapons ( ped thePed )

Required Arguments

  • thePlayer: A ped element referencing the specified ped

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