Skip to content

Utils sh_util

Tensa edited this page Jun 2, 2017 · 2 revisions

sh_util

It is a file containing the basic utility functions of NS 1.0.

This file is not much changed from the original version for legacy compatibility. Please refer to advutil for extension utility.

Functions

Share

  • nut.util.GetEntityKeyValues(entity)

  • nut.util.Include(fileName, state)

  • nut.util.GetAlphaFromDist(position, goal, maxDistance, maxAlpha)

  • nut.util.GetRandomNum(digits)

  • nut.util.IncludeDir(directory, isBase)

  • nut.util.GetHoldType(weapon)

  • nut.util.StringMatches(a, b)

  • nut.util.FindPlayer(name)

  • nut.util.GetTableDelta(a, b)

  • nut.util.IsSimilarTable(a, b)

  • nut.util.StackInv(inventory, class, quantity, data)

  • nut.util.FindClosestPlayer(position)

  • nut.util.GetTime()

  • nut.util.GetUTCTime()

  • nut.util.SplitString(text, size)

Server

  • nut.util.WriteTable(uniqueID, value, ignoreMap, global)

  • nut.util.ReadTable(uniqueID, ignoreMap, forceRefresh)

  • nut.util.Notify(message, ...)

  • nut.util.SendIntroFade(client)

  • nut.util.BlastDoor(door, direction, time, noCheck)

Client

  • nut.util.Notify(message)

  • nut.util.DrawText(x, y, text, color, font, xalign, yalign)

  • nut.util.WrapText(font, width, ...)

  • nut.util.DrawWrappedText(x, y, lines, lineHeight, font, xAlign, yAlign, alpha)

  • nut.util.TimeConnected()

  • nut.util.GetMaterial(materialPath)

Override

  • Derma_StringRequest( strTitle, strText, strDefaultText, fnEnter, fnCancel, strButtonText, strButtonCancelText )

A function that overrides the original. The functionality is the same, but the design has changed.

Clone this wiki locally