Server Utilities
A chat command, poll and more framework for servers. Implements extra features such as map voting and more.
By Fifty
| Date uploaded | 4 years ago |
| Version | 0.9.1 |
| Download link | Fifty-Server_Utilities-0.9.1.zip |
| Downloads | 225 |
| Dependency string | Fifty-Server_Utilities-0.9.1 |
This mod requires the following mods to function
README
Fifty.ServerUtils
A framework for chat command based server mods. The mod is separated into modules all of which have extensive settings and apart from the core can be entirely disabled
Core
The core module implements a chat and a poll handler. For more information on the API check the API section.
Welcome message example:

Poll example:

Other
- Map voting
- Adds map voting functionality at the end of the match or with the command
!rtv
- Adds map voting functionality at the end of the match or with the command
Settings
All settings with comments are located in f_serverutils_settings.nut, the mod.json doesn't include any settings due to convar limitations.
It is highly recommended to change some of the settings such as fsu_owner so your players know who to contact when wanting to report something to the server owner.
API
Chat callbacks support ANSI escape codes, these allow you to change the colour of your text. An example of such a code is \x1b[113m which changes the colour to orange.
Global functions
void function FSU_RegisterCommand ( string command, string usage, void functionref( entity, array < string > ) callbackFunc, array < string > abbreviations = [] ) )
Registers your custom command
command- Your command, needs to have a
"!"at the start - Example:
"!help"
- Your command, needs to have a
usage- Explanation of what the command does
- Example:
"\x1b[113m!vote\x1b[0m <number> Allows you to vote on polls"
callbackFunc- This function gets called when the player calls your command
entityis playerarray < string >is an array of arguments, args[0] would be the first argument
abbreviations- Abbreviations of the command
- Example:
[ "!dc", "!dikord", "!dicsord" ]
bool function FSU_CanCreatePoll ()
Returns true if you can create a poll, there can only be one poll at a time so to not conflict make sure you check this!
void function FSU_CreatePoll ( array < string > options, string before, float duration )
Creates the poll. It is not recommended to pass an array larger than 7.
options- A list of options
before- A string put on the first line. An example use of this would be
"Vote for a map!"
- A string put on the first line. An example use of this would be
duration- Duration of the poll in seconds
int function FSU_GetPollResultIndex ()
Returns the index of the option which won the poll. If the 1st option won it will return 0. If there were no votes cast it returns -1.
Errors
"[FSU] Registered commands have to be lowercase!"
Exactly what it says. When registering a command it needs to be lowercase.
Instead of "!Help" you need to register "!help".
When the user enters the command its case agnostic. Only when registering the command does it need to be lower case.