TakeAllWeapons: Difference between revisions
		
		
		
		
		
		Jump to navigation
		Jump to search
		
				
		
		
	
| m (→See Also) | |||
| (18 intermediate revisions by 12 users not shown) | |||
| Line 1: | Line 1: | ||
| __NOTOC__ | __NOTOC__ | ||
| {{Server function}} | |||
| This function removes every weapons from a specified  | This function removes every weapons from a specified [[ped]], rendering it unarmed. | ||
| {{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"> | <syntaxhighlight lang="lua">bool takeAllWeapons ( ped thePed )</syntaxhighlight> | ||
| ===Required Arguments=== | ===Required Arguments=== | ||
| *''' | *'''thePed''': A [[ped]] element referencing the specified ped | ||
| ===Returns=== | |||
| Returns ''true'' if the function succeeded, ''false'' otherwise. | |||
| ==Example== | ==Example== | ||
| <syntaxhighlight lang="lua"> | This example removes all weapons from every player | ||
| <syntaxhighlight lang="lua"> | |||
| outputChatBox ( " | takeAllWeapons ( root )  --remove all the weapons | ||
| outputChatBox ( "Weapons are not permitted!" ) --tell the players why they lost their weapons</syntaxhighlight> | |||
| ==See Also== | |||
| {{Weapon functions|server}} | |||
| [[ru:takeAllWeapons]] | |||
| [[pl:takeAllWeapons]] | |||
Latest revision as of 22:39, 6 September 2024
This function removes every weapons from a specified ped, rendering it unarmed.
Syntax
bool takeAllWeapons ( ped thePed )
Required Arguments
- thePed: 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 ( root ) --remove all the weapons outputChatBox ( "Weapons are not permitted!" ) --tell the players why they lost their weapons