--Original script and conversion to ULX v2 by Golden-Death--
assert( _file.Exists( "lua/ULib/init.lua" ), "ULX Cleaner needs ULib to run!" )
_OpenScript( "ULib/init.lua" )
assert( ULib.VERSION >= 1, "ULX Cleaner requires ULib version 1 or higher to run!" )
function cc_ulxClean( userid, args, argv, argc )
adminnamer = _PlayerInfo(userid, "name")
if argv[1] == "all" then
_ServerCommand("ent_remove_all prop_physics\n")
_ServerCommand("ent_remove_all physics_balloon\n")
_ServerCommand("ent_remove_all physics_thruster\n")
_ServerCommand("ent_remove_all prop_placement\n")
_ServerCommand("ent_remove_all prop_ragdoll\n")
_ServerCommand("ent_remove_all hl2mp_ragdoll\n")
_ServerCommand("ent_remove_all func_physbox\n")
_ServerCommand("ent_remove_all keyframe_rope\n")
_ServerCommand("ent_remove_all prop_emitter\n")
_ServerCommand("ent_remove_all env_flare\n")
_ServerCommand("ent_remove_all entityflame\n")
_ServerCommand("ent_remove_all prop_timedexplosion\n")
_ServerCommand("ent_remove_all prop_vehicle_airboat\n")
_ServerCommand("ent_remove_all prop_vehicle_jeep\n")
_ServerCommand("ent_remove_all prop_vehicle_prisoner_pod\n")
_ServerCommand("ent_remove_all env_spark\n")
_ServerCommand("ent_remove_all prop_wheel\n")
_ServerCommand("r_cleardecals\n")
_ServerCommand("ent_remove_all phys_constraint\n")
_ServerCommand("ent_remove_all phys_ballsocket\n")
_ServerCommand("ent_remove_all phys_slideconstraint\n")
_ServerCommand("ent_remove_all prop_flashlight\n")
_ServerCommand("ent_remove_all phys_magnet\n")
_ServerCommand("ent_remove_all phys_lengthconstraint\n")
_ServerCommand("ent_remove_all npc_combine\n")
_ServerCommand("ent_remove_all npc_combine_p\n")
_ServerCommand("ent_remove_all npc_combine_e\n")
_ServerCommand("ent_remove_all npc_metropolice\n")
_ServerCommand("ent_remove_all npc_monk\n")
_ServerCommand("ent_remove_all npc_alyx\n")
_ServerCommand("ent_remove_all npc_barney\n")
_ServerCommand("ent_remove_all npc_citizen\n")
_ServerCommand("ent_remove_all npc_citizen_refugee\n")
_ServerCommand("ent_remove_all npc_citizen_rebel\n")
_ServerCommand("ent_remove_all npc_vortigaunt\n")
_ServerCommand("ent_remove_all npc_dog_play\n")
_ServerCommand("ent_remove_all npc_antlion\n")
_ServerCommand("ent_remove_all npc_antlionguard\n")
_ServerCommand("ent_remove_all npc_poisonzombie\n")
_ServerCommand("ent_remove_all npc_fastzombie\n")
_ServerCommand("ent_remove_all npc_zombie\n")
_ServerCommand("ent_remove_all npc_zombie_torso\n")
_ServerCommand("ent_remove_all npc_headcrab\n")
_ServerCommand("ent_remove_all npc_headcrab_black\n")
_ServerCommand("ent_remove_all npc_headcrab_fast\n")
_ServerCommand("ent_remove_all npc_headcrab_poison\n")
_ServerCommand("ent_remove_all npc_manhack\n")
_ServerCommand("ent_remove_all npc_cscanner\n")
_ServerCommand("ent_remove_all npc_sscanner\n")
_ServerCommand("ent_remove_all npc_turret_floor\n")
_ServerCommand("ent_remove_all npc_crow\n")
_ServerCommand("ent_remove_all npc_pigeon\n")
_ServerCommand("ent_remove_all npc_seagull\n")
_ServerCommand("ent_remove_all npc_rollermine\n")
_ServerCommand("ent_remove_all npc_barnacle\n")
_ServerCommand("ent_remove_all npc_breen\n")
_ServerCommand("ent_remove_all npc_combinedropship\n")
_ServerCommand("ent_remove_all npc_combinegunship\n")
_ServerCommand("ent_remove_all npc_eli\n")
_ServerCommand("ent_remove_all npc_gman\n")
_ServerCommand("ent_remove_all npc_helicopter\n")
_ServerCommand("ent_remove_all npc_kleiner\n")
_ServerCommand("ent_remove_all npc_mossman\n")
_ServerCommand("ent_remove_all npc_stalker\n")
_ServerCommand("ent_remove_all npc_strider\n")
_ServerCommand("ent_remove_all npc_vortigaunt\n")
_ServerCommand("ent_remove_all npc_dog\n")
_ServerCommand("ent_remove_all npc_thumper\n")
_ServerCommand("ent_remove_all npc_grenade_frag\n")
_ServerCommand("ent_remove_all npc_satchel\n")
_ServerCommand("ent_remove_all npc_thumper\n")
_ServerCommand("ent_remove_all npc_tripmine\n")
_ServerCommand("ent_remove_all npc_hopper\n")
_ServerCommand("ent_remove_all npc_sniper\n")
_ServerCommand("ent_remove_all npc_ichthyosaur\n")
_ServerCommand("ent_remove_all npc_combine_camera\n")
_ServerCommand("ent_remove_all physics_cannister\n")
_PrintMessageAll(HUD_PRINTTALK, "[Golden Remover] "..adminnamer.." - Everything removed")
return
end
if argv[1] == "npcs" then
_ServerCommand("ent_remove_all npc_combine\n")
_ServerCommand("ent_remove_all npc_combine_p\n")
_ServerCommand("ent_remove_all npc_combine_e\n")
_ServerCommand("ent_remove_all npc_metropolice\n")
_ServerCommand("ent_remove_all npc_monk\n")
_ServerCommand("ent_remove_all npc_alyx\n")
_ServerCommand("ent_remove_all npc_barney\n")
_ServerCommand("ent_remove_all npc_citizen\n")
_ServerCommand("ent_remove_all npc_citizen_refugee\n")
_ServerCommand("ent_remove_all npc_citizen_rebel\n")
_ServerCommand("ent_remove_all npc_vortigaunt\n")
_ServerCommand("ent_remove_all npc_dog_play\n")
_ServerCommand("ent_remove_all npc_antlion\n")
_ServerCommand("ent_remove_all npc_antlionguard\n")
_ServerCommand("ent_remove_all npc_poisonzombie\n")
_ServerCommand("ent_remove_all npc_fastzombie\n")
_ServerCommand("ent_remove_all npc_zombie\n")
_ServerCommand("ent_remove_all npc_zombie_torso\n")
_ServerCommand("ent_remove_all npc_headcrab\n")
_ServerCommand("ent_remove_all npc_headcrab_black\n")
_ServerCommand("ent_remove_all npc_headcrab_fast\n")
_ServerCommand("ent_remove_all npc_headcrab_poison\n")
_ServerCommand("ent_remove_all npc_manhack\n")
_ServerCommand("ent_remove_all npc_cscanner\n")
_ServerCommand("ent_remove_all npc_sscanner\n")
_ServerCommand("ent_remove_all npc_turret_floor\n")
_ServerCommand("ent_remove_all npc_crow\n")
_ServerCommand("ent_remove_all npc_pigeon\n")
_ServerCommand("ent_remove_all npc_seagull\n")
_ServerCommand("ent_remove_all npc_rollermine\n")
_ServerCommand("ent_remove_all npc_barnacle\n")
_ServerCommand("ent_remove_all npc_breen\n")
_ServerCommand("ent_remove_all npc_combinedropship\n")
_ServerCommand("ent_remove_all npc_combinegunship\n")
_ServerCommand("ent_remove_all npc_eli\n")
_ServerCommand("ent_remove_all npc_gman\n")
_ServerCommand("ent_remove_all npc_helicopter\n")
_ServerCommand("ent_remove_all npc_kleiner\n")
_ServerCommand("ent_remove_all npc_mossman\n")
_ServerCommand("ent_remove_all npc_stalker\n")
_ServerCommand("ent_remove_all npc_strider\n")
_ServerCommand("ent_remove_all npc_vortigaunt\n")
_ServerCommand("ent_remove_all npc_dog\n")
_ServerCommand("ent_remove_all npc_thumper\n")
_ServerCommand("ent_remove_all npc_grenade_frag\n")
_ServerCommand("ent_remove_all npc_satchel\n")
_ServerCommand("ent_remove_all npc_thumper\n")
_ServerCommand("ent_remove_all npc_tripmine\n")
_ServerCommand("ent_remove_all npc_hopper\n")
_ServerCommand("ent_remove_all npc_sniper\n")
_ServerCommand("ent_remove_all npc_ichthyosaur\n")
_ServerCommand("ent_remove_all npc_combine_camera\n")
_PrintMessageAll(HUD_PRINTTALK, "[Golden Remover] "..adminnamer.." - NPCs removed")
return
end
if argv[1] == "ragdolls" then
_ServerCommand("ent_remove_all prop_ragdoll\n")
_ServerCommand("ent_remove_all hl2mp_ragdoll\n")
_PrintMessageAll(HUD_PRINTTALK, "[Golden Remover] "..adminnamer.." - Ragdolls removed")
return
end
if argv[1] == "effects" then
_ServerCommand("ent_remove_all prop_placement\n")
_ServerCommand("ent_remove_all physics_cannister\n")
_PrintMessageAll(HUD_PRINTTALK, "[Golden Remover] "..adminnamer.." - Effects removed")
return
end
if argv[1] == "props" then
_ServerCommand("ent_remove_all prop_physics\n")
_ServerCommand("ent_remove_all func_physbox\n")
_PrintMessageAll(HUD_PRINTTALK, "[Golden Remover] "..adminnamer.." - Props removed")
return
end
if argv[1] == "balloons" then
_ServerCommand("ent_remove_all physics_balloon\n")
_PrintMessageAll(HUD_PRINTTALK, "[Golden Remover] "..adminnamer.." - Balloons removed")
return
end
if argv[1] == "thrusters" then
_ServerCommand("ent_remove_all physics_thruster\n")
_PrintMessageAll(HUD_PRINTTALK, "[Golden Remover] "..adminnamer.." - Thrusters removed")
return
end
if argv[1] == "ropes" then
_ServerCommand("ent_remove_all keyframe_rope\n")
_ServerCommand("ent_remove_all phys_lengthconstraint\n")
_PrintMessageAll(HUD_PRINTTALK, "[Golden Remover] "..adminnamer.." - Ropes removed")
return
end
if argv[1] == "emitters" then
_ServerCommand("ent_remove_all prop_emitter\n")
_PrintMessageAll(HUD_PRINTTALK, "[Golden Remover] "..adminnamer.." - Emitters removed")
return
end
if argv[1] == "flares" then
_ServerCommand("ent_remove_all env_flare\n")
_PrintMessageAll(HUD_PRINTTALK, "[Golden Remover] "..adminnamer.." - Flares removed")
return
end
if argv[1] == "flames" then
_ServerCommand("ent_remove_all entityflame\n")
_PrintMessageAll(HUD_PRINTTALK, "[Golden Remover] "..adminnamer.." - Flames removed")
return
end
if argv[1] == "dynamite" then
_ServerCommand("ent_remove_all prop_timedexplosion\n")
_PrintMessageAll(HUD_PRINTTALK, "[Golden Remover] "..adminnamer.." - Dynamite removed")
return
end
if argv[1] == "vehicles" then
_ServerCommand("ent_remove_all prop_vehicle_airboat\n")
_ServerCommand("ent_remove_all prop_vehicle_jeep\n")
_ServerCommand("ent_remove_all prop_vehicle_prisoner_pod\n")
_PrintMessageAll(HUD_PRINTTALK, "[Golden Remover] "..adminnamer.." - Vehicles removed")
return
end
if argv[1] == "sparks" then
_ServerCommand("ent_remove_all env_spark\n")
_PrintMessageAll(HUD_PRINTTALK, "[Golden Remover] "..adminnamer.." - Sparks removed")
return
end
if argv[1] == "wheels" then
_ServerCommand("ent_remove_all prop_wheel\n")
_PrintMessageAll(HUD_PRINTTALK, "[Golden Remover] "..adminnamer.." - Wheels removed")
return
end
if argv[1] == "decals" then
_ServerCommand("r_cleardecals\n")
_PrintMessageAll(HUD_PRINTTALK, "[Golden Remover] "..adminnamer.." - Decals removed")
return
end
if argv[1] == "welds" then
_ServerCommand("ent_remove_all phys_constraint\n")
_PrintMessageAll(HUD_PRINTTALK, "[Golden Remover] "..adminnamer.." - Welds removed")
return
end
if argv[1] == "ballsockets" then
_ServerCommand("ent_remove_all phys_ballsocket\n")
_PrintMessageAll(HUD_PRINTTALK, "[Golden Remover] "..adminnamer.." - Ballsockets removed")
return
end
if argv[1] == "sliders" then
_ServerCommand("ent_remove_all phys_slideconstraint\n")
_PrintMessageAll(HUD_PRINTTALK, "[Golden Remover] "..adminnamer.." - Sliders removed")
return
end
if argv[1] == "lamps" then
_ServerCommand("ent_remove_all prop_flashlight\n")
_PrintMessageAll(HUD_PRINTTALK, "[Golden Remover] "..adminnamer.." - Lamps removed")
return
end
if argv[1] == "magnets" then
_ServerCommand("ent_remove_all phys_magnet\n")
_PrintMessageAll(HUD_PRINTTALK, "[Golden Remover] "..adminnamer.." - Magnets removed")
return
end
if argv[1] == "nill" then
_PrintMessage(userid, HUD_PRINTTALK, "[Golden Remover] See console")
_PrintMessage(userid, HUD_PRINTCONSOLE, "--------------\n")
_PrintMessage(userid, HUD_PRINTCONSOLE, "Golden-Death's Multi-Purpose Remover\nYou may use these keywords after 'ulx clean' to remove that type of item\n")
_PrintMessage(userid, HUD_PRINTCONSOLE, "Type 'all' after 'ulx clean' to get rid of everything\nNPCs\nRagdolls\n")
_PrintMessage(userid, HUD_PRINTCONSOLE, "Effects\nProps\nBalloons\nThrusters\nRopes\nEmitters\nFlares\nFlames\nDynamite\nVehicles\nSparks\n")
_PrintMessage(userid, HUD_PRINTCONSOLE, "Wheels\nDecals\nWelds\nBallsockets\nSliders\nLamps\nMagnets\n------")
return
end
_PrintMessageAll(HUD_PRINTTALK, "[Golden Remover] Sorry, "..argv[1].." is not a valid type. Say !clean help for a list of types")
return
end
ULib.CONCOMMAND( "clean", cc_ulxClean, "Cleans up the server. ulx clean (type). Say !clean help for more info)", ACCESS_BAN, "!clean" )