Disable Clear bricks for non admins

Author Topic: Disable Clear bricks for non admins  (Read 790 times)

I want to entirely disable the command /clearbricks for non-admins.

The reason for this is if someone spams up my server while I am away (could be for hours) and they cause trouble for everyone else involved. Well as soon as I get back they will clear all evidence of spam.

I want to disable this for non admins so they can't hide evidence.



Also for building contests people get mad and just rage clear stuff before they leave. This I also want stopped.

Code: [Select]
package DisableClearBricksForNonAdmins
{
function serverCmdClearBricks(%client)
{
if(!%client.isAdmin)
{
messageClient(%client, '', "/clearBricks is disabled for non admins.");

return;
}

parent::serverCmdClearBricks(%client);
}
};
activatePackage(DisableClearBricksForNonAdmins);

I forget do I package that as a script or server?

I forget do I package that as a script or server?

Not sure what you mean by "script or server"

Just make sure the server executes that block of code.

doing either Script_x or Server_x doesn't matter, it's just a way to organize add-ons
hell if you wanted to you could package up that code into Weapon_x and it'll still work

To add to Gytyyhgfffff's post, it only matters if your file starts with "Gamemode_", where it then is processed as a gamemode by the gamemode system.

To add to Gytyyhgfffff's post, it only matters if your file starts with "Gamemode_", where it then is processed as a gamemode by the gamemode system.
Not entirely true.
Gamemodes can still possess a server.cs and client.cs and can be enabled like normal add-ons, and they require a gamemode.txt file to show up as a gamemode.
Other types do matter though, like Print_, Face_, and Decal_. Maybe grounds and skies too.

I forget do I package that as a script or server?
Server_ is more proper. Script_ is ambiguous.

To add to Gytyyhgfffff's post, it only matters if your file starts with "Gamemode_", where it then is processed as a gamemode by the gamemode system.
That's false. I could include a gamemode.txt and a colorset.txt in a weapon file and I'm sure it could work

That's false. I could include a gamemode.txt and a colorset.txt in a weapon file and I'm sure it could work

No, doing this does not work.  It must be Gamemode_* to be detected as a gamemode and added to the Gamemodes selection screen.

I typically only use Script_ if it has a server.cs and a client.cs, or if it's a really small server sided mod.

Either way, let's just keep the tags on there, so it's easier to organize.