DarkRP.Entity.OwnedBy

From GMod Wiki

Jump to: navigation, search
Deletion.pngThis page has been nominated for deletion. Deletion is due within approximately 30 days from nomination, unless the deletion has been disputed on the talk page. See more pages nominated for deletion here.
Reason for deletion: Not what Garry wants the wiki to be used for
Last Edit was made on 11/16/2011
Gamemode Function: DarkRP.Entity.OwnedBy
DarkRP.Entity.OwnedBy is a function that is defined in the DarkRP Gamemode and its derivatives.
Function
Syntax Entity:OwnedBy( Player player )
Where is this used?
Description:
Returns true if the door is owned by the player supplied.
Returns: Boolean
Part of Library: Entity
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=DarkRP.Entity.OwnedBy]DarkRP.Entity.OwnedBy [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionChecks if the player is admin and the door owner before removing it, you will have to supply ply and myent.
Used onNewerServer.png
Code
if myent:OwnedBy( ply ) == true then
	if ply:IsAdmin() == true then
		myent:Remove()
	else
		ply:ChatPrint("Sorry, that feature is Admin Only!")
	end
else
	ply:ChatPrint("That's not your door!")
end
OutputN/A


Additional Notes

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox