View Single Post
Author Message
FlaminSarge
Veteran Member
Join Date: Jul 2010
Old 11-02-2013 , 20:14   [TF2] Spellbook Commands
Reply With Quote #1

While this plugin performs the same functions as http://forums.alliedmods.net/showthread.php?t=229123, I wrote it with self-usage in mind. That is, "sm_setspell <charges>" as the base command that targets yourself, with various other options available as parameters.

Commands
sm_setspell <charges> [spell] [target] - Defaults to "cheats" admin access. Set the number of spell <charges> on yourself. Optional parameter [spell] accepts a number to set the spell type as well. Optional parameter [target] allows you to specify some target(s) instead of targetting yourself. The number of charges and the ability to target other players is dependent on the cvars and overrides listed further down.
sm_spelllist - Defaults to public access. Displays the list of spells and the number associated with each spell.

ConVars
tf_spellbookcmds_version - Ignore this, it does nothing and you shouldn't touch it.
tf_spellbookcmds_limit -1 - If >= 0, sets the maximum number of charges you're allowed to set with sm_setspell. Whether this affects a player or not depends on one of the overrides listed below.

Overrides
sm_setspell_target - Default "cheats" access. Players with access to this will be able to use the 3rd parameter of sm_setspell to target other players instead of only being able to target themselves.
sm_setspell_unlimit - Default "root" access. Players with access to this will ignore the spell charge limit cvar.

As a reminder, if you want to make sm_setspell public/less-restricted-access (the way I pretty much intended it to be for use with overrides), you can use an override for sm_setspell to change who can access it. Basically, you can give everyone access to sm_setspell but only give certain people access to the ability to target others or go over the spell limit. Give it a try.

Changelog
Code:
1.0 - 11/2/2013
*Initial release
To-Do:
*Split spell limit cvar split into rare vs. normal spells, other changes regarding this dichotomy.
*Release another plugin that enables the Spell HUD/spell drops on any map (I've already figured it out, just need to write it up nicely)

Previous plugin view count: --
Attached Files
File Type: sp Get Plugin or Get Source (tf_spellbookcmds.sp - 3115 views - 5.4 KB)
__________________
Bread EOTL GunMettle Invasion Jungle Inferno 64-bit will break everything. Don't even ask.

All plugins: Randomizer/GiveWeapon, ModelManager, etc.
Post in plugin threads with questions.
Steam is for playing games.
You will be fed to javalia otherwise.
Psyduck likes replays.

Last edited by FlaminSarge; 11-02-2013 at 20:19.
FlaminSarge is offline