Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --新浪微博:@戈登走過去
- --Twitter:@Gordonwalkedby
- --just a changed version of garrysmod/garrysmod/gamemodes/sandbox/gamemode/cl_init.lua
- CreateConVar( "HIDE_SboxNotifyAll", 0 , 128, "Make me into 1 to mute and hide the notify of Sandbox Undo, Unfroze, CLEANUP, Limit. " )
- CreateConVar( "HIDE_SboxNotifysound", 0 , 128, "Make me into 1 to mute the sound of Sandbox Undo, Unfroze, CLEANUP, Limit. " )
- CreateConVar( "HIDE_SboxNotifytext", 0 , 128, "Make me into 1 to hide the notify of Sandbox Undo, Unfroze, CLEANUP, Limit. " )
- --[[---------------------------------------------------------
- Sandbox Gamemode
- This is GMod's default gamemode
- -----------------------------------------------------------]]
- include( 'shared.lua' )
- include( 'cl_spawnmenu.lua' )
- include( 'cl_notice.lua' )
- include( 'cl_hints.lua' )
- include( 'cl_worldtips.lua' )
- include( 'cl_search_models.lua' )
- include( 'gui/IconEditor.lua' )
- --
- -- Make BaseClass available
- --
- DEFINE_BASECLASS( "gamemode_base" )
- local physgun_halo = CreateConVar( "physgun_halo", "1", { FCVAR_ARCHIVE }, "Draw the physics gun halo?" )
- function GM:Initialize()
- BaseClass.Initialize( self )
- end
- function GM:LimitHit( name )
- if GetConVarNumber( "HIDE_SboxNotifyAll" ) == 1 then return end
- if GetConVarNumber( "HIDE_SboxNotifytext" ) == 0 then self:AddNotify( "#SBoxLimit_"..name, NOTIFY_ERROR, 6 ) end
- if GetConVarNumber( "HIDE_SboxNotifysound" ) == 0 then surface.PlaySound( "buttons/button10.wav" ) end
- end
- function GM:OnUndo( name, strCustomString )
- if GetConVarNumber( "HIDE_SboxNotifyAll" ) == 1 then return end
- if GetConVarNumber( "HIDE_SboxNotifytext" ) == 0 then
- if ( !strCustomString ) then
- self:AddNotify( "#Undone_"..name, NOTIFY_UNDO, 2 )
- else
- self:AddNotify( strCustomString, NOTIFY_UNDO, 2 )
- end
- end
- -- Find a better sound :X
- if GetConVarNumber( "HIDE_SboxNotifysound" ) == 0 then surface.PlaySound( "buttons/button15.wav" ) end
- end
- function GM:OnCleanup( name )
- if GetConVarNumber( "HIDE_SboxNotifyAll" ) == 1 then return end
- if GetConVarNumber( "HIDE_SboxNotifytext" ) == 0 then self:AddNotify( "#Cleaned_"..name, NOTIFY_CLEANUP, 5 ) end
- -- Find a better sound :X
- if GetConVarNumber( "HIDE_SboxNotifysound" ) == 0 then surface.PlaySound( "buttons/button15.wav" ) end
- end
- function GM:UnfrozeObjects( num )
- if GetConVarNumber( "HIDE_SboxNotifyAll" ) == 1 then return end
- if GetConVarNumber( "HIDE_SboxNotifytext" ) == 0 then self:AddNotify( "Unfroze "..num.." Objects", NOTIFY_GENERIC, 3 ) end
- -- Find a better sound :X
- if GetConVarNumber( "HIDE_SboxNotifysound" ) == 0 then surface.PlaySound( "npc/roller/mine/rmine_chirp_answer1.wav" ) end
- end
- function GM:HUDPaint()
- self:PaintWorldTips()
- -- Draw all of the default stuff
- BaseClass.HUDPaint( self )
- self:PaintNotes()
- end
- --[[---------------------------------------------------------
- Draws on top of VGUI..
- -----------------------------------------------------------]]
- function GM:PostRenderVGUI()
- BaseClass.PostRenderVGUI( self )
- end
- local PhysgunHalos = {}
- --[[---------------------------------------------------------
- Name: gamemode:DrawPhysgunBeam()
- Desc: Return false to override completely
- -----------------------------------------------------------]]
- function GM:DrawPhysgunBeam( ply, weapon, bOn, target, boneid, pos )
- if ( physgun_halo:GetInt() == 0 ) then return true end
- if ( IsValid( target ) ) then
- PhysgunHalos[ ply ] = target
- end
- return true
- end
- hook.Add( "PreDrawHalos", "AddPhysgunHalos", function()
- if ( !PhysgunHalos || table.Count( PhysgunHalos ) == 0 ) then return end
- for k, v in pairs( PhysgunHalos ) do
- if ( !IsValid( k ) ) then continue end
- local size = math.random( 1, 2 )
- local colr = k:GetWeaponColor() + VectorRand() * 0.3
- halo.Add( PhysgunHalos, Color( colr.x * 255, colr.y * 255, colr.z * 255 ), size, size, 1, true, false )
- end
- PhysgunHalos = {}
- end )
- --[[---------------------------------------------------------
- Name: gamemode:NetworkEntityCreated()
- Desc: Entity is created over the network
- -----------------------------------------------------------]]
- function GM:NetworkEntityCreated( ent )
- --
- -- If the entity wants to use a spawn effect
- -- then create a propspawn effect if the entity was
- -- created within the last second (this function gets called
- -- on every entity when joining a server)
- --
- if ( ent:GetSpawnEffect() && ent:GetCreationTime() > (CurTime() - 1.0) ) then
- local ed = EffectData()
- ed:SetOrigin( ent:GetPos() )
- ed:SetEntity( ent )
- util.Effect( "propspawn", ed, true, true )
- end
- end
Add Comment
Please, Sign In to add comment