Difference between revisions of "DarkRP.Entity.removeDoorOwner"

From Official DarkRP Wiki
Jump to navigation Jump to search
(No need for <lua> tags.)
(https://github.com/FPtje/DarkRP/commit/dfb57408a8ce6cfc0f9c32aaad45e43d4b70cc24)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
{{Lua_function |
 
{{Lua_function |
 
gamemode = DarkRP |
 
gamemode = DarkRP |
function_name = Entity:RemoveOwner |
+
function_name = Entity:removeDoorOwner |
arguments = {{Arg|Player}} ply|
+
arguments = {{Arg|Player|ply}} |
 
description = Makes a player no longer own the door.|
 
description = Makes a player no longer own the door.|
library = {{Arg|Entity}} |
+
library = {{Type|Entity}} |
 
lua_state = {{Serverside}} |
 
lua_state = {{Serverside}} |
 
}}
 
}}
Line 15: Line 15:
 
for _, ent in ipairs(ents.GetAll()) do
 
for _, ent in ipairs(ents.GetAll()) do
 
if ent:IsDoor() == true then
 
if ent:IsDoor() == true then
ent:RemoveOwner(ply)
+
ent:removeDoorOwner(ply)
 
end
 
end
 
end |
 
end |
Line 21: Line 21:
  
 
==Important things to know==
 
==Important things to know==
*RemoveAllowed makes the player no longer allowed to own the door, this. Actually makes the player actually un-own the door.
+
*RemoveAllowed makes the player no longer allowed to own the door, this makes the player actually unown the door.

Latest revision as of 20:00, 3 July 2013

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:removeDoorOwner(Player ply)
Description:
Makes a player no longer 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.removeDoorOwner]Entity:removeDoorOwner[/url][/b]

Examples

DescriptionMakes a player no longer own every door that he has group ownership with.
Used onNewerServer.png
Code
--ply = player that's gonna loose all his/her doors
for _, ent in ipairs(ents.GetAll()) do
	if ent:IsDoor() == true then
		ent:removeDoorOwner(ply)
	end
end
OutputN/A


Important things to know

  • RemoveAllowed makes the player no longer allowed to own the door, this makes the player actually unown the door.