DarkRP.Entity.OwnedBy

From Official DarkRP Wiki
Jump to: navigation, search
This page refers to DarkRP 2.4.3. This information may be incorrect as of later versions.
Check here for a up-to-date list of functions.
Function
Function name Entity:OwnedBy(Player player)
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.darkrp.com/index.php?title=DarkRP.Entity.OwnedBy]Entity:OwnedBy[/url][/b]

Examples

DescriptionChecks if the player is admin and the door owner before removing it.
Used onNewerServer.png
Code
if myent:OwnedBy( ply ) then
	if ply:IsAdmin() 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

  • Will return true if the player is a co-owner of the door too.