Player.GetViewEntity

From GMod Wiki

Jump to: navigation, search
Function
Syntax Player:GetViewEntity( )
Description:
Returns the view-entity of a player or nil if it isn't set.
Returns: Entity
In Object: Player
Realm: NewerServer.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Player.GetViewEntity]Player.GetViewEntity [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionPrints the view entitiy's class.
Used onNewerServer.png
Code
function PrintViewEntClass( ply )
 
  if( ply:GetViewEntity() ) then
 
    ply:PrintMessage( 3, ply:GetViewEntity():GetClass() )
 
  end
 
end
Outputply's view entity's class.


See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox