Author Topic: Restrict Items (v2 saving and un-restricting)  (Read 3944 times)

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 »


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

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?

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

am I lying?


Now I can enable the mininuke!
10/10

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

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

misquote

Magic mirror on the wall, (balhabdfasdf)


Lol.

This is useful.  Thanks.  :)

How do you unrestrict an item?

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

ex.
/restrictevent kill
/restrictevent onactivate
/restrictevent centerprintall

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.

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?

cn i hz xna srd?
We need more ideas to the table!