Player.ShouldDrawLocalPlayer

From GMod Wiki

Jump to: navigation, search
Function
Syntax Player:ShouldDrawLocalPlayer( )
Description:
Returns true if the player is not in firstperson mode (thirdperson, looking at himself through a camera).
Returns: Boolean
In Object: Player
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Player.ShouldDrawLocalPlayer]Player.ShouldDrawLocalPlayer [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionWill not render the scripted entity for its owner, unless he is looking at himself using thirdperson or a camera.
Used onNewerClient.png
Code
function ENT:Draw()
	if self:GetOwner() ~= LocalPlayer() or LocalPlayer():ShouldDrawLocalPlayer() then
		self:DrawModel()
	end
end
OutputIf you are the owner of that scripted entity and are currently in firstperson mode, you won't see it at all.


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox