Created
November 21, 2022 09:27
-
-
Save samisalreadytaken/5a1bc7ed7c147601bc49965688fd2b2e 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
| // | |
| // bind g drop | |
| // | |
| if ( SERVER_DLL ) | |
| { | |
| Convars.RegisterCommand( "drop", function(...) | |
| { | |
| local player = Convars.GetCommandClient(); | |
| local weapon = player.GetActiveWeapon(); | |
| if ( weapon ) | |
| { | |
| player.DropWeapon( weapon ); | |
| } | |
| }, "", FCVAR_GAMEDLL ); | |
| Convars.RegisterCommand( "dropall", function(...) | |
| { | |
| local player = Convars.GetCommandClient(); | |
| player.DropAllWeapons( false ); | |
| }, "", FCVAR_GAMEDLL ); | |
| // hook phys_swap command by default (G) | |
| Convars.RegisterCommand( "phys_swap", function(...) { SendToConsole("drop") }, "", FCVAR_GAMEDLL ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment