cleanup.Add

From GMod Wiki

Jump to: navigation, search
Function
Syntax cleanup.Add( Player ply, String type, Entity ent )
Where is this used?
Description:
Add an entity to a players clean up list.
Returns: nil
Part of Library: cleanup
Realm: NewerServer.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Cleanup.Add]Cleanup.Add [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionAdds a prop_physics under the cleanup category "army" to ply's cleanup list.
Used onNewerServer.png
Code
 
  local ent = ents.Create ("prop_physics")
  ent:SetPos (Vector(0,0,0))
  ent:SetAngles (Angle (0, 0, 0))
  ent:Spawn()
  ent:Activate()
  local ply = player.GetByID(1) 
  AddCleanup( ply, "army", ent)
OutputWhen the player presses the cleanup button for "army", the prop_physics will be deleted.


Additional Notes

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox