SWEP.FreezeMovement

From GMod Wiki

Revision as of 16:27, 28 August 2010 by Otger (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Event Hook
Hook NameFreezeMovement
SyntaxSWEP:FreezeMovement( )
DescriptionWhile holding this weapon, this hook will determine whether or not the player will be able to rotate his view. This hook does not affect the movement (forwards, backwards, strafe left, strafe right) of the player. If the hook returns true, the view is frozen. Otherwise, the view is not frozen.
ReturnsBoolean
Lua StateNewerClient.png
BBCode[b][url=wiki.garrysmod.com/?title=SWEP.FreezeMovement]SWEP.FreezeMovement [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]

Examples

DescriptionFreezes the view of a specific player by a given name.
Used onNewerClient.png
Code
function SWEP:FreezeMovement()
 
	if self.Owner:Name() == "Abcd" then
		return true
	end
 
	return false
 
end
OutputThe players called "Abcd" won't be able to change the view while holding this weapon, although they will still be able to move.
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox