Files
wnsrc/gamemodes/sandbox/entities/weapons/gmod_tool/init.lua
lifestorm c6d9b6f580 Upload
2024-08-05 18:40:29 +03:00

46 lines
1.1 KiB
Lua

--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
AddCSLuaFile( "cl_init.lua" )
AddCSLuaFile( "shared.lua" )
AddCSLuaFile( "ghostentity.lua" )
AddCSLuaFile( "object.lua" )
AddCSLuaFile( "stool.lua" )
AddCSLuaFile( "cl_viewscreen.lua" )
AddCSLuaFile( "stool_cl.lua" )
include( "shared.lua" )
SWEP.Weight = 5
SWEP.AutoSwitchTo = false
SWEP.AutoSwitchFrom = false
-- Should this weapon be dropped when its owner dies?
function SWEP:ShouldDropOnDie()
return false
end
-- Console Command to switch weapon/toolmode
local function CC_GMOD_Tool( ply, command, arguments )
local targetMode = arguments[1]
if ( targetMode == nil ) then return end
if ( GetConVarNumber( "toolmode_allow_" .. targetMode ) != 1 ) then return end
ply:ConCommand( "gmod_toolmode " .. targetMode )
-- Switch weapons
ply:SelectWeapon( "gmod_tool" )
end
concommand.Add( "gmod_tool", CC_GMOD_Tool, nil, nil, { FCVAR_SERVER_CAN_EXECUTE } )