Module workarounds

Workarounds Library. Used to fix shit when it doesn't work properly the first time.

Module Overview

Shared Functions

os.date(fmt[, time], ...) Get the date from the system.
Color(r[, g[, b[, a]]]) Get a colour structure.
DarkRP.notify(ply, t, time, msg) Notify a player with a message.
unfuckUnicode(inStr) Unfuck a unicode string, by ensuring that multi-byte components actually work properly.

Shared Functions

os.date(fmt[, time], ...)
Get the date from the system. Overwritten as certain format codes on windows cause client crashes.

Parameters:

  • fmt string The date format.
  • time number The time to set. (optional)
  • ... Extra data for the function.

Returns:

    string The formatted date.
Color(r[, g[, b[, a]]])
Get a colour structure. Overwritten to prevent client crashes with invalid arguments. Also provides utility for greyscale and gs /w alpha colours. With only r provided, r is copied to r, g and b. Alpha is set to 255. With r and g provided, r is used as r, g and b, alpha is set to g. With r, g, b and optional a provided, function works as default.

Parameters:

  • r number Red channel.
  • g number Green channel. (optional)
  • b number Blue channel. (optional)
  • a number Alpha channel. (optional)

Returns:

    Colour The created colour object.
DarkRP.notify(ply, t, time, msg)
Notify a player with a message.

Parameters:

  • ply Player The player to send the message to.
  • t number The type of the message to send.
  • time number Ignored.
  • msg string The message to send.
unfuckUnicode(inStr)
Unfuck a unicode string, by ensuring that multi-byte components actually work properly.

Parameters:

  • inStr string The input string to check.

Returns:

    string The output string, with any invalid UTF-8 codepoints removed.