Blockland Welcome, Guest. Please login or register.
Did you miss your activation email?
July 22, 2017, 08:51:35 PM

Home Help Login Register
+  Blockland Forum
|-+  Blockland Files
| |-+  Add-Ons
| | |-+  Restrict Items (v2 saving and un-restricting)
Pages: [1] 2
Author Topic: Restrict Items (v2 saving and un-restricting)  (Read 3401 times)
Pecon

« January 12, 2014, 02:21:46 AM »

This rather simple server mod allows you to restrict what items normal players are allowed to equip. Any admin may simply do the easy slash-command.
Examples:
/restrictitem mini-nuke
/restrictitem homing rocket
/restrictitem wrench
/restrictitem Mr. Wiggles


Items can be un-restricted in a similar manner.
Example:
/unrestrictitem wrench

Super admins can save 'profiles' which can be loaded later on so you don't have to re-restrict every item each time you start your server.
Examples:
/saveItemRestrictionProfile fortwars2
/setItemRestrictionProfile fortwars2


You can set a profile to be the 'default' profile. The default profile will automatically be loaded when the server starts.
Examples:
/setItemRestrictionDefaultProfile fortwars2
/clearItemRestrictionDefaultProfile


You don't need to memorize those. You only need to know one command. You can access a full reference of the commands with the help command.
/restrictionHelp



As you could easily tell, this mod can be useful in a variety of situations. No longer will arbitrary rules such as "no using the homing rocket" be needed, just restrict it and relax. 
Admins can still use restricted items. This mod will still allow players to spawn and pick up restricted items, but they will be unable to equip them.



Download

Advanced:
/restrictimage (image) - Super-admin only
/unrestrictimage (image) - Super-admin only
SetImageAsRestricted("image"); - Returns true or false
« Last Edit: November 08, 2016, 05:02:56 AM by Pecon » Logged
Ad Bot

Full members do not see ads

MARBLE MAN

« January 12, 2014, 02:23:24 AM »

Very nice
Logged
Pecon

« January 12, 2014, 02:27:11 AM »

Very nice
oh magical coding genie, does my formatting make my code look fat?
Logged
Starzy

« January 12, 2014, 02:46:43 AM »

oh magical coding genie, does my formatting make my code look fat?
mirror mirror on the wall, is marble man the biggest liar of all?
Logged
MARBLE MAN

« January 12, 2014, 03:01:38 AM »

mirror mirror on the wall, is marble man the biggest liar of all?
yes

am I lying?
Logged
SgtDaemon

« January 12, 2014, 04:38:15 AM »

yes

am I lying?

dun dun dun DUUUUUN

plot twist
Logged
Hawt

« January 12, 2014, 09:50:20 AM »

Now I can enable the mininuke!
10/10
Logged
Who Cares99

« January 12, 2014, 10:24:18 AM »

Does it save what items are restricted, so you don't have to restrict the items every time you host?
Logged
Jakobblockhead

« January 12, 2014, 11:42:38 AM »

mirror mirror on the wall, is marble man the biggest liar of all?

misquote

Magic mirror on the wall, (balhabdfasdf)

Logged
SWAT One

« January 12, 2014, 11:50:31 AM »

Lol.

This is useful.  Thanks.  :)
Logged
blueblur121

« January 12, 2014, 02:29:54 PM »

How do you unrestrict an item?
Logged
White Tiger

« January 12, 2014, 02:37:47 PM »

Well done! Now can you do the same thing but for events?

ex.
/restrictevent kill
/restrictevent onactivate
/restrictevent centerprintall
Logged
Pecon

« January 12, 2014, 02:53:55 PM »

How do you unrestrict an item?
When you restrict an item, it tells you the item's image name. e.g. wrenchimage

To unrestrict an item, you open the server console and type <imagename>.isRestricted = false;

Otherwise, you can just restart the server to clear all restrictions.

Well done! Now can you do the same thing but for events?

ex.
/restrictevent kill
/restrictevent onactivate
/restrictevent centerprintall
There is already a mod for this.
Logged
Pecon

« January 13, 2014, 12:32:15 PM »

I suppose I could implement a saving/loading system for this. Perhaps a command that lets you save a 'profile' of blocked items, and then a command to load a profile, and a command to set a profile to load automatically on server startup?

Would anyone want this?
Logged
Doaler1sBack

« January 13, 2014, 02:52:45 PM »

cn i hz xna srd?
We need more ideas to the table!
Logged
Pages: [1] 2  


Login with username, password and session length

Powered by SMF 1.1.20 | SMF © 2013, Simple Machines
Page created in 0.036 seconds with 18 queries.