engine.GetPlayerInfo(iIndex:number):tablePlayer info table (name, userid, guid, friendsid, friendsname, fakeplayer, ishltv) or nil.
Engine queries, commands, tracing, randomness.
engine.GetPlayerInfo(iIndex:number):tablePlayer info table (name, userid, guid, friendsid, friendsname, fakeplayer, ishltv) or nil.
engine.GetPlayerForUserID(iUserID:number):numberMap an engine user ID to an entity index.
engine.ExecuteCommand(cmd:string)Execute a console command.
engine.ClientCmd(cmd:string)Send an unrestricted client command.
engine.GetLevelName():stringFull level name including the map path.
engine.IsPlayingDemo():booleanWhether a demo is currently playing.
engine.IsTakingScreenshot():booleanWhether a screenshot is being taken.
engine.Con_IsVisible():booleanWhether the console is visible.
engine.IsGameUIVisible():booleanWhether the game UI is visible.
engine.GetMapName():stringBare map name, for example cp_dustbowl.
engine.GetServerIP():stringAddress of the current server.
engine.GetViewAngles():Vector3Current local view angles.
engine.SetViewAngles(ang:Vector3)Set local view angles.
engine.PlaySound(path:string)Play a sound file relative to the game directory.
engine.GetGameDir():stringGame install directory.
engine.SendKeyValues(kv:string):booleanSend a KeyValues string to the server; false if it fails to parse.
engine.Notification(title:string, long?:string)Show a notification; long text overrides the title.
engine.RandomSeed(seed:number)Seed the shared random stream.
engine.RandomFloat(min:number, max?:number):numberRandom float in [min, max]; max defaults to 1.
engine.RandomInt(min:number, max?:number):numberRandom integer in [min, max]; max defaults to 32767.
engine.RandomFloatExp(min:number, max:number, exp?:number):numberRandom float with exponential distribution; exp defaults to 1.
engine.TraceLine(start:Vector3, end:Vector3, mask:number, filter?:function):TraceLine trace with an optional Lua filter callback.
engine.TraceHull(start:Vector3, end:Vector3, mins:Vector3, maxs:Vector3, mask:number, filter?:function):TraceHull trace with an optional Lua filter callback.
engine.GetPointContents(pos:Vector3):number,EntityContents mask and the entity at a point, if any.