Author Topic: title system  (Read 26 times)


a system for attaching colorful titles to player's names
usable as a random cosmetic a la hatmod, or you could use it for roleplays and the like i guess

titles are saved and loaded at config/server/titledataD (you can create the relevant folders manually, or auto-generate them by starting a server with the addon enabled)
you can create custom title packs by putting .titles files in titledataD/titles, with each line formatted like so:
Code: [Select]
Color Prefix Suffix BLID(those are separated by tabs! very important!)

Color is a hex code and absolutely required
Prefix and Suffix are what go before and after the name respectively, you need at least one or the other, or both
BLID is optional, and if added will make it a "personal" title that only the player with that blid can use

spaces are NOT added automatically, so if you want to make a title like one in the screenshot, you would write the prefix as "Word " (with a space at the end)
if you want a suffix but no prefix, you can just have two consecutive tabs between Color and Suffix
also if you want to use fancy accented characters you'll need to change the file's encoding to windows-1252

    rtb prefs
Access to All Titles - set who is allowed to use any droppable title without restrictions
Random Title Drops - set whether titles are periodically given to random players
Minutes Between Drops - self-explanatory
Chance To Receive Drop (%) - per player
Enable /giveTitle - set whether players may trade titles with each other
Enable Events - set whether events for title manipulation are enabled (requires restart, only the host can apply these events)

    chat commands
/titles - lists all the titles you own (alias: /title)
/useTitle <id> - equips the title with the specified id, leave blank to unequip
/giveTitle <name> <id> - trades a title of yours to that player
/allTitles - lists all droppable titles at once (admin only)
/getPersonalTitles <name> - lists all personal titles belonging to the player (admin only)
/titleDropReset - resets the timer for random title drops (admin only)
/lockTitle <name> <id> - locks the title of the player, preventing them from changing it, optionally also force-equipping a title (super admin only)
/unlockTitle <name> - unlocks the title of the player (super admin only)

    useful console commands
client.hasTitle( id ) - returns true if the client owns that title
client.equipTitle( id )* - forces the client to equip that title, even if they don't own it
client.grantTitle( id, bool )* - grants that title to the client, optionally silencing the usual chat messages
client.grantRandomTitle( bool )* - makes 100 attempts to grant the client a random title, optionally silencing the usual chat messages
client.revokeTitle( id )* - revokes the specified droppable title from the client, and unequips it if necessary (they will not be informed of this)
client.clearTitles()* - revokes ALL droppable titles from the client (they will be informed of this)
createPersonalTitle( player, color, prefix, suffix ) - generates a personal title for the specified player (by name or client), color must be hex
getTitlesLoadOrder() - returns a tab-separated list of .titles files in the order they were loaded
$TitleSys::ForceLoadOrder - set this global in the same format as the previous command, and then run reloadTitles(); to override the load order
*has an event equivalent, if enabled

if you don't care about all that though i have some generic packs of 1000+ titles here: https://leopard.hosting.pecon.us/dl/hjzlx/TITLES%21.zip (put lastloadorder.txt in the main titledataD folder)

download button

good stuff your putting out lately. i made a system similar to this years ago for my custom class TDM, but this is a much more fledged out system overall. kudos!