SP Utils

Release your plugins here!
necavi
Developer
Posts: 129
Joined: Wed Jan 30, 2013 9:51 pm

SP Utils

Postby necavi » Wed May 20, 2015 2:24 am

Here's a simple set of utilities I use for commands/colourizing chat.

Overview of useful functions:
decorator utils.Command - replaces the builtin Client/Server/Say command decorator with one that works with all three, similar to Sourcemod's command system, it even supports ! and / say commands in the same way that Sourcemod does. The callbacks to this function take the form callback(CommandSourceProxy, command) where command is the builtin command response (except for say commands, they're modified slightly to make them work the same as client/server commands) CommandSourceProxy is a handy little thing that allows you to simply call CommandSourceProxy.message("message") and depending on where the command was sent from it sends back a say/console/server message.

function utils.target_filter - wraps filters.players.PlayerIter to give similar filtering to Sourcemod's command filtering (e.g. <playername>|#<userid>|@<filter>) for significantly simpler target processing.

function colourizer.colourize - returns a string with all instances of colours replaced by their colour codes. (e.g. "c=(white)" replaced by "FFFFFF") Should work with all supported games.

Get it here.

Return to “Plugin Releases”

Who is online

Users browsing this forum: No registered users and 15 guests