DarkRP.Entity.UnOwn

From Official DarkRP Wiki
Jump to navigation Jump to 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:UnOwn(Player player)
Description:
Makes the provided player un-own the door.
Returns: nil
Part of Library: Entity
Realm: NewerServer.png
BBCode Link: [b][url=http://wiki.darkrp.com/index.php?title=DarkRP.Entity.UnOwn]Entity:UnOwn[/url][/b]

Examples

DescriptionMakes the player un-own all their doors.
Used onNewerServer.png
Code
function UnOwnAllPlayerDoors( ply )
	for _, ent in ipairs(ents.GetAll()) do
		if ent:IsDoor() == true then
			if ent:IsOwnedBy( ply ) == true then
				ent:UnOwn( ply )
			end
		end
	end  
end
OutputN/A


Additional Notes

  • If the player does not own the door anyway, the function will stop.
  • You can use this to un-own all the players doors.