Player.ShouldDropWeapon

From GMod Wiki

Revision as of 17:45, 31 August 2011 by TheFreeman193 (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Function
Syntax Player:ShouldDropWeapon( Boolean drop )
Description:
Forces a player to drop his current weapon when he dies.
Returns: nil
In Object: Player
Realm: NewerServer.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Player.ShouldDropWeapon]Player.ShouldDropWeapon [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Example

DescriptionPlayers drop their current weapons when they die.
Used onNewerServer.png
Code
 
hook.Add("DoPlayerDeath", "drop weapon after death", function(ply)
	ply:ShouldDropWeapon(true);
end);
 
hook.Add("PlayerDeath", "drop weapon after death", function(ply)
	ply:ShouldDropWeapon(false);
end);
 
OutputN/A

Additional Notes

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox