Created
July 29, 2009 16:55
-
-
Save severedskullz/158260 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function DropActiveWeapon(ply) | |
| local ent = ply:GetActiveWeapon() | |
| if not ValidEntity(ent) then return "" end | |
| ply:DropWeapon(ply:GetActiveWeapon()) | |
| return "" | |
| end | |
| concommand.Add("DropActiveWeapon", DropActiveWeapon) | |
| // The event function | |
| function plychat( player, text, teamchat, alive ) | |
| print "it ran" | |
| if (text == "/drop") then | |
| DropActiveWeapon(player) | |
| print "It dropped" | |
| end | |
| end | |
| // Hook the event. | |
| hook.Add( "OnPlayerChat", "plychat", plychat); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment