-
Notifications
You must be signed in to change notification settings - Fork 0
New functions: Global
dounai_lib provide some global functions that was easy to understand and having much less characters, without having to refer dounai_lib variable:
CurTime()Returns the uptime of the server in seconds.
Return: number
Entity(index)This is advanced version of original GetEntityByIndex(), and will automatic convert entity to it's proper type.
Return: entity, player, weapon and mathCounter or nil
index: number
Player(userid)This is a rename of original GetPlayerByUserId(), providing less characters in general for easier coding.
Return: player or nil
userid: number
IsValid(ent)Check whether an entity is valid or not. Can be also used with dounai_lib.cfg.Parse() and dounai_lib.csv.Parse() result.
When checking worldspawn entity, this will return false, use IsWorldspawn() instead.
Return: true or false
ent: entity
IsWorldspawn(ent)Check whether an entity is worldspawn.
Return: true or false
ent: entity
Msg(message, ...)Print a message to console.
message: string
MsgC(color, message, ...)Print a colored message to console.
color: string, Color or number. Example: red, Color(255, 0, 0) or -16776961
message: string
printf(str, ...)Print a message to console, with formating.
str: string
PrintTable(table)Print everything in the table to the console.
BUG: If the table is too large, this function will does nothing due to buffer overflow.
table: table