General > Developers Corner
ULX Clear Decals Command
LuaTenshi:
--- Quote from: JamminR on December 29, 2011, 07:17:11 AM ---Re: It being included in UPS Menu - but don't let that stop anyone from experimenting/learning how to do it through the Glua and the ULX command structure of this discussion.
Though Hellboy's release is great and allows for addition to UPS settings, and includes a few bonus features such as the cleardecal function...sometimes, something as simple as this one command may be all you want, without the addition of UPS and Hellboy's UPS Menu. (You may use another prop protector..your choice (but why would you not use the best?! :P)
--- End quote ---
Sorry, that I made it seem like I was trying to stop people.
I was just saying that there is an existing script for people to improve on, and or learn from.
Also there is another UPS menu?
----
The above script looks like it should work, I wounder if there is a different way of doing it rather then running a console command on every one.
JamminR:
Not to my knowledge. Messed up your screen name (boy instead of fox). Now corrected.
strategos:
ok this
--- Code: ---local function ClearDecals(ply)
for k, v in pairs(player.GetAll()) do
v:ConCommand("r_cleardecals")
end
ulx.fancyLogAdmin(ply, "#A has cleared all the decals.")
end
local cmd_ClearDecals= ulx.command("Utility", "clear decals", ClearDecals, "!clear")
cmd_ClearDecals:defaultAccess(ULib.ACCESS_ADMIN)
cmd_ClearDecals:help("Clears decals.")
--- End code ---
returns this in console when I try to use it.
[ulx\xgui\commands.lua:259] RunConsoleCommand: Command is blocked! (clear)
Also, you cant configure which usergroups can use it like I can with the Sban module.
Assault_Trooper:
--- Code: ---function ulx.cleardecals( ply )
for k,v in pairs ( player.GetAll() ) do
v:ConCommand( "r_cleardecals" )
v:SendLua( "game.RemoveRagdolls()" )
end
ulx.fancyLogAdmin( ply, "#A cleared all decals" )
end
local cleardecals = ulx.command( "Trooper's Additions", "ulx cleardecals", ulx.cleardecals, "!cleardecals" )
cleardecals:defaultAccess( ULib.ACCESS_ADMIN )
cleardecals:help( "Clears all decals, and removes client ragdolls." )
--- End code ---
This is what I use, it removes the dead NPC's too. And it works definently, been using it for ages.
strategos:
--- Quote from: Assault_Trooper on January 05, 2012, 05:39:18 AM ---
--- Code: ---function ulx.cleardecals( ply )
for k,v in pairs ( player.GetAll() ) do
v:ConCommand( "r_cleardecals" )
v:SendLua( "game.RemoveRagdolls()" )
end
ulx.fancyLogAdmin( ply, "#A cleared all decals" )
end
local cleardecals = ulx.command( "Trooper's Additions", "ulx cleardecals", ulx.cleardecals, "!cleardecals" )
cleardecals:defaultAccess( ULib.ACCESS_ADMIN )
cleardecals:help( "Clears all decals, and removes client ragdolls." )
--- End code ---
This is what I use, it removes the dead NPC's too. And it works definently, been using it for ages.
--- End quote ---
I bestow 1000 blessings upon you. Thanks!
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version