TakeWeapon: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
Line 15: Line 15:
   outputChatBox ( "Weapon 1 removed from ", getPlayerName ( player ), "." )
   outputChatBox ( "Weapon 1 removed from ", getPlayerName ( player ), "." )
end</syntaxhighlight>
end</syntaxhighlight>
==See Also==
{{Weapon functions}}

Revision as of 20:29, 20 May 2006

Description

This function removes a specified weapon from a certain player's inventory. It returns a boolean value (true or false) depending on whether the function passed or failed.

Syntax

TakeWeapon ( player, weaponid )

Required Arguments

  • player: A player object referencing the specified player.
  • weaponid: An integer (whole number) that refers to a Weapon that you wish to remove. Click weapon for a page with weapon ID listings.

Example

player = getPlayerFromID ( 1 )
if ( TakeWeapon ( player, 1 ) )
  outputChatBox ( "Weapon 1 removed from ", getPlayerName ( player ), "." )
end

See Also