> For the complete documentation index, see [llms.txt](https://xtask.rlib.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://xtask.rlib.io/changelog/v4.5.0.0.md).

# v4.5.0.0

{% hint style="warning" %}
This version of XTask requires a new version of rlib ( v4.0.0.0 )

The new version completely re-writes a lot of how the system worked, as well as removes a crap ton of no longer needed things and puts the library into a "minified" version. It also includes some optimizations that will definitely show a benefit when loading resource heavy scripts such as [**XTask**](https://xtask.rlib.io) and [**Arivia v3**](https://arivia.rlib.io).

rlib v4.0.0.0 is now also hosted on the Steam Workshop and is set to auto-mount to the server when it is booted up.&#x20;

You should delete any old versions of rlib you have installed on your server.

rlib is still available to download at <https://get.rlib.io> if you wish to manually install it and disable the auto-mounted version.
{% endhint %}

## <mark style="color:red;">▸ Overview</mark>

* `[ + ]` [**new payment reward types**](#new-payment-reward-types)
* `[ + ]` [**5+ new achievement types**](#new-achievement-types)
* `[ + ]` [**20+ new achievements**](#new-achievements)
* `[ + ]` [**new gamemode support with Basewars**](#new-gamemode-support)
* `[ + ]` [**admin option to wipe all achievements from player's saved data**](#new-admin-commands)
* `[ + ]` [**ability to categorize achievements in "family" groups.**](#categorize-achievements-in-family-groups)
* `[ + ]` [**disco mode**](#new-disco-mode)
* `[ + ]` [**added screen-scaling**](#added-screenscaling)
* `[ + ]` [**new setting to block tracking secret achievements**](#block-configure-secret-achievement-tracking)
* `[ ^ ]` [**re-designed achievement drop-down list**](#re-designed-achievement-dropdown-list)
* `[ ^ ]` [**achievements now have 3 scope functions instead of one trigger**](#new-scope-functions)
* `[ ^ ]` [**RGBA bars now auto-update HEX color value**](#rgb-bars-now-auto-update-hex-color-values)
* `[ ^ ]` [**RGBA bar sequence flipped**](#rgba-bar-sequence-flipped)
* `[ ^ ]` [**function onTrigger deprecated**](#deprecated-ontrigger-function)
* `[ ^ ]` [**theme elements can be added without server restarts or player reconnecting**](#theme-elements-can-be-added-without-server-restarts)
* `[ ^ ]` [**can customize tracker label**](#customize-tracker-label)
* `[ ^ ]` [**optimized tracker calculations**](#optimized-tracker-calculations)
* `[ ^ ]` [**disabled pattern matching for achievement "Hello My Name is"**](#changed-hello-my-name-is-achievement)
* `[ ^ ]` [**restructured reward options**](#restructured-reward-options)
* `[ ^ ]` [**now using OnScreenSizeChanged**](#script-now-using-onscreensizechanged)
* `[ - ]` [**removed custom text color for secret achievements**](#removed-custom-text-colors-for-secret-achievements)
* `[ % ]` [**fixed bug with changing wallpaper setting**](#fixed-bug-with-changing-wallpaper-setting-1)
* `[ % ]` [**fixed `'ui' (a nil value)` error**](#fixed-nil-value-error)
* `[ % ]` [**fixed bug completed achievements tracking bug**](#fixed-achievement-tracking-with-completed-achievements)

## <mark style="color:red;">▸ Detailed Changes</mark>

### <mark style="color:purple;">▸ New Payment Reward Types</mark>

This version adds Basewars and Sandbox as newly supported gamemodes. This means that you can now reward players with various new types of rewards depending on the gamemode.

<mark style="color:blue;">**Basewars**</mark> supports:

* Karma
* XP
* Money

<mark style="color:blue;">**Sandbox**</mark> currently has no built-in systems for rewards. You will need to install addons such as Pointshop 1 or 2.

### <mark style="color:purple;">▸ 5+ Achievement Types</mark>

Several new achievement types have been added. "Types" allow you to store data for achievements that are completed when a progressive requirement is needed.

As an example, a "type" is **not** needed for achievements that only require one particular single action event

Earning an achievement for playing on the server with the server owner is a single action event because it only requires the server owner to be online when the player connections. The achievement doesn't need to actually count anything.

A "type" is needed for an achievement such as "Walking" because it needs to count how many footsteps you have taken before figuring out if you have met the requirement.

The following types have been added:

<table><thead><tr><th width="178">Type</th><th>Description</th></tr></thead><tbody><tr><td><mark style="color:red;"><strong>Drugs</strong></mark></td><td>Counts Basewars drugs player has taken.</td></tr><tr><td><mark style="color:red;"><strong>Factions</strong></mark></td><td>Counts times player has joined or left a Basewars faction.</td></tr><tr><td><mark style="color:red;"><strong>Karma</strong></mark></td><td>Counts karma player has earned.</td></tr><tr><td><mark style="color:red;"><strong>Menu</strong></mark></td><td>Counts times player has opened the various menus in the game.</td></tr><tr><td><mark style="color:red;"><strong>Props</strong></mark></td><td>Counts times player has spawned props.</td></tr><tr><td><mark style="color:red;"><strong>Voice</strong></mark></td><td>Counts seconds player has been actively using voice chat.</td></tr></tbody></table>

### <mark style="color:purple;">▸ 20+ New Achievements</mark>

This update introduces brand new achievements.

<table><thead><tr><th width="281">Achievement</th><th>Description</th></tr></thead><tbody><tr><td><mark style="color:red;">Bob The Builder I</mark></td><td>Spawn 1,000 props</td></tr><tr><td><mark style="color:red;">Bob The Builder II</mark></td><td>Spawn 250,000 props</td></tr><tr><td><mark style="color:red;">Bob The Builder III</mark></td><td>Spawn 750,000 props</td></tr><tr><td><mark style="color:red;">Bob The Builder IV</mark></td><td>Spawn 2,000,000 props</td></tr><tr><td><mark style="color:red;">Contextual Roughhousing I</mark></td><td>Open Context Menu 50,000 times</td></tr><tr><td><mark style="color:red;">Contextual Roughhousing II</mark></td><td>Open Context Menu 500,000 times</td></tr><tr><td><mark style="color:red;">Contextual Roughhousing III</mark></td><td>Open Context Menu 2,000,000 times</td></tr><tr><td><mark style="color:red;">Faction Fanatic I</mark></td><td>Create 25 factions (Basewars)</td></tr><tr><td><mark style="color:red;">Faction Fanatic II</mark></td><td>Create 250 factions (Basewars)</td></tr><tr><td><mark style="color:red;">Faction Fanatic II</mark></td><td>Create 1,000 factions (Basewars)</td></tr><tr><td><mark style="color:red;">Gregory House, MD.</mark></td><td>Buy 500 drugs (Basewars)</td></tr><tr><td><mark style="color:red;">Hoarder I</mark></td><td>Open Q / Spawn menu 1,000 times</td></tr><tr><td><mark style="color:red;">Hoarder II</mark></td><td>Open Q / Spawn menu 100,000 times</td></tr><tr><td><mark style="color:red;">Hoarder III</mark></td><td>Open Q / Spawn menu 1,000,000 times</td></tr><tr><td><mark style="color:red;">Karma Chameleon</mark></td><td>Earn 100 total karma (Basewars)</td></tr><tr><td><mark style="color:red;">Lead The Way I</mark></td><td>Join 50 factions (Basewars)</td></tr><tr><td><mark style="color:red;">Lead The Way II</mark></td><td>Join 1,000 factions (Basewars)</td></tr><tr><td><mark style="color:red;">Parties Over I</mark></td><td>Leave 100 factions (Basewars)</td></tr><tr><td><mark style="color:red;">Parties Over II</mark></td><td>Leave 1,000 factions (Basewars)</td></tr><tr><td><mark style="color:red;">Parties Over III</mark></td><td>Leave 2,500 factions (Basewars)</td></tr><tr><td><mark style="color:red;">Placing Roots</mark></td><td>Connect to the server 1,000 times</td></tr><tr><td><mark style="color:red;">The Grid</mark></td><td>Change monitor resolution to 1440p</td></tr><tr><td><mark style="color:red;">The Voice</mark></td><td>Spend 60 minutes using voice chat</td></tr><tr><td><mark style="color:red;">Unresolved Resolution</mark></td><td>Change monitor resolution 500 times</td></tr><tr><td><mark style="color:red;">Vocal Coach</mark></td><td>Spend 5 minutes using voice chat</td></tr><tr><td><mark style="color:red;">We Built This City</mark></td><td>Connect to the server 5,000 times</td></tr><tr><td><mark style="color:red;">Windows 2000</mark></td><td>Change monitor resolution to 800 x 600</td></tr></tbody></table>

### <mark style="color:purple;">▸ New Gamemode Support</mark>

New gamemodes have been added to this addon.

<table><thead><tr><th width="213">Gamemodes</th><th>New Achievements</th></tr></thead><tbody><tr><td><mark style="color:red;"><strong>Basewars</strong></mark></td><td>10</td></tr><tr><td><mark style="color:red;"><strong>Sandbox</strong></mark></td><td>14</td></tr></tbody></table>

### <mark style="color:purple;">▸ New Admin Commands</mark>

Server owners can now wipe a player's entire achievement database by using <mark style="color:red;">**ULX**</mark>, <mark style="color:red;">**xAdmin**</mark>, or <mark style="color:red;">**SAM**</mark> admin mods.

<figure><img src="/files/fT50iRjE3OhScztIvkOV" alt=""><figcaption></figcaption></figure>

### <mark style="color:purple;">▸ Categorize Achievements in "Family" Groups</mark>

A new parameter has been added to achievements which allows them to be grouped in a "family" of achievements that all belong together.

By grouping multiple achievements in a family, it allows progression in multiple achievements at the same time.

An example would be the achievements:

| Achievement                                                 | Description                       |
| ----------------------------------------------------------- | --------------------------------- |
| <mark style="color:red;">Contextual Roughhousing I</mark>   | Open Context Menu 50,000 times    |
| <mark style="color:red;">Contextual Roughhousing II</mark>  | Open Context Menu 500,000 times   |
| <mark style="color:red;">Contextual Roughhousing III</mark> | Open Context Menu 2,000,000 times |

All three of the achievements above require the same action, however, have different amounts that need to have completed.

By grouping these achievements into a family, opening the context menu counts toward progression in all three achievements. This is especially useful when you have achievements that must communicate between the server and client scopes and cuts down on the network calls that must be made.

### <mark style="color:purple;">▸ New Disco Mode</mark>

It's always nice to have little Easter eggs or surprises. We've now added a fun new <mark style="color:blue;">**d**</mark><mark style="color:purple;">**i**</mark><mark style="color:orange;">**s**</mark><mark style="color:red;">**c**</mark><mark style="color:yellow;">**o**</mark> <mark style="color:green;">m</mark><mark style="color:blue;">o</mark><mark style="color:purple;">d</mark><mark style="color:orange;">e</mark>

<figure><img src="/files/Lytw6gSSFwyUgaUgyYTY" alt=""><figcaption><p>Hint: It's also an achievement</p></figcaption></figure>

Players can enable this on the theme settings page:

<figure><img src="/files/bq0iN4HRuey7k3GwXB66" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/k8DAWvDpkaokFlSkamJ6" alt=""><figcaption></figcaption></figure>

### <mark style="color:purple;">▸ Added Screen-scaling</mark>

Several elements of the interface now have screenscaling.

### <mark style="color:purple;">▸ Block / Configure Secret Achievement Tracking</mark>

Secret achievements have now been completely blocked from being tracked. However, a new setting has been added which allows players to track secret achievements.

To allow secret achievement tracking, open:

> &#x20;        <mark style="color:yellow;">**`addons\xtask\lua\modules\xtask\cfg\sh_cfg_general.lua`**</mark>

Change the setting:

```lua
cfg.tracker.bAllowSecrets = true
```

If you keep this setting set to <mark style="color:red;">**`false`**</mark>; whenever a player hovers over a secret achievement, they will not be allowed to click on it. They'll also see text that says "<mark style="color:red;">**`Cannot Track`**</mark>".

<figure><img src="/files/zVzGNEdUzbzI79FteeE5" alt=""><figcaption></figcaption></figure>

### <mark style="color:purple;">▸ Re-designed Achievement Drop-down List</mark>

Previous versions of XTask included a dropdown list which displayed all achievement categories. The text and list itself were very small on certain monitors.&#x20;

The dropdown size and text have been increased.

<figure><img src="/files/J4HcIi1Y9V6FliSFN9a2" alt=""><figcaption></figcaption></figure>

### <mark style="color:purple;">▸ New Scope Functions</mark>

When creating achievements, new scope functions have been added so that you can write code for achievements in the scope you need.

* <mark style="color:red;">**OnShared**</mark>
  * All functionality for the shared scope. Handles server and shared actions.
* <mark style="color:red;">**OnClient**</mark>
  * Client-side scope code only
* <mark style="color:red;">**OnServer**</mark>
  * Server-side scope code only.

```lua
XTASK.onShared = function( id, id_hook, path )
    // shared
end

XTASK.onServer = function( id, id_hook, path )
    // server
end

XTASK.onClient = function( id, id_hook, path )
    // client
endlua
```

### <mark style="color:purple;">▸ RGBA Bars now auto-update HEX color values</mark>

&#x20;When changing the colors of the interface using the RGB color-bars; the hex values will now automatically update.

<figure><img src="/files/GKEii9MX0cotvH3Y91YS" alt=""><figcaption></figcaption></figure>

### <mark style="color:purple;">▸ RGBA Bar Sequence Flipped</mark>

A very minor change, however, requested by a few customers.

The R,G,B,A bars that a player can use to change interface colors has been flipped to the correct order.

<div><figure><img src="/files/VH93vasq9elCDz5zUcj4" alt=""><figcaption><p>a,b,g,r (old)</p></figcaption></figure> <figure><img src="/files/vdPvmjK5cYXHRiOb2bLZ" alt=""><figcaption><p>r,g,b,a (new)</p></figcaption></figure></div>

### <mark style="color:purple;">▸ Deprecated onTrigger Function</mark>

the <mark style="color:red;">**onTrigger**</mark> achievement function is being removed from the script and replaced with the three new scope functions listed above.

### <mark style="color:purple;">▸ Theme Elements Can Be Added Without Server Restarts</mark>

Prior to this version; if you added new theme color options to the theme files, you had to restart the server and reconnect for the changes to take affect.&#x20;

Now you only need to close the interface and then re-open it for all new theme options to be registered.

This also includes font changes.

### <mark style="color:purple;">▸ Customize Tracker Label</mark>

The tracker allows players to keep track of certain achievements by displaying them on the HUD.

Usually, the tracker gives a small amount of information, with the number of something required in order to obtain the achievement.

You can now add an override label that will display next to the required amount of the achievement.

### <mark style="color:purple;">▸ Optimized Tracker Calculations</mark>

The tracker has been optimized in how it calculates data to show to the player.

### <mark style="color:purple;">▸ Disabled Pattern Matching for</mark> <mark style="color:orange;">"Hello, My Name Is"</mark> <mark style="color:purple;">achievement</mark>

Server owners were getting confused by the param for the achievement <mark style="color:red;">**`Hello, My Name is`**</mark>.

This achievement rewards the player if they add a particular word or matching text to their name such as a clean or network name.

Prior to this version, if you used brackets in the required name, it treated the brackets as a pattern and would reward the achievement to anyone, even if their name didn't match.

Pattern matching has been disabled and now the player name must have the exact word.

### <mark style="color:purple;">▸ Restructured Reward Options</mark>

With the new integration with Basewars, we have done away with the <mark style="color:red;">**`darkrp_funds`**</mark> parameter in each achievement config file. The table <mark style="color:red;">**`currency`**</mark> has also been removed. All rewards are in the same table now.

All achievement files have been updated to reflect the new structure. If you are moving achievements over from a previous version, you must update the table structure or you will not receive rewards for completing the achievement.

#### <mark style="color:yellow;">OLD CDDE</mark>

```lua
XTASK.po =
{
    ps2_items =
    {
        // Pointshop 2 items
    },
    spell             = false,    // Magic Wand Rewrite addon - add spellname here
    xp                = 0,        // xp to give
    xp_percent        = 0,        // percentage of xp to give based on how much a player needs to level
    currency =
    {
        points        = 0,        // pointshop 1 or pointshop 2 points to give
        points_prem   = 0,        // pointshop 2 premium points
        darkrp_funds  = 1000,     // darkrp money
    }
}
```

#### <mark style="color:yellow;">NEW CDDE</mark>

<pre class="language-lua"><code class="lang-lua">XTASK.po =
{
    ps2_items =
    {
        // Pointshop 2 items
    },
    spell         = false,        // Magic Wand Rewrite addon - add spellname here
    karmma        = 0,            // basewars karma to give
<strong>    xp            = 0,            // xp to give
</strong>    xp_percent    = 0,            // percentage of xp to give based on how much a player needs to level
    points        = 0,            // pointshop 1 or pointshop 2 points to give
    points_prem   = 0,            // pointshop 2 premium points
    money         = 1000,         // darkrp or basewars money
}
</code></pre>

### <mark style="color:purple;">▸ Script now using OnScreenSizeChanged</mark>

Interface will be re-built when player changes resolution in order to adjust all interface sizes.

### <mark style="color:purple;">▸ Removed Custom Text Colors for Secret Achievements</mark>

This ended up being a very rarely used feature and made the code confusing. Secret achievements will now appear in the achievement list with the same style as other achievements.

### <mark style="color:purple;">▸ Fixed Bug With Changing Wallpaper Setting</mark>

Fixed a bug related to players changing their wallpaper setting in the interface settings interface.

### <mark style="color:purple;">▸ Fixed Nil Value Error</mark>

A `'ui' (a nil value)` error has been fixed.

### <mark style="color:purple;">▸ Fixed Achievement Tracking With Completed Achievements</mark>

Completed achievements could still be tracked if the player clicked on them. Tracking for completed achievements have now been blocked.
