├── .gitignore ├── GarrysModLuaShared ├── GarrysModLuaShared.sln └── GarrysModLuaShared │ ├── Classes │ ├── Angle.cs │ ├── CEffectData.cs │ ├── CLuaEmitter.cs │ ├── CLuaLocomotion.cs │ ├── CLuaParticle.cs │ ├── CMoveData.cs │ ├── CNavArea.cs │ ├── CNavLadder.cs │ ├── CRecipientFilter.cs │ ├── CSEnt.cs │ ├── CSoundPatch.cs │ ├── CTakeDamageInfo.cs │ ├── CUserCmd.cs │ ├── ConVar.cs │ ├── Entity.cs │ ├── File.cs │ ├── IGModAudioChannel.cs │ ├── IMaterial.cs │ ├── IMesh.cs │ ├── IRestore.cs │ ├── ISave.cs │ ├── ITexture.cs │ ├── IVideoWriter.cs │ ├── MarkupObject.cs │ ├── NPC.cs │ ├── NextBot.cs │ ├── Panel.cs │ ├── PathFollower.cs │ ├── PhysObj.cs │ ├── Player.cs │ ├── Schedule.cs │ ├── Stack.cs │ ├── TOOL.cs │ ├── Task.cs │ ├── VMatrix.cs │ ├── Vector.cs │ ├── Vehicle.cs │ ├── Weapon.cs │ └── bf_read.cs │ ├── Dependencies │ └── source_exports.dll │ ├── DllMain.cs │ ├── Enums │ ├── ACT.cs │ ├── BLOOD.cs │ ├── BONE.cs │ ├── BOX.cs │ ├── BUTTON.cs │ ├── CAP.cs │ ├── CHAN.cs │ ├── CLASS.cs │ ├── COLLISION.cs │ ├── COND.cs │ ├── CONTENTS.cs │ ├── CREATERENDERTARGETFLAGS.cs │ ├── CT.cs │ ├── D.cs │ ├── DMG.cs │ ├── DOCK.cs │ ├── DOF.cs │ ├── EF.cs │ ├── EFL.cs │ ├── FCVAR.cs │ ├── FFT.cs │ ├── FL.cs │ ├── FORCE.cs │ ├── FVPHYSICS.cs │ ├── GESTURE.cs │ ├── GMOD_CHANNEL.cs │ ├── HITGROUP.cs │ ├── HUD.cs │ ├── HULL.cs │ ├── IMAGE_FORMAT.cs │ ├── IN.cs │ ├── JOYSTICK.cs │ ├── KEY.cs │ ├── LAST.cs │ ├── MASK.cs │ ├── MAT.cs │ ├── MATERIAL.cs │ ├── MATERIAL_CULLMODE.cs │ ├── MATERIAL_FOG.cs │ ├── MATERIAL_LIGHT.cs │ ├── MATERIAL_RT_DEPTH.cs │ ├── MOUSE.cs │ ├── MOVECOLLIDE.cs │ ├── MOVETYPE.cs │ ├── NOTIFY.cs │ ├── NPC.cs │ ├── NUM.cs │ ├── OBS_MODE.cs │ ├── PATTACH.cs │ ├── PLAYER.cs │ ├── PLAYERANIMEVENT.cs │ ├── RENDERGROUP.cs │ ├── RENDERMODE.cs │ ├── RT_SIZE.cs │ ├── SCHED.cs │ ├── SCREENFADE.cs │ ├── SENSORBONE.cs │ ├── SF.cs │ ├── SIM.cs │ ├── SND.cs │ ├── SNDLVL.cs │ ├── SOLID.cs │ ├── STENCIL.cs │ ├── STEPSOUNDTIME.cs │ ├── STUDIO.cs │ ├── SURF.cs │ ├── TEAM.cs │ ├── TEXFILTER.cs │ ├── TEXT.cs │ ├── TRACER.cs │ ├── TRANSMIT.cs │ ├── TYPE.cs │ ├── USE.cs │ ├── WEAPON.cs │ └── kRenderFx.cs │ ├── Extensions.cs │ ├── ExternDll.cs │ ├── GarrysModLuaShared.csproj │ ├── Global.cs │ ├── Lua.cs │ ├── LuaConfig.cs │ ├── LuaObject.cs │ ├── LuaState.cs │ ├── LuaTable.cs │ ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx │ ├── Random.cs │ ├── Resources │ └── ASCII_table.png │ ├── Source │ ├── ICvar.cs │ └── IVEngineClient.cs │ ├── SourceEngine.cs │ ├── Structs │ ├── AmmoData.cs │ ├── AngPos.cs │ ├── AnimationData.cs │ ├── AttachmentData.cs │ ├── BodyGroupData.cs │ ├── BoneManipulationData.cs │ ├── Bullet.cs │ ├── CamData.cs │ ├── CollisionData.cs │ ├── Color.cs │ ├── ColorModifyData.cs │ ├── CreationMenus.cs │ ├── DateData.cs │ ├── DebugInfo.cs │ ├── DynamicLight.cs │ ├── EmitSoundInfo.cs │ ├── EntityCopyData.cs │ ├── FontData.cs │ ├── HTTPRequest.cs │ ├── HullTrace.cs │ ├── LocalLight.cs │ ├── MatProxyData.cs │ ├── MeshVertex.cs │ ├── OperatingParams.cs │ ├── PhysEnvPerformanceSettings.cs │ ├── PhysProperties.cs │ ├── PhysicsObjectSave.cs │ ├── PolygonVertex.cs │ ├── RenderCamData.cs │ ├── RenderCaptureData.cs │ ├── ServerQueryData.cs │ ├── SoundData.cs │ ├── SunInfo.cs │ ├── TeamData.cs │ ├── TextData.cs │ ├── TextureData.cs │ ├── ToScreenData.cs │ ├── Trace.cs │ ├── TraceResult.cs │ ├── Undo.cs │ ├── VehicleParams.cs │ ├── VehicleParamsAxle.cs │ ├── VehicleParamsBody.cs │ ├── VehicleParamsEngine.cs │ ├── VehicleParamsSteering.cs │ ├── VideoData.cs │ └── ViewData.cs │ ├── TableIndex.cs │ ├── Type.cs │ ├── achievements.cs │ ├── bit.cs │ ├── cookie.cs │ ├── engine.cs │ ├── game.cs │ ├── gameevent.cs │ ├── gui.cs │ ├── input.cs │ ├── language.cs │ ├── luaL_Buffer.cs │ ├── luaL_Reg.cs │ ├── lua_Alloc.cs │ ├── lua_CFunction.cs │ ├── lua_Debug.cs │ ├── lua_Hook.cs │ ├── lua_Reader.cs │ ├── lua_Writer.cs │ ├── math.cs │ ├── menu.cs │ ├── net.cs │ ├── notification.cs │ ├── os.cs │ ├── packages.config │ ├── physenv.cs │ ├── resource.cs │ ├── string.cs │ ├── surface.cs │ ├── system.cs │ ├── team.cs │ ├── timer.cs │ └── util.cs ├── LICENSE └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | build/ 21 | bld/ 22 | [Bb]in/ 23 | [Oo]bj/ 24 | 25 | # Visual Studo 2015 cache/options directory 26 | .vs/ 27 | 28 | # MSTest test Results 29 | [Tt]est[Rr]esult*/ 30 | [Bb]uild[Ll]og.* 31 | 32 | # NUNIT 33 | *.VisualState.xml 34 | TestResult.xml 35 | 36 | # Build Results of an ATL Project 37 | [Dd]ebugPS/ 38 | [Rr]eleasePS/ 39 | dlldata.c 40 | 41 | *_i.c 42 | *_p.c 43 | *_i.h 44 | *.ilk 45 | *.meta 46 | *.obj 47 | *.pch 48 | *.pdb 49 | *.pgc 50 | *.pgd 51 | *.rsp 52 | *.sbr 53 | *.tlb 54 | *.tli 55 | *.tlh 56 | *.tmp 57 | *.tmp_proj 58 | *.log 59 | *.vspscc 60 | *.vssscc 61 | .builds 62 | *.pidb 63 | *.svclog 64 | *.scc 65 | 66 | # Chutzpah Test files 67 | _Chutzpah* 68 | 69 | # Visual C++ cache files 70 | ipch/ 71 | *.aps 72 | *.ncb 73 | *.opensdf 74 | *.sdf 75 | *.cachefile 76 | 77 | # Visual Studio profiler 78 | *.psess 79 | *.vsp 80 | *.vspx 81 | 82 | # TFS 2012 Local Workspace 83 | $tf/ 84 | 85 | # Guidance Automation Toolkit 86 | *.gpState 87 | 88 | # ReSharper is a .NET coding add-in 89 | _ReSharper*/ 90 | *.[Rr]e[Ss]harper 91 | *.DotSettings.user 92 | 93 | # JustCode is a .NET coding addin-in 94 | .JustCode 95 | 96 | # TeamCity is a build add-in 97 | _TeamCity* 98 | 99 | # DotCover is a Code Coverage Tool 100 | *.dotCover 101 | 102 | # NCrunch 103 | _NCrunch_* 104 | .*crunch*.local.xml 105 | 106 | # MightyMoose 107 | *.mm.* 108 | AutoTest.Net/ 109 | 110 | # Web workbench (sass) 111 | .sass-cache/ 112 | 113 | # Installshield output folder 114 | [Ee]xpress/ 115 | 116 | # DocProject is a documentation generator add-in 117 | DocProject/buildhelp/ 118 | DocProject/Help/*.HxT 119 | DocProject/Help/*.HxC 120 | DocProject/Help/*.hhc 121 | DocProject/Help/*.hhk 122 | DocProject/Help/*.hhp 123 | DocProject/Help/Html2 124 | DocProject/Help/html 125 | 126 | # Click-Once directory 127 | publish/ 128 | 129 | # Publish Web Output 130 | *.[Pp]ublish.xml 131 | *.azurePubxml 132 | # TODO: Comment the next line if you want to checkin your web deploy settings 133 | # but database connection strings (with potential passwords) will be unencrypted 134 | *.pubxml 135 | *.publishproj 136 | 137 | # NuGet Packages 138 | *.nupkg 139 | # The packages folder can be ignored because of Package Restore 140 | **/packages/* 141 | # except build/, which is used as an MSBuild target. 142 | !**/packages/build/ 143 | # Uncomment if necessary however generally it will be regenerated when needed 144 | #!**/packages/repositories.config 145 | 146 | # Windows Azure Build Output 147 | csx/ 148 | *.build.csdef 149 | 150 | # Windows Store app package directory 151 | AppPackages/ 152 | 153 | # Others 154 | *.[Cc]ache 155 | ClientBin/ 156 | [Ss]tyle[Cc]op.* 157 | ~$* 158 | *~ 159 | *.dbmdl 160 | *.dbproj.schemaview 161 | *.pfx 162 | *.publishsettings 163 | node_modules/ 164 | bower_components/ 165 | 166 | # RIA/Silverlight projects 167 | Generated_Code/ 168 | 169 | # Backup & report files from converting an old project file 170 | # to a newer Visual Studio version. Backup files are not needed, 171 | # because we have git ;-) 172 | _UpgradeReport_Files/ 173 | Backup*/ 174 | UpgradeLog*.XML 175 | UpgradeLog*.htm 176 | 177 | # SQL Server files 178 | *.mdf 179 | *.ldf 180 | 181 | # Business Intelligence projects 182 | *.rdl.data 183 | *.bim.layout 184 | *.bim_*.settings 185 | 186 | # Microsoft Fakes 187 | FakesAssemblies/ 188 | 189 | # Node.js Tools for Visual Studio 190 | .ntvs_analysis.dat 191 | 192 | # Visual Studio 6 build log 193 | *.plg 194 | 195 | # Visual Studio 6 workspace options file 196 | *.opt 197 | -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.23107.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GarrysModLuaShared", "GarrysModLuaShared\GarrysModLuaShared.csproj", "{79E48743-282E-4BFC-B190-4CF4F5045DE8}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Release|x86 = Release|x86 11 | EndGlobalSection 12 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 13 | {79E48743-282E-4BFC-B190-4CF4F5045DE8}.Release|x86.ActiveCfg = Release|x86 14 | {79E48743-282E-4BFC-B190-4CF4F5045DE8}.Release|x86.Build.0 = Release|x86 15 | EndGlobalSection 16 | GlobalSection(SolutionProperties) = preSolution 17 | HideSolutionNode = FALSE 18 | EndGlobalSection 19 | EndGlobal 20 | -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Classes/CEffectData.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Classes 2 | { 3 | public sealed class CEffectData : LuaObject 4 | { 5 | public CEffectData(int index) : base(index) { } 6 | } 7 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Classes/CLuaEmitter.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Classes 2 | { 3 | public sealed class CLuaEmitter : LuaObject 4 | { 5 | public CLuaEmitter(int index) : base(index) { } 6 | } 7 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Classes/CLuaLocomotion.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Classes 2 | { 3 | public sealed class CLuaLocomotion : LuaObject 4 | { 5 | public CLuaLocomotion(int index) : base(index) { } 6 | } 7 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Classes/CLuaParticle.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Classes 2 | { 3 | public sealed class CLuaParticle : LuaObject 4 | { 5 | public CLuaParticle(int index) : base(index) { } 6 | } 7 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Classes/CMoveData.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Classes 2 | { 3 | public sealed class CMoveData : LuaObject 4 | { 5 | public CMoveData(int index) : base(index) { } 6 | } 7 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Classes/CNavArea.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Classes 2 | { 3 | public sealed class CNavArea : LuaObject 4 | { 5 | public CNavArea(int index) : base(index) { } 6 | } 7 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Classes/CNavLadder.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Classes 2 | { 3 | public sealed class CNavLadder : LuaObject 4 | { 5 | public CNavLadder(int index) : base(index) { } 6 | } 7 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Classes/CRecipientFilter.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Classes 2 | { 3 | public sealed class CRecipientFilter : LuaObject 4 | { 5 | public CRecipientFilter(int index) : base(index) { } 6 | } 7 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Classes/CSEnt.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Classes 2 | { 3 | public sealed class CSEnt : Entity 4 | { 5 | public CSEnt(int index) : base(index) { } 6 | } 7 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Classes/CSoundPatch.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Classes 2 | { 3 | public sealed class CSoundPatch : LuaObject 4 | { 5 | public CSoundPatch(int index) : base(index) { } 6 | } 7 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Classes/CTakeDamageInfo.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Classes 2 | { 3 | public sealed class CTakeDamageInfo : LuaObject 4 | { 5 | public CTakeDamageInfo(int index) : base(index) { } 6 | } 7 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Classes/CUserCmd.cs: -------------------------------------------------------------------------------- 1 | using GarrysModLuaShared.Enums; 2 | 3 | namespace GarrysModLuaShared.Classes 4 | { 5 | /// 6 | /// A class used to store the player inputs, such as mouse movement, view angles, buttons 7 | /// pressed and analog movement, the data from this class is then transfered to a during 8 | /// actual movement simulation. 9 | /// 10 | /// Can be modified during CreateMove, StartCommand hook and used in read only with SetupMove hook and 11 | /// . 12 | /// 13 | public sealed class CUserCmd : LuaObject 14 | { 15 | static readonly int CUserCmdId = Random.Generator.Next((int)Type.UserCmd, int.MaxValue); 16 | 17 | public CUserCmd(int index) : base(index) { } 18 | 19 | /// Removes all keys from the command. Doesn't prevent movement, see for this. 20 | public void ClearButtons() => CallVoid(nameof(ClearButtons)); 21 | 22 | /// Clears the movement from the command. 23 | public void ClearMovement() => CallVoid(nameof(ClearMovement)); 24 | 25 | /// 26 | /// Returns an increasing number representing the index of the user cmd. The value returned is occasionally 0 27 | /// inside CreateMove hook, so it's advised to check for a non-zero value if you wish to get the correct number. 28 | /// 29 | /// The command number. 30 | public double CommandNumber() => CallNumber(nameof(CommandNumber)); 31 | 32 | /// Returns a bitflag indicating which buttons are pressed. 33 | /// Pressed buttons. 34 | public IN GetButtons() => (IN)CallNumber(nameof(GetButtons)); 35 | 36 | /// The speed the client wishes to move forward with, negative if the clients wants to move backwards. 37 | /// The desired speed. 38 | public double GetForwardMove() => CallNumber(nameof(GetForwardMove)); 39 | 40 | /// Gets the current impulse from the client, usually 0. 41 | /// The impulse. 42 | public double GetImpulse() => CallNumber(nameof(GetImpulse)); 43 | 44 | /// Returns the scroll delta as whole number. 45 | /// Scroll delta. 46 | public double GetMouseWheel() => CallNumber(nameof(GetMouseWheel)); 47 | 48 | /// Returns the delta of the angular horizontal mouse movement of the player. 49 | /// Mouse X delta. 50 | public int GetMouseX() => CallInteger(nameof(GetMouseX)); 51 | 52 | /// Returns the delta of the angular vertical mouse movement of the player. 53 | /// Mouse Y delta. 54 | public int GetMouseY() => CallInteger(nameof(GetMouseY)); 55 | 56 | /// 57 | /// The speed the client wishes to move sideways with, positive if it wants to move right, negative if it wants to 58 | /// move left. 59 | /// 60 | /// Request speed. 61 | public double GetSideMove() => CallNumber(nameof(GetSideMove)); 62 | 63 | /// The speed the client wishes to move up with, negative if the clients wants to move down. 64 | /// Request speed. 65 | public double GetUpMove() => CallNumber(nameof(GetUpMove)); 66 | 67 | /// Gets the direction the client wants to move in. 68 | /// Request direction. 69 | public Angle GetViewAngles() => CallObject(nameof(GetViewAngles)).ToAngle(); 70 | 71 | /// Returns true if the specified button(s) is pressed. 72 | /// Bitflag representing which button to check. 73 | /// Is key down or not? 74 | public bool KeyDown(IN key) => CallBoolean(nameof(KeyDown), (int)key); 75 | 76 | /// Removed a key bit from the current key bitflag. 77 | /// Bitflag to be removed from the key bitflag. 78 | public void RemoveKey(IN button) => CallVoid(nameof(RemoveKey), (int)button); 79 | 80 | /// 81 | /// Forces the associated player to select a weapon. 82 | /// 83 | /// This is used internally in the default HL2 weapon selection HUD. 84 | /// 85 | /// NOTE: Due to a bug, you will have to force this function to run until returns 86 | /// the chosen weapon, although it is also advised to add a time limit in case the switch fails for any reason. 87 | /// 88 | /// NOTE 2: This is the ideal function to use to create a custom weapon selection HUD, as it allows prediction to run 89 | /// properly for WEAPON.Deploy hook and PlayerSwitchWeapon hook. 90 | /// 91 | /// The weapon entity to select. 92 | public void SelectWeapon(Weapon weapon) => CallVoid(nameof(SelectWeapon), weapon); 93 | 94 | /// Sets the buttons bitflag. 95 | /// Bitflag representing which buttons are "down". 96 | public void SetButtons(IN buttons) => CallVoid(nameof(SetButtons), (int)buttons); 97 | 98 | /// Sets speed the client wishes to move forward with, negative if the clients wants to move backwards. 99 | /// The new speed to request. 100 | public void SetForwardMove(double speed) => CallVoid(nameof(SetForwardMove), speed); 101 | 102 | /// Sets the impulse to be send together with the command. 103 | /// The impulse to send. 104 | public void SetImpulse(double impulse) => CallVoid(nameof(SetImpulse), impulse); 105 | 106 | /// Sets the scroll delta. 107 | /// The scroll delta. 108 | public void SetMouseWheel(double delta) => CallVoid(nameof(SetMouseWheel), delta); 109 | 110 | /// Sets the delta of the angular horizontal mouse movement of the player. 111 | /// Angular horizontal move delta. 112 | public void SetMouseX(int x) => CallVoid(nameof(SetMouseX), x); 113 | 114 | /// Sets the delta of the angular vertical mouse movement of the player. 115 | /// Angular vertical move delta. 116 | public void SetMouseY(int y) => CallVoid(nameof(SetMouseY), y); 117 | 118 | /// Sets speed the client wishes to move sidewards with, positive to move right, negative to move left. 119 | /// The new speed to request. 120 | public void SetSideMove(double speed) => CallVoid(nameof(SetSideMove), speed); 121 | 122 | /// Sets speed the client wishes to move upwards with, negative to move down. 123 | /// The new speed to request. 124 | public void SetUpMove(double speed) => CallVoid(nameof(SetUpMove), speed); 125 | 126 | /// Sets the direction the client wants to move in. 127 | /// New view angles. 128 | public void SetViewAngles(Angle viewAngle) => CallVoid(nameof(SetViewAngles), viewAngle); 129 | 130 | /// Returns tick count since joining the server. Sometimes returns 0. 131 | /// The amount of ticks passed since joining the server. 132 | public double TickCount() => CallNumber(nameof(TickCount)); 133 | } 134 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Classes/ConVar.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace GarrysModLuaShared.Classes 4 | { 5 | /// 6 | /// An object returned by function. It represents a console variable. See 7 | /// this page for more information. 8 | /// 9 | public sealed class ConVar : LuaObject, IEquatable 10 | { 11 | static readonly int ConVarId = Random.Generator.Next((int)Type.ConVar, int.MaxValue); 12 | 13 | public ConVar(int index) : base(index) { } 14 | 15 | public ConVar(string name) : base(LuaTable._G.InvokeObject(nameof(Global.GetConVar), name).GetIndex()) { } 16 | 17 | public bool Equals(ConVar other) 18 | { 19 | if (ReferenceEquals(null, other)) 20 | { 21 | return false; 22 | } 23 | return ReferenceEquals(this, other) || GetFloat().Equals(other.GetFloat()); 24 | } 25 | 26 | /// Tries to convert the current string value of a ConVar to a boolean. 27 | /// 28 | /// The boolean value of the console variable. If the variable is numeric and not 0, the result will be true. 29 | /// Otherwise the result will be false. 30 | /// 31 | public bool GetBool() => CallBoolean(nameof(GetBool)); 32 | 33 | /// Returns the default value of the ConVar. 34 | /// The default value of the console variable. 35 | public string GetDefault() => CallString(nameof(GetDefault)); 36 | 37 | /// Attempts to convert the ConVar value to a float. 38 | /// The float value of the console variable. 39 | /// 40 | /// If the value cannot be converted to a float, it will return 0. 41 | /// 42 | public double GetFloat() => CallNumber(nameof(GetFloat)); 43 | 44 | /// Returns the help text assigned to that convar. 45 | /// The help text. 46 | public string GetHelpText() => CallString(nameof(GetHelpText)); 47 | 48 | /// Attempts to convert the ConVar value to a integer. 49 | /// The integer value of the console variable. 50 | /// 51 | /// If it fails to convert to an integer, it will return 0. 52 | /// 53 | /// All float/decimal values will be rounded down (with ). 54 | /// 55 | public int GetInt() => CallInteger(nameof(GetInt)); 56 | 57 | /// Returns the name of the ConVar. 58 | /// The name of the console variable. 59 | public string GetName() => CallString(nameof(GetName)); 60 | 61 | /// Returns the current ConVar value as a string. 62 | /// The current console variable value as a string. 63 | public string GetString() => CallString(nameof(GetString)); 64 | 65 | public static implicit operator ConVar(string name) => new ConVar(name); 66 | 67 | public static bool operator <(ConVar a, ConVar b) => (a != null) && (b != null) && (a.GetFloat() < b.GetFloat()); 68 | 69 | public static bool operator <(ConVar a, double b) => (a != null) && (a.GetFloat() < b); 70 | 71 | public static bool operator <(double b, ConVar a) => (a != null) && (b < a.GetFloat()); 72 | 73 | public static bool operator >(ConVar a, ConVar b) => (a != null) && (b != null) && (a.GetFloat() > b.GetFloat()); 74 | 75 | public static bool operator >(ConVar a, double b) => (a != null) && (a.GetFloat() > b); 76 | 77 | public static bool operator >(double b, ConVar a) => (a != null) && (b > a.GetFloat()); 78 | 79 | public static bool operator <=(ConVar a, ConVar b) => (a != null) && (b != null) && (a.GetFloat() <= b.GetFloat()); 80 | 81 | public static bool operator <=(ConVar a, double b) => (a != null) && (a.GetFloat() <= b); 82 | 83 | public static bool operator <=(double b, ConVar a) => (a != null) && (b <= a.GetFloat()); 84 | 85 | public static bool operator >=(ConVar a, ConVar b) => (a != null) && (b != null) && (a.GetFloat() >= b.GetFloat()); 86 | 87 | public static bool operator >=(ConVar a, double b) => (a != null) && (a.GetFloat() >= b); 88 | 89 | public static bool operator >=(double b, ConVar a) => (a != null) && (b >= a.GetFloat()); 90 | 91 | public static bool operator ==(ConVar a, ConVar b) => (a != null) && (b != null) && (Math.Abs(a.GetFloat() - b.GetFloat()) < double.Epsilon); 92 | 93 | public static bool operator ==(ConVar a, double b) => (a != null) && (Math.Abs(a.GetFloat() - b) < double.Epsilon); 94 | 95 | public static bool operator ==(double b, ConVar a) => (a != null) && (Math.Abs(b - a.GetFloat()) < double.Epsilon); 96 | 97 | public static bool operator !=(ConVar a, ConVar b) => !(a == b); 98 | 99 | public static bool operator !=(ConVar a, double b) => !(a == b); 100 | 101 | public static bool operator !=(double b, ConVar a) => !(b == a); 102 | 103 | public override bool Equals(object obj) 104 | { 105 | if (ReferenceEquals(null, obj) || (GetType() != obj.GetType())) 106 | { 107 | return false; 108 | } 109 | if (ReferenceEquals(this, obj)) 110 | { 111 | return true; 112 | } 113 | return obj is ConVar && Equals((ConVar)obj); 114 | } 115 | 116 | public override int GetHashCode() => ConVarId.GetHashCode(); 117 | } 118 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Classes/Entity.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Classes 2 | { 3 | public class Entity : LuaObject 4 | { 5 | public Entity(int index) : base(index) { } 6 | 7 | public Entity(uint entityId) : base(LuaTable._G.InvokeObject(nameof(Global.Entity), entityId).GetIndex()) { } 8 | 9 | public Angle EyeAngles() => new Angle(CallObject(nameof(EyeAngles)).GetIndex()); 10 | 11 | public Vector GetAbsVelocity() => new Vector(CallObject(nameof(GetAbsVelocity)).GetIndex()); 12 | 13 | public Angle GetAngles() => new Angle(CallObject(nameof(GetAngles)).GetIndex()); 14 | 15 | public string GetClass() => CallString(nameof(GetClass)); 16 | } 17 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Classes/File.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Classes 2 | { 3 | public sealed class File : LuaObject 4 | { 5 | public File(int index) : base(index) { } 6 | } 7 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Classes/IGModAudioChannel.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Classes 2 | { 3 | public sealed class IGModAudioChannel : LuaObject 4 | { 5 | public IGModAudioChannel(int index) : base(index) { } 6 | } 7 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Classes/IMaterial.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Classes 2 | { 3 | public sealed class IMaterial : LuaObject 4 | { 5 | public IMaterial(int index) : base(index) { } 6 | } 7 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Classes/IMesh.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Classes 2 | { 3 | public sealed class IMesh : LuaObject 4 | { 5 | public IMesh(int index) : base(index) { } 6 | } 7 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Classes/IRestore.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Classes 2 | { 3 | public sealed class IRestore : LuaObject 4 | { 5 | public IRestore(int index) : base(index) { } 6 | } 7 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Classes/ISave.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Classes 2 | { 3 | public sealed class ISave : LuaObject 4 | { 5 | public ISave(int index) : base(index) { } 6 | } 7 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Classes/ITexture.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Classes 2 | { 3 | public sealed class ITexture : LuaObject 4 | { 5 | public ITexture(int index) : base(index) { } 6 | } 7 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Classes/IVideoWriter.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Classes 2 | { 3 | public sealed class IVideoWriter : LuaObject 4 | { 5 | public IVideoWriter(int index) : base(index) { } 6 | } 7 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Classes/MarkupObject.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Classes 2 | { 3 | public sealed class MarkupObject : LuaObject 4 | { 5 | public MarkupObject(int index) : base(index) { } 6 | } 7 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Classes/NPC.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Classes 2 | { 3 | public sealed class NPC : Entity 4 | { 5 | public NPC(int index) : base(index) { } 6 | } 7 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Classes/NextBot.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Classes 2 | { 3 | public sealed class NextBot : LuaObject 4 | { 5 | public NextBot(int index) : base(index) { } 6 | } 7 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Classes/Panel.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Classes 2 | { 3 | public sealed class Panel : LuaObject 4 | { 5 | public Panel(int index) : base(index) { } 6 | } 7 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Classes/PathFollower.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Classes 2 | { 3 | public sealed class PathFollower : LuaObject 4 | { 5 | public PathFollower(int index) : base(index) { } 6 | } 7 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Classes/PhysObj.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Classes 2 | { 3 | public sealed class PhysObj : LuaObject 4 | { 5 | public PhysObj(int index) : base(index) { } 6 | } 7 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Classes/Player.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Classes 2 | { 3 | public sealed class Player : Entity 4 | { 5 | public Player(int index) : base(index) { } 6 | 7 | public Player(uint id) : base(LuaTable._G.InvokeObject(nameof(Global.Player), id).GetIndex()) { } 8 | } 9 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Classes/Schedule.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Classes 2 | { 3 | public sealed class Schedule : LuaObject 4 | { 5 | public Schedule(int index) : base(index) { } 6 | } 7 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Classes/Stack.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Classes 2 | { 3 | public sealed class Stack : LuaObject 4 | { 5 | public Stack(int index) : base(index) { } 6 | } 7 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Classes/TOOL.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Classes 2 | { 3 | public sealed class TOOL : LuaObject 4 | { 5 | public TOOL(int index) : base(index) { } 6 | } 7 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Classes/Task.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Classes 2 | { 3 | public sealed class Task : LuaObject 4 | { 5 | public Task(int index) : base(index) { } 6 | } 7 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Classes/Vehicle.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Classes 2 | { 3 | public sealed class Vehicle : Entity 4 | { 5 | public Vehicle(int index) : base(index) { } 6 | } 7 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Classes/Weapon.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Classes 2 | { 3 | public sealed class Weapon : Entity 4 | { 5 | public Weapon(int index) : base(index) { } 6 | } 7 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Classes/bf_read.cs: -------------------------------------------------------------------------------- 1 | 2 | #if CLIENT 3 | 4 | namespace GarrysModLuaShared.Classes 5 | { 6 | /// 7 | /// This is the object passed to when a message is received. It contains each 8 | /// value stored in the message in sequential order. You should read values from it in the order you wrote them. 9 | /// 10 | public sealed class bf_read : LuaObject 11 | { 12 | static readonly int bf_readId = Random.Generator.Next((int)Type.UserMsg, int.MaxValue); 13 | 14 | public bf_read(int index) : base(index) { } 15 | 16 | /// Reads an returns an angle object from the bitstream. 17 | /// The read angle. 18 | public Angle ReadAngle() => CallObject(nameof(ReadAngle)).ToAngle(); 19 | 20 | /// Reads 1 bit an returns a bool representing the bit. 21 | /// The read bit as boolean. 22 | public bool ReadBool() => CallBoolean(nameof(ReadBool)); 23 | 24 | /// Reads a signed char and returns a number from -127 to 127 representing the ascii value of that char. 25 | /// ASCII value. 26 | public sbyte ReadChar() => (sbyte)CallInteger(nameof(ReadChar)); 27 | 28 | /// Reads a short representing an entity index and returns the matching entity handle. 29 | /// The read entity. 30 | public Entity ReadEntity() => CallObject(nameof(ReadEntity)).ToEntity(); 31 | 32 | /// Reads a 4 byte float from the bitstream and returns it. 33 | /// The read float. 34 | public double ReadFloat() => CallNumber(nameof(ReadFloat)); 35 | 36 | /// Reads a 4 byte long from the bitstream and returns it. 37 | /// The read long. 38 | public int ReadLong() => CallInteger(nameof(ReadLong)); 39 | 40 | /// Reads a 2 byte short from the bitstream and returns it. 41 | /// The read short. 42 | public short ReadShort() => (short)CallInteger(nameof(ReadShort)); 43 | 44 | /// Reads a null terminated string from the bitstream. 45 | /// The read string. 46 | public string ReadString() => CallString(nameof(ReadString)); 47 | 48 | /// 49 | /// Reads a special encoded vector from the bitstream and returns it, this function is not suitable to send 50 | /// normals. 51 | /// 52 | /// The read vector. 53 | public Vector ReadVector() => CallObject(nameof(ReadVector)).ToVector(); 54 | 55 | /// 56 | /// Reads a special encoded vector normal from the bitstream and returns it, this function is not suitable to send 57 | /// vectors that represent a position. 58 | /// 59 | /// The read normal vector. 60 | public Vector ReadVectorNormal() => CallObject(nameof(ReadVectorNormal)).ToVector(); 61 | 62 | /// Rewinds the bitstream so it can be read again. 63 | public void Reset() => CallVoid(nameof(Reset)); 64 | } 65 | } 66 | 67 | #endif -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Dependencies/source_exports.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmegaExtern/gmod-csharp-binary-module/bbd1caa16705fc322da61059e4cff9221909e6da/GarrysModLuaShared/GarrysModLuaShared/Dependencies/source_exports.dll -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/DllMain.cs: -------------------------------------------------------------------------------- 1 | // 2 | // IMPORTANT NOTE /!!\ 3 | // If you are developing a clientside (gmcl) binary module, go to properties of the project, click on "Build" tab and define "CLIENT" (without double-quotes, case-sensitive!) in "Conditional compilation symbols". 4 | // If you are developing a serverside (gmsv) binary module, then define "SERVER" (without double-quotes, case-sensitive!) in "Conditional compilation symbols". 5 | // 6 | // ADDITIONAL NOTES 7 | // If you want to call function from Source engine (work in progress), you can do so by defining "SOURCE_SDK" (without double-quotes, case-sensitive!) in "Conditional compilation symbols". 8 | // For those who defined SOURCE_SDK: 9 | // This "grants you an access" to GarrysModLuaShared.Source namespace. 10 | // There is one more step you have to do once you compile C# binary module and you want to try it out: 11 | // Copy "source_exports.dll" file to GarrysMod folder (in the folder where "hl2.exe" file is). Do not rename "source_exports.dll" file! 12 | // You can find "source_exports.dll" file in the output folder (in the same folder as C# binary module; bin/Release), you can also find it inside "Dependencies" folder of this project. 13 | // 14 | // WIKI: https://github.com/OmegaExtern/gmod-csharp-binary-module/wiki 15 | // 16 | 17 | using System; 18 | using System.Runtime.InteropServices; 19 | using GarrysModLuaShared.Classes; 20 | #if SOURCE_SDK 21 | using GarrysModLuaShared.Source; 22 | #endif 23 | using GarrysModLuaShared.Structs; 24 | using RGiesecke.DllExport; 25 | using static GarrysModLuaShared.Global; 26 | using static GarrysModLuaShared.Lua; 27 | 28 | namespace GarrysModLuaShared 29 | { 30 | static class DllMain 31 | { 32 | /// Called when your module is opened. 33 | /// Pointer to lua_State struct. 34 | /// Number of return values. 35 | [DllExport(CallingConvention = CallingConvention.Cdecl)] 36 | public static int gmod13_open(LuaState luaState) 37 | { 38 | InitializeLua(luaState); 39 | 40 | // 41 | // Do your stuff - below. 42 | // 43 | 44 | return 0; 45 | } 46 | 47 | /// Called when your module is closed. 48 | /// Pointer to lua_State struct. 49 | /// Number of return values. 50 | [DllExport(CallingConvention = CallingConvention.Cdecl)] 51 | public static int gmod13_close(LuaState luaState) => 0; 52 | } 53 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/BLOOD.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum BLOOD 4 | { 5 | /// No blood 6 | DONT_BLEED = -1, 7 | 8 | /// Normal red blood 9 | BLOOD_COLOR_RED = 0, 10 | 11 | /// Yellow blood 12 | BLOOD_COLOR_YELLOW = 1, 13 | 14 | /// Green-red blood 15 | BLOOD_COLOR_GREEN = 2, 16 | 17 | /// Sparks 18 | BLOOD_COLOR_MECH = 3, 19 | 20 | /// Yellow blood 21 | BLOOD_COLOR_ANTLION = 4, 22 | 23 | /// Green-red blood 24 | BLOOD_COLOR_ZOMBIE = 5, 25 | 26 | /// Bright green blood 27 | BLOOD_COLOR_ANTLION_WORKER = 6 28 | } 29 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/BONE.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum BONE 4 | { 5 | BONE_PHYSICALLY_SIMULATED = 1, 6 | BONE_PHYSICS_PROCEDURAL = 2, 7 | BONE_ALWAYS_PROCEDURAL = 4, 8 | BONE_SCREEN_ALIGN_SPHERE = 8, 9 | BONE_SCREEN_ALIGN_CYLINDER = 16, 10 | BONE_CALCULATE_MASK = 31, 11 | 12 | /// A hitbox is attached to this bone 13 | BONE_USED_BY_HITBOX = 256, 14 | 15 | /// An attachment is attached to this bone 16 | BONE_USED_BY_ATTACHMENT = 512, 17 | BONE_USED_BY_VERTEX_LOD0 = 1024, 18 | BONE_USED_BY_VERTEX_LOD1 = 2048, 19 | BONE_USED_BY_VERTEX_LOD2 = 4096, 20 | BONE_USED_BY_VERTEX_LOD3 = 8192, 21 | BONE_USED_BY_VERTEX_LOD4 = 16384, 22 | BONE_USED_BY_VERTEX_LOD5 = 32768, 23 | BONE_USED_BY_VERTEX_LOD6 = 65536, 24 | BONE_USED_BY_VERTEX_LOD7 = 131072, 25 | BONE_USED_BY_VERTEX_MASK = 261120, 26 | BONE_USED_BY_BONE_MERGE = 262144, 27 | 28 | /// Is this bone used by anything?( If any BONE_USED_BY_* flags are true ) 29 | BONE_USED_BY_ANYTHING = 524032, 30 | BONE_USED_MASK = 524032 31 | } 32 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/BOX.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum BOX 4 | { 5 | /// Place the light from the front 6 | BOX_FRONT = 0, 7 | 8 | /// Place the light behind 9 | BOX_BACK = 1, 10 | 11 | /// Place the light to the right 12 | BOX_RIGHT = 2, 13 | 14 | /// Place the light to the left 15 | BOX_LEFT = 3, 16 | 17 | /// Place the light to the top 18 | BOX_TOP = 4, 19 | 20 | /// Place the light to the bottom 21 | BOX_BOTTOM = 5 22 | } 23 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/BUTTON.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum BUTTON 4 | { 5 | BUTTON_CODE_INVALID = -1, 6 | BUTTON_CODE_NONE = 0, 7 | BUTTON_CODE_LAST = 171, 8 | BUTTON_CODE_COUNT = 172 9 | } 10 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/CAP.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum CAP 4 | { 5 | CAP_SIMPLE_RADIUS_DAMAGE = -2147483648, 6 | 7 | /// Walk/Run 8 | CAP_MOVE_GROUND = 1, 9 | 10 | /// Jump/Leap 11 | CAP_MOVE_JUMP = 2, 12 | 13 | /// Can fly move all around 14 | CAP_MOVE_FLY = 4, 15 | 16 | /// climb ladders 17 | CAP_MOVE_CLIMB = 8, 18 | CAP_MOVE_SWIM = 16, 19 | CAP_MOVE_CRAWL = 32, 20 | 21 | /// Tries to shoot weapon while moving 22 | CAP_MOVE_SHOOT = 64, 23 | CAP_SKIP_NAV_GROUND_CHECK = 128, 24 | 25 | /// Open doors/push buttons/pull levers 26 | CAP_USE = 256, 27 | 28 | /// Can trigger auto doors 29 | CAP_AUTO_DOORS = 1024, 30 | 31 | /// Can open manual doors 32 | CAP_OPEN_DOORS = 2048, 33 | 34 | /// Can turn head always bone controller 0 35 | CAP_TURN_HEAD = 4096, 36 | CAP_WEAPON_RANGE_ATTACK1 = 8192, 37 | CAP_WEAPON_RANGE_ATTACK2 = 16384, 38 | CAP_WEAPON_MELEE_ATTACK1 = 32768, 39 | CAP_WEAPON_MELEE_ATTACK2 = 65536, 40 | CAP_INNATE_RANGE_ATTACK1 = 131072, 41 | CAP_INNATE_RANGE_ATTACK2 = 262144, 42 | CAP_INNATE_MELEE_ATTACK1 = 524288, 43 | CAP_INNATE_MELEE_ATTACK2 = 1048576, 44 | CAP_USE_WEAPONS = 2097152, 45 | CAP_USE_SHOT_REGULATOR = 16777216, 46 | 47 | /// Has animated eyes/face 48 | CAP_ANIMATEDFACE = 8388608, 49 | 50 | /// Don't take damage from npc's that are D_LI 51 | CAP_FRIENDLY_DMG_IMMUNE = 33554432, 52 | 53 | /// Can form squads 54 | CAP_SQUAD = 67108864, 55 | 56 | /// Cover and Reload ducking 57 | CAP_DUCK = 134217728, 58 | 59 | /// Don't hit players 60 | CAP_NO_HIT_PLAYER = 268435456, 61 | 62 | /// Use arms to aim gun, not just body 63 | CAP_AIM_GUN = 536870912, 64 | CAP_NO_HIT_SQUADMATES = 1073741824 65 | } 66 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/CHAN.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum CHAN 4 | { 5 | /// Used when playing sounds through console commands. 6 | CHAN_REPLACE = -1, 7 | 8 | /// Automatic channel 9 | CHAN_AUTO = 0, 10 | 11 | /// Channel for weapon sounds 12 | CHAN_WEAPON = 1, 13 | 14 | /// Channel for NPC voices 15 | CHAN_VOICE = 2, 16 | 17 | /// Channel for items ( Health kits, etc ) 18 | CHAN_ITEM = 3, 19 | 20 | /// Clothing, ragdoll impacts, footsteps, knocking/pounding/punching etc. 21 | CHAN_BODY = 4, 22 | 23 | /// Stream channel from the static or dynamic area 24 | CHAN_STREAM = 5, 25 | 26 | /// A constant/background sound that doesn't require any reaction. 27 | CHAN_STATIC = 6, 28 | 29 | /// TF2s Announcer dialogue channel 30 | CHAN_VOICE2 = 7, 31 | 32 | /// Channel for network voice data 33 | CHAN_VOICE_BASE = 8, 34 | CHAN_USER_BASE = 136 35 | } 36 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/CLASS.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum CLASS 4 | { 5 | CLASS_NONE = 0, 6 | CLASS_PLAYER = 1, 7 | CLASS_PLAYER_ALLY = 2, 8 | CLASS_PLAYER_ALLY_VITAL = 3, 9 | CLASS_ANTLION = 4, 10 | CLASS_BARNACLE = 5, 11 | CLASS_BULLSEYE = 6, 12 | CLASS_CITIZEN_PASSIVE = 7, 13 | CLASS_CITIZEN_REBEL = 8, 14 | CLASS_COMBINE = 9, 15 | CLASS_COMBINE_GUNSHIP = 10, 16 | CLASS_CONSCRIPT = 11, 17 | CLASS_HEADCRAB = 12, 18 | CLASS_MANHACK = 13, 19 | CLASS_METROPOLICE = 14, 20 | CLASS_MILITARY = 15, 21 | CLASS_SCANNER = 16, 22 | CLASS_STALKER = 17, 23 | CLASS_VORTIGAUNT = 18, 24 | CLASS_ZOMBIE = 19, 25 | CLASS_PROTOSNIPER = 20, 26 | CLASS_MISSILE = 21, 27 | CLASS_FLARE = 22, 28 | CLASS_EARTH_FAUNA = 23, 29 | CLASS_HACKED_ROLLERMINE = 24, 30 | CLASS_COMBINE_HUNTER = 25 31 | } 32 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/COLLISION.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum COLLISION 4 | { 5 | /// Normal 6 | COLLISION_GROUP_NONE = 0, 7 | 8 | /// Collides with nothing but world and static stuff 9 | COLLISION_GROUP_DEBRIS = 1, 10 | 11 | /// Same as debris, but hits triggers. Useful for an item that can be shot, but doesn't collide. 12 | COLLISION_GROUP_DEBRIS_TRIGGER = 2, 13 | 14 | /// Collides with everything except other interactive debris or debris 15 | COLLISION_GROUP_INTERACTIVE_DEBRIS = 3, 16 | 17 | /// Collides with everything except interactive debris or debris 18 | COLLISION_GROUP_INTERACTIVE = 4, 19 | COLLISION_GROUP_PLAYER = 5, 20 | COLLISION_GROUP_BREAKABLE_GLASS = 6, 21 | COLLISION_GROUP_VEHICLE = 7, 22 | 23 | /// For HL2, same as Collision_Group_Player, for TF2, this filters out other players and CBaseObjects 24 | COLLISION_GROUP_PLAYER_MOVEMENT = 8, 25 | COLLISION_GROUP_NPC = 9, 26 | 27 | /// Doesn't collide with anything, no traces 28 | COLLISION_GROUP_IN_VEHICLE = 10, 29 | 30 | /// Doesn't collide with players 31 | COLLISION_GROUP_WEAPON = 11, 32 | 33 | /// Only collides with vehicles 34 | COLLISION_GROUP_VEHICLE_CLIP = 12, 35 | COLLISION_GROUP_PROJECTILE = 13, 36 | 37 | /// Blocks entities not permitted to get near moving doors 38 | COLLISION_GROUP_DOOR_BLOCKER = 14, 39 | 40 | /// Let's the Player through, nothing else. 41 | COLLISION_GROUP_PASSABLE_DOOR = 15, 42 | 43 | /// Things that are dissolving are in this group 44 | COLLISION_GROUP_DISSOLVING = 16, 45 | 46 | /// Nonsolid on client and server, pushaway in player code 47 | COLLISION_GROUP_PUSHAWAY = 17, 48 | COLLISION_GROUP_NPC_ACTOR = 18, 49 | COLLISION_GROUP_NPC_SCRIPTED = 19, 50 | 51 | /// Doesn't collide with players/props 52 | COLLISION_GROUP_WORLD = 20 53 | } 54 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/COND.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum COND 4 | { 5 | COND_BEHIND_ENEMY = 29, 6 | COND_BETTER_WEAPON_AVAILABLE = 46, 7 | COND_CAN_MELEE_ATTACK1 = 23, 8 | COND_CAN_MELEE_ATTACK2 = 24, 9 | COND_CAN_RANGE_ATTACK1 = 21, 10 | COND_CAN_RANGE_ATTACK2 = 22, 11 | COND_ENEMY_DEAD = 30, 12 | COND_ENEMY_FACING_ME = 28, 13 | COND_ENEMY_OCCLUDED = 13, 14 | COND_ENEMY_TOO_FAR = 27, 15 | COND_ENEMY_UNREACHABLE = 31, 16 | COND_ENEMY_WENT_NULL = 12, 17 | COND_FLOATING_OFF_GROUND = 61, 18 | COND_GIVE_WAY = 48, 19 | COND_HAVE_ENEMY_LOS = 15, 20 | COND_HAVE_TARGET_LOS = 16, 21 | COND_HEALTH_ITEM_AVAILABLE = 47, 22 | COND_HEAR_BUGBAIT = 52, 23 | COND_HEAR_BULLET_IMPACT = 56, 24 | COND_HEAR_COMBAT = 53, 25 | COND_HEAR_DANGER = 50, 26 | COND_HEAR_MOVE_AWAY = 58, 27 | COND_HEAR_PHYSICS_DANGER = 57, 28 | COND_HEAR_PLAYER = 55, 29 | COND_HEAR_SPOOKY = 59, 30 | COND_HEAR_THUMPER = 51, 31 | COND_HEAR_WORLD = 54, 32 | COND_HEAVY_DAMAGE = 18, 33 | COND_IDLE_INTERRUPT = 2, 34 | COND_IN_PVS = 1, 35 | COND_LIGHT_DAMAGE = 17, 36 | COND_LOST_ENEMY = 11, 37 | COND_LOST_PLAYER = 33, 38 | COND_LOW_PRIMARY_AMMO = 3, 39 | COND_MOBBED_BY_ENEMIES = 62, 40 | COND_NEW_ENEMY = 26, 41 | COND_NO_CUSTOM_INTERRUPTS = 70, 42 | COND_NO_HEAR_DANGER = 60, 43 | COND_NO_PRIMARY_AMMO = 4, 44 | COND_NO_SECONDARY_AMMO = 5, 45 | COND_NO_WEAPON = 6, 46 | COND_NONE = 0, 47 | COND_NOT_FACING_ATTACK = 40, 48 | 49 | /// Freezes NPC movement 50 | COND_NPC_FREEZE = 67, 51 | 52 | /// Unfreezes NPC movement 53 | COND_NPC_UNFREEZE = 68, 54 | COND_PHYSICS_DAMAGE = 19, 55 | COND_PLAYER_ADDED_TO_SQUAD = 64, 56 | COND_PLAYER_PUSHING = 66, 57 | COND_PLAYER_REMOVED_FROM_SQUAD = 65, 58 | COND_PROVOKED = 25, 59 | COND_RECEIVED_ORDERS = 63, 60 | COND_REPEATED_DAMAGE = 20, 61 | COND_SCHEDULE_DONE = 36, 62 | COND_SEE_DISLIKE = 9, 63 | COND_SEE_ENEMY = 10, 64 | COND_SEE_FEAR = 8, 65 | COND_SEE_HATE = 7, 66 | COND_SEE_NEMESIS = 34, 67 | COND_SEE_PLAYER = 32, 68 | COND_SMELL = 37, 69 | COND_TALKER_RESPOND_TO_QUESTION = 69, 70 | COND_TARGET_OCCLUDED = 14, 71 | COND_TASK_FAILED = 35, 72 | COND_TOO_CLOSE_TO_ATTACK = 38, 73 | COND_TOO_FAR_TO_ATTACK = 39, 74 | COND_WAY_CLEAR = 49, 75 | COND_WEAPON_BLOCKED_BY_FRIEND = 42, 76 | COND_WEAPON_HAS_LOS = 41, 77 | COND_WEAPON_PLAYER_IN_SPREAD = 43, 78 | COND_WEAPON_PLAYER_NEAR_TARGET = 44, 79 | COND_WEAPON_SIGHT_OCCLUDED = 45 80 | } 81 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/CONTENTS.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum CONTENTS 4 | { 5 | /// Things that are not solid 6 | CONTENTS_EMPTY = 0, 7 | 8 | /// Things that are solid 9 | CONTENTS_SOLID = 1, 10 | 11 | /// Glass 12 | CONTENTS_WINDOW = 2, 13 | CONTENTS_AUX = 4, 14 | 15 | /// Bullets go through, solids don't 16 | CONTENTS_GRATE = 8, 17 | CONTENTS_SLIME = 16, 18 | 19 | /// Hits world but not skybox 20 | CONTENTS_WATER = 32, 21 | 22 | /// Things that block line of sight 23 | CONTENTS_BLOCKLOS = 64, 24 | 25 | /// Things that block light 26 | CONTENTS_OPAQUE = 128, 27 | CONTENTS_TESTFOGVOLUME = 256, 28 | CONTENTS_TEAM4 = 512, 29 | CONTENTS_TEAM3 = 1024, 30 | CONTENTS_TEAM1 = 2048, 31 | CONTENTS_TEAM2 = 4096, 32 | CONTENTS_IGNORE_NODRAW_OPAQUE = 8192, 33 | CONTENTS_MOVEABLE = 16384, 34 | CONTENTS_AREAPORTAL = 32768, 35 | CONTENTS_PLAYERCLIP = 65536, 36 | CONTENTS_MONSTERCLIP = 131072, 37 | CONTENTS_CURRENT_0 = 262144, 38 | CONTENTS_CURRENT_180 = 1048576, 39 | CONTENTS_CURRENT_270 = 2097152, 40 | CONTENTS_CURRENT_90 = 524288, 41 | CONTENTS_CURRENT_DOWN = 8388608, 42 | CONTENTS_CURRENT_UP = 4194304, 43 | CONTENTS_DEBRIS = 67108864, 44 | CONTENTS_DETAIL = 134217728, 45 | 46 | /// Hitbox 47 | CONTENTS_HITBOX = 1073741824, 48 | 49 | /// Ladder 50 | CONTENTS_LADDER = 536870912, 51 | 52 | /// NPCs 53 | CONTENTS_MONSTER = 33554432, 54 | CONTENTS_ORIGIN = 16777216, 55 | 56 | /// Hits world but not skybox 57 | CONTENTS_TRANSLUCENT = 268435456, 58 | LAST_VISIBLE_CONTENTS = 128, 59 | ALL_VISIBLE_CONTENTS = 255 60 | } 61 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/CREATERENDERTARGETFLAGS.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum CREATERENDERTARGETFLAGS 4 | { 5 | CREATERENDERTARGETFLAGS_AUTOMIPMAP = 2, 6 | CREATERENDERTARGETFLAGS_HDR = 1, 7 | CREATERENDERTARGETFLAGS_UNFILTERABLE_OK = 4 8 | } 9 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/CT.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum CT 4 | { 5 | /// Default citizen 6 | CT_DEFAULT = 0, 7 | CT_DOWNTRODDEN = 1, 8 | 9 | /// Refugee 10 | CT_REFUGEE = 2, 11 | 12 | /// Rebel 13 | CT_REBEL = 3, 14 | 15 | /// Odessa? 16 | CT_UNIQUE = 4 17 | } 18 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/D.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum D 4 | { 5 | /// Error 6 | D_ER = 0, 7 | 8 | /// Hate 9 | D_HT = 1, 10 | 11 | /// Frightened / Fear 12 | D_FR = 2, 13 | 14 | /// Like 15 | D_LI = 3, 16 | 17 | /// Neutral 18 | D_NU = 4 19 | } 20 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/DMG.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum DMG 4 | { 5 | /// Generic damage 6 | DMG_GENERIC = 0, 7 | 8 | /// Caused by physics interaction 9 | DMG_CRUSH = 1, 10 | 11 | /// Bullet damage 12 | DMG_BULLET = 2, 13 | 14 | /// Sharp objects, such as Manhacks or other NPCs attacks 15 | DMG_SLASH = 4, 16 | 17 | /// Damage from fire 18 | DMG_BURN = 8, 19 | 20 | /// Hit by a vehicle 21 | DMG_VEHICLE = 16, 22 | 23 | /// Fall damage 24 | DMG_FALL = 32, 25 | 26 | /// Explosion damage 27 | DMG_BLAST = 64, 28 | 29 | /// Crowbar damage 30 | DMG_CLUB = 128, 31 | 32 | /// Electrical damage, shows smoke at the damage position 33 | DMG_SHOCK = 256, 34 | 35 | /// Sonic damage,used by the Gargantua and Houndeye NPCs 36 | DMG_SONIC = 512, 37 | 38 | /// Laser 39 | DMG_ENERGYBEAM = 1024, 40 | 41 | /// Don't create gibs 42 | DMG_NEVERGIB = 4096, 43 | 44 | /// Always create gibs 45 | DMG_ALWAYSGIB = 8192, 46 | 47 | /// Drown damage 48 | DMG_DROWN = 16384, 49 | 50 | /// Same as DMG_POISON 51 | DMG_PARALYZE = 32768, 52 | 53 | /// Neurotoxin damage 54 | DMG_NERVEGAS = 65536, 55 | 56 | /// Poison damage 57 | DMG_POISON = 131072, 58 | 59 | /// Toxic chemicals or acid burns 60 | DMG_ACID = 1048576, 61 | 62 | /// Airboat gun damage 63 | DMG_AIRBOAT = 33554432, 64 | 65 | /// This won't hurt the player underwater 66 | DMG_BLAST_SURFACE = 134217728, 67 | 68 | /// The pellets fired from a shotgun 69 | DMG_BUCKSHOT = 536870912, 70 | 71 | /// Direct damage to the entity that does not go through any damage value modifications 72 | DMG_DIRECT = 268435456, 73 | 74 | /// Forces the entity to dissolve on death 75 | DMG_DISSOLVE = 67108864, 76 | 77 | /// Damage applied to the player to restore health after drowning 78 | DMG_DROWNRECOVER = 524288, 79 | 80 | /// Damage done by the gravity gun 81 | DMG_PHYSGUN = 8388608, 82 | 83 | /// Plasma 84 | DMG_PLASMA = 16777216, 85 | 86 | /// Prevent a physics force 87 | DMG_PREVENT_PHYSICS_FORCE = 2048, 88 | 89 | /// Radiation 90 | DMG_RADIATION = 262144, 91 | 92 | /// Don't create a ragdoll on death 93 | DMG_REMOVENORAGDOLL = 4194304, 94 | 95 | /// In an oven 96 | DMG_SLOWBURN = 2097152 97 | } 98 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/DOCK.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum DOCK 4 | { 5 | /// Don't dock 6 | NODOCK = 0, 7 | 8 | /// Fill parent 9 | FILL = 1, 10 | 11 | /// Dock to the left 12 | LEFT = 2, 13 | 14 | /// Dock to the right 15 | RIGHT = 3, 16 | 17 | /// Dock to the top 18 | TOP = 4, 19 | 20 | /// Dock to the bottom 21 | BOTTOM = 5 22 | } 23 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/DOF.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum DOF 4 | { 5 | DOF_OFFSET = 256, 6 | DOF_SPACING = 512 7 | } 8 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/EF.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum EF 4 | { 5 | /// Bonemerges the entity to it's parent 6 | EF_BONEMERGE = 1, 7 | EF_BONEMERGE_FASTCULL = 128, 8 | EF_BRIGHTLIGHT = 2, 9 | EF_DIMLIGHT = 4, 10 | EF_NOINTERP = 8, 11 | 12 | /// Disables shadow 13 | EF_NOSHADOW = 16, 14 | 15 | /// Prevents the entity from drawing and networking. 16 | EF_NODRAW = 32, 17 | EF_NORECEIVESHADOW = 64, 18 | 19 | /// Makes the entity blink 20 | EF_ITEM_BLINK = 256, 21 | EF_PARENT_ANIMATES = 512 22 | } 23 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/EFL.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum EFL 4 | { 5 | /// This is set on bots that are frozen 6 | EFL_BOT_FROZEN = 256, 7 | EFL_CHECK_UNTOUCH = 16777216, 8 | 9 | /// Some dirty bits with respect to abs computations 10 | EFL_DIRTY_ABSANGVELOCITY = 8192, 11 | EFL_DIRTY_ABSTRANSFORM = 2048, 12 | EFL_DIRTY_ABSVELOCITY = 4096, 13 | 14 | /// (Client only) need shadow manager to update the shadow 15 | EFL_DIRTY_SHADOWUPDATE = 32, 16 | EFL_DIRTY_SPATIAL_PARTITION = 32768, 17 | EFL_DIRTY_SURROUNDING_COLLISION_BOUNDS = 16384, 18 | 19 | /// Entity shouldn't block NPC line-of-sight 20 | EFL_DONTBLOCKLOS = 33554432, 21 | 22 | /// NPCs should not walk on this entity 23 | EFL_DONTWALKON = 67108864, 24 | 25 | /// Entity is dormant, no updates to client 26 | EFL_DORMANT = 2, 27 | 28 | /// 29 | /// The default behavior in ShouldTransmit is to not send an entity if it doesn't have a model. Certain entities 30 | /// want to be sent anyway because all the drawing logic is in the client DLL. They can set this flag and the engine 31 | /// will transmit them even if they don't have model 32 | /// 33 | EFL_FORCE_CHECK_TRANSMIT = 128, 34 | 35 | /// One of the child entities is a player 36 | EFL_HAS_PLAYER_CHILD = 16, 37 | 38 | /// 39 | /// This is set if the entity detects that it's in the skybox. This forces it to pass the "in PVS" for 40 | /// transmission 41 | /// 42 | EFL_IN_SKYBOX = 131072, 43 | EFL_IS_BEING_LIFTED_BY_BARNACLE = 1048576, 44 | 45 | /// This is a special entity that should not be deleted when we restart entities only 46 | EFL_KEEP_ON_RECREATE_ENTITIES = 16, 47 | 48 | /// This entity is marked for death -- This allows the game to actually delete ents at a safe time 49 | EFL_KILLME = 1, 50 | 51 | /// Lets us know when the noclip command is active 52 | EFL_NOCLIP_ACTIVE = 4, 53 | 54 | /// Another entity is watching events on this entity (used by teleport) 55 | EFL_NOTIFY = 64, 56 | 57 | /// Don't attach the edict 58 | EFL_NO_AUTO_EDICT_ATTACH = 1024, 59 | 60 | /// Doesn't accept forces from physics damage 61 | EFL_NO_DAMAGE_FORCES = -2147483648, 62 | 63 | /// Entitiy shouldn't dissolve 64 | EFL_NO_DISSOLVE = 134217728, 65 | EFL_NO_GAME_PHYSICS_SIMULATION = 8388608, 66 | 67 | /// Mega physcannon can't ragdoll these guys 68 | EFL_NO_MEGAPHYSCANNON_RAGDOLL = 268435456, 69 | 70 | /// Physcannon can't pick these up or punt them 71 | EFL_NO_PHYSCANNON_INTERACTION = 1073741824, 72 | EFL_NO_ROTORWASH_PUSH = 2097152, 73 | EFL_NO_THINK_FUNCTION = 4194304, 74 | 75 | /// Don't adjust this entity's velocity when transitioning into water 76 | EFL_NO_WATER_VELOCITY_CHANGE = 536870912, 77 | 78 | /// Non-networked entity 79 | EFL_SERVER_ONLY = 512, 80 | 81 | /// Set while a model is setting up its bones 82 | EFL_SETTING_UP_BONES = 8, 83 | 84 | /// Used to determine if an entity is floating 85 | EFL_TOUCHING_FLUID = 524288, 86 | 87 | /// Entities with this flag set show up in the partition even when not solid 88 | EFL_USE_PARTITION_WHEN_NOT_SOLID = 262144 89 | } 90 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/FCVAR.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace GarrysModLuaShared.Enums 4 | { 5 | [Flags] 6 | public enum FCVAR 7 | { 8 | /// Save the ConVar value into config.cfg 9 | FCVAR_ARCHIVE = 128, 10 | 11 | /// Save the ConVar value into config.cfg on XBox 12 | FCVAR_ARCHIVE_XBOX = 16777216, 13 | 14 | /// Requires sv_cheats to be enabled to change/run the command 15 | FCVAR_CHEAT = 16384, 16 | 17 | /// is allowed to execute this command 18 | FCVAR_CLIENTCMD_CAN_EXECUTE = 1073741824, 19 | 20 | /// ConVar is defined by the client DLL.This flag is set automatically 21 | FCVAR_CLIENTDLL = 8, 22 | 23 | /// Force the ConVar to be recorded by demo recordings. 24 | FCVAR_DEMO = 65536, 25 | 26 | /// Opposite of FCVAR_DEMO, ensures the ConVar is not recorded in demos 27 | FCVAR_DONTRECORD = 131072, 28 | 29 | /// ConVar is defined by the game DLL.This flag is set automatically 30 | FCVAR_GAMEDLL = 4, 31 | 32 | /// Tells the engine to never print this variable as a string since it contains control sequences 33 | FCVAR_NEVER_AS_STRING = 4096, 34 | 35 | /// No flags 36 | FCVAR_NONE = 0, 37 | 38 | /// For serverside ConVars, notifies all players with blue chat text when the value gets changed 39 | FCVAR_NOTIFY = 256, 40 | 41 | /// Makes the ConVar not changeable while connected to a server or in singleplayer 42 | FCVAR_NOT_CONNECTED = 4194304, 43 | 44 | /// Forces the ConVar to only have printable characters ( No control characters ) 45 | FCVAR_PRINTABLEONLY = 1024, 46 | 47 | /// Makes the ConVar value hidden from all clients ( For example sv_password ) 48 | FCVAR_PROTECTED = 32, 49 | 50 | /// For serverside ConVars, it will send its value to all clients 51 | FCVAR_REPLICATED = 8192, 52 | 53 | /// Prevents the server from querying value of this ConVar 54 | FCVAR_SERVER_CANNOT_QUERY = 536870912, 55 | 56 | /// Makes the command or ConVar only executeable/changeable from the server console 57 | FCVAR_SERVER_CAN_EXECUTE = 268435456, 58 | 59 | /// Executing the command or changing the ConVar is only allowed in singleplayer 60 | FCVAR_SPONLY = 64, 61 | 62 | /// Don't log the ConVar changes to console/log files/users 63 | FCVAR_UNLOGGED = 2048, 64 | 65 | /// If this is set, don't add to linked list, etc 66 | FCVAR_UNREGISTERED = 1, 67 | 68 | /// For clientside commands, sends the value to the server 69 | FCVAR_USERINFO = 512 70 | } 71 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/FFT.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum FFT 4 | { 5 | /// 128 levels 6 | FFT_256 = 0, 7 | 8 | /// 256 levels 9 | FFT_512 = 1, 10 | 11 | /// 512 levels 12 | FFT_1024 = 2, 13 | 14 | /// 1024 levels 15 | FFT_2048 = 3, 16 | 17 | /// 2048 levels 18 | FFT_4096 = 4, 19 | 20 | /// 4096 levels 21 | FFT_8192 = 5, 22 | 23 | /// 8192 levels 24 | FFT_16384 = 6 25 | } 26 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/FL.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum FL : long 4 | { 5 | /// Is the entity on ground or not 6 | FL_ONGROUND = 1, 7 | 8 | /// Is player ducking or not 9 | FL_DUCKING = 2, 10 | 11 | /// Is the player in the process of ducking or standing up 12 | FL_ANIMDUCKING = 4, 13 | 14 | /// The player is jumping out of water 15 | FL_WATERJUMP = 8, 16 | 17 | /// This player is controlling a func_train 18 | FL_ONTRAIN = 16, 19 | FL_INRAIN = 32, 20 | 21 | /// Completely freezes the player 22 | FL_FROZEN = 64, 23 | 24 | /// 25 | /// This player is controlling something UI related in the world, this prevents his movement, but doesn't freeze 26 | /// mouse movement, jumping, etc. 27 | /// 28 | FL_ATCONTROLS = 128, 29 | 30 | /// Is this entity a player or not 31 | FL_CLIENT = 256, 32 | 33 | /// Bots have this flag 34 | FL_FAKECLIENT = 512, 35 | 36 | /// Is the player in water or not 37 | FL_INWATER = 1024, 38 | 39 | /// This entity can fly 40 | FL_FLY = 2048, 41 | 42 | /// This entity can swim 43 | FL_SWIM = 4096, 44 | 45 | /// This entity is a func_conveyor 46 | FL_CONVEYOR = 8192, 47 | 48 | /// NPCs have this flag 49 | FL_NPC = 16384, 50 | 51 | /// Grants godmode to the player 52 | FL_GODMODE = 32768, 53 | 54 | /// Makes the entity invisible to AI 55 | FL_NOTARGET = 65536, 56 | 57 | /// This entity can be aimed at 58 | FL_AIMTARGET = 131072, 59 | FL_PARTIALGROUND = 262144, 60 | FL_STATICPROP = 524288, 61 | FL_GRAPHED = 1048576, 62 | 63 | /// This entity is a grenade, unused 64 | FL_GRENADE = 2097152, 65 | FL_STEPMOVEMENT = 4194304, 66 | 67 | /// Doesn't generate touch functions, calls ENTITY:EndTouch when this flag gets set during a touch callback 68 | FL_DONTTOUCH = 8388608, 69 | FL_BASEVELOCITY = 16777216, 70 | 71 | /// This entity is a brush and part of the world 72 | FL_WORLDBRUSH = 33554432, 73 | 74 | /// This entity can be seen by NPCs 75 | FL_OBJECT = 67108864, 76 | 77 | /// This entity is about to get removed 78 | FL_KILLME = 134217728, 79 | 80 | /// This entity is on fire 81 | FL_ONFIRE = 268435456, 82 | 83 | /// The entity is currently dissolving 84 | FL_DISSOLVING = 536870912, 85 | 86 | /// This entity is about to become a ragdoll 87 | FL_TRANSRAGDOLL = 1073741824, 88 | 89 | /// This moving door can't be blocked by the player 90 | FL_UNBLOCKABLE_BY_PLAYER = 2147483648 91 | } 92 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/FORCE.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum FORCE 4 | { 5 | /// Forces the function to take strings only 6 | FORCE_STRING = 1, 7 | 8 | /// Forces the function to take numbers only 9 | FORCE_NUMBER = 2, 10 | 11 | /// Forces the function to take booleans only 12 | FORCE_BOOL = 3 13 | } 14 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/FVPHYSICS.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum FVPHYSICS 4 | { 5 | /// Won't receive physics forces from collisions and won't collide with other PhysObj with the same flag set 6 | FVPHYSICS_CONSTRAINT_STATIC = 2, 7 | 8 | /// 9 | /// Colliding with entities will cause 1000 damage with DMG_DISSOLVE as the damage type, but only if 10 | /// EFL_NO_DISSOLVE is not set 11 | /// 12 | FVPHYSICS_DMG_DISSOLVE = 512, 13 | FVPHYSICS_DMG_SLICE = 1, 14 | 15 | /// Will deal high physics damage(?) even with a small mass 16 | FVPHYSICS_HEAVY_OBJECT = 32, 17 | 18 | /// 19 | /// This PhysObj is part of an entity with multiple PhysObj , such as a ragdoll or a vehicle , and will be 20 | /// considered during collision damage events 21 | /// 22 | FVPHYSICS_MULTIOBJECT_ENTITY = 16, 23 | 24 | /// Colliding with entities won't cause physics damage 25 | FVPHYSICS_NO_IMPACT_DMG = 1024, 26 | 27 | /// 28 | /// Like FVPHYSICS_NO_NPC_IMPACT_DMG, but only checks for NPCs. Usually set on Combine Balls fired by Combine 29 | /// Soldiers 30 | /// 31 | FVPHYSICS_NO_NPC_IMPACT_DMG = 2048, 32 | 33 | /// Doesn't allow the player to pick this PhysObj with the Gravity Gun or +use pickup 34 | FVPHYSICS_NO_PLAYER_PICKUP = 128, 35 | 36 | /// 37 | /// We won't collide with other PhysObj associated to the same entity, only used for vehicles and ragdolls held by 38 | /// the Super Gravity Gun 39 | /// 40 | FVPHYSICS_NO_SELF_COLLISIONS = 32768, 41 | 42 | /// This PhysObj is part of a ragdoll 43 | FVPHYSICS_PART_OF_RAGDOLL = 8, 44 | 45 | /// Set by the physics engine when two PhysObj are penetrating each other 46 | FVPHYSICS_PENETRATING = 64, 47 | 48 | /// Set when the player is holding this PhysObj with the Gravity Gun or +use pickup 49 | FVPHYSICS_PLAYER_HELD = 4, 50 | 51 | /// This object was thrown by the Gravity Gun , stuns Antlion guards, Hunters, and squashes Antlion grubs 52 | FVPHYSICS_WAS_THROWN = 256 53 | } 54 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/GESTURE.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum GESTURE 4 | { 5 | /// Slot for weapon gestures 6 | GESTURE_SLOT_ATTACK_AND_RELOAD = 0, 7 | GESTURE_SLOT_GRENADE = 1, 8 | 9 | /// Slot for jump gestures 10 | GESTURE_SLOT_JUMP = 2, 11 | 12 | /// Slot for swimming gestures 13 | GESTURE_SLOT_SWIM = 3, 14 | 15 | /// Slot for flinching gestures 16 | GESTURE_SLOT_FLINCH = 4, 17 | GESTURE_SLOT_VCD = 5, 18 | 19 | /// Slot for custom gestures 20 | GESTURE_SLOT_CUSTOM = 6 21 | } 22 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/GMOD_CHANNEL.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum GMOD_CHANNEL 4 | { 5 | /// The channel is stopped 6 | GMOD_CHANNEL_STOPPED = 0, 7 | 8 | /// The channel is playing 9 | GMOD_CHANNEL_PLAYING = 1, 10 | 11 | /// The channel is paused 12 | GMOD_CHANNEL_PAUSED = 2, 13 | 14 | /// The channel is buffering 15 | GMOD_CHANNEL_STALLED = 3 16 | } 17 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/HITGROUP.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum HITGROUP 4 | { 5 | /// 6 | /// 1:1 damage. This hitgroup is not present on default player models.It is unknown how this is generated in 7 | /// GM:ScalePlayerDamage, but it occurs when shot by NPCs ( npc_combine_s ) for example. 8 | /// 9 | HITGROUP_GENERIC = 0, 10 | 11 | /// Head 12 | HITGROUP_HEAD = 1, 13 | 14 | /// Chest 15 | HITGROUP_CHEST = 2, 16 | 17 | /// Stomach 18 | HITGROUP_STOMACH = 3, 19 | 20 | /// Left arm 21 | HITGROUP_LEFTARM = 4, 22 | 23 | /// Right arm 24 | HITGROUP_RIGHTARM = 5, 25 | 26 | /// Left leg 27 | HITGROUP_LEFTLEG = 6, 28 | 29 | /// Right leg 30 | HITGROUP_RIGHTLEG = 7, 31 | 32 | /// Gear. Supposed to be belt area.This hitgroup is not present on default player models. 33 | HITGROUP_GEAR = 10 34 | } 35 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/HUD.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum HUD 4 | { 5 | /// No longer works; now same as HUD_PRINTCONSOLE 6 | HUD_PRINTNOTIFY = 1, 7 | 8 | /// Console 9 | HUD_PRINTCONSOLE = 2, 10 | 11 | /// Chat, also prints to console 12 | HUD_PRINTTALK = 3, 13 | 14 | /// Center of the screen 15 | HUD_PRINTCENTER = 4 16 | } 17 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/HULL.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum HULL 4 | { 5 | HULL_HUMAN = 0, 6 | HULL_SMALL_CENTERED = 1, 7 | HULL_WIDE_HUMAN = 2, 8 | HULL_TINY = 3, 9 | HULL_WIDE_SHORT = 4, 10 | HULL_MEDIUM = 5, 11 | HULL_TINY_CENTERED = 6, 12 | HULL_LARGE = 7, 13 | HULL_LARGE_CENTERED = 8, 14 | HULL_MEDIUM_TALL = 9 15 | } 16 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/IMAGE_FORMAT.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum IMAGE_FORMAT 4 | { 5 | IMAGE_FORMAT_DEFAULT = -1, 6 | IMAGE_FORMAT_RGBA8888 = 0, 7 | IMAGE_FORMAT_ABGR8888 = 1, 8 | IMAGE_FORMAT_RGB888 = 2, 9 | IMAGE_FORMAT_BGR888 = 3, 10 | IMAGE_FORMAT_RGB565 = 4, 11 | IMAGE_FORMAT_ARGB8888 = 11, 12 | IMAGE_FORMAT_BGRA8888 = 12, 13 | IMAGE_FORMAT_RGBA16161616 = 25, 14 | IMAGE_FORMAT_RGBA16161616F = 24 15 | } 16 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/IN.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum IN 4 | { 5 | /// +alt1 bound key 6 | IN_ALT1 = 16384, 7 | 8 | /// +alt2 bound key 9 | IN_ALT2 = 32768, 10 | 11 | /// +attack bound key ( Default: Left Mouse Button ) 12 | IN_ATTACK = 1, 13 | 14 | /// +attack2 bound key ( Default: Right Mouse Button ) 15 | IN_ATTACK2 = 2048, 16 | 17 | /// +back bound key ( Default: S ) 18 | IN_BACK = 16, 19 | 20 | /// +duck bound key ( Default: CTRL ) 21 | IN_DUCK = 4, 22 | 23 | /// +forward bound key ( Default: W ) 24 | IN_FORWARD = 8, 25 | 26 | /// +jump bound key ( Default: Space ) 27 | IN_JUMP = 2, 28 | 29 | /// +left bound key ( Look left ) 30 | IN_LEFT = 128, 31 | 32 | /// +moveleft bound key ( Default: A ) 33 | IN_MOVELEFT = 512, 34 | 35 | /// +moveright bound key ( Default: D ) 36 | IN_MOVERIGHT = 1024, 37 | 38 | /// +reload bound key ( Default: R ) 39 | IN_RELOAD = 8192, 40 | 41 | /// +right bound key ( Look right ) 42 | IN_RIGHT = 256, 43 | 44 | /// +showscores bound key ( Default: Tab ) 45 | IN_SCORE = 65536, 46 | 47 | /// +speed bound key ( Default: Shift ) 48 | IN_SPEED = 131072, 49 | 50 | /// +use bound key ( Default: E ) 51 | IN_USE = 32, 52 | 53 | /// +walk bound key ( Slow walk ) 54 | IN_WALK = 262144, 55 | 56 | /// +zoom bound key ( Suit Zoom ) 57 | IN_ZOOM = 524288, 58 | 59 | /// +grenade1 bound key 60 | IN_GRENADE1 = 8388608, 61 | 62 | /// +grenade2 bound key 63 | IN_GRENADE2 = 16777216, 64 | 65 | /// For use in weapons. Set in the physgun when scrolling an object away from you. 66 | IN_WEAPON1 = 1048576, 67 | 68 | /// For use in weapons. Set in the physgun when scrolling an object towards you. 69 | IN_WEAPON2 = 2097152, 70 | IN_BULLRUSH = 4194304, 71 | IN_CANCEL = 64, 72 | IN_RUN = 4096 73 | } 74 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/JOYSTICK.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum JOYSTICK 4 | { 5 | JOYSTICK_FIRST = 114, 6 | JOYSTICK_FIRST_AXIS_BUTTON = 150, 7 | JOYSTICK_FIRST_BUTTON = 114, 8 | JOYSTICK_FIRST_POV_BUTTON = 146, 9 | JOYSTICK_LAST = 161, 10 | JOYSTICK_LAST_AXIS_BUTTON = 161, 11 | JOYSTICK_LAST_BUTTON = 145, 12 | JOYSTICK_LAST_POV_BUTTON = 149 13 | } 14 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/KEY.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum KEY 4 | { 5 | KEY_FIRST = 0, 6 | KEY_NONE = 0, 7 | 8 | /// Normal number 0 key 9 | KEY_0 = 1, 10 | 11 | /// Normal number 1 key 12 | KEY_1 = 2, 13 | 14 | /// Normal number 2 key 15 | KEY_2 = 3, 16 | 17 | /// Normal number 3 key 18 | KEY_3 = 4, 19 | 20 | /// Normal number 4 key 21 | KEY_4 = 5, 22 | 23 | /// Normal number 5 key 24 | KEY_5 = 6, 25 | 26 | /// Normal number 6 key 27 | KEY_6 = 7, 28 | 29 | /// Normal number 7 key 30 | KEY_7 = 8, 31 | 32 | /// Normal number 8 key 33 | KEY_8 = 9, 34 | 35 | /// Normal number 9 key 36 | KEY_9 = 10, 37 | KEY_A = 11, 38 | KEY_B = 12, 39 | KEY_C = 13, 40 | KEY_D = 14, 41 | KEY_E = 15, 42 | KEY_F = 16, 43 | KEY_G = 17, 44 | KEY_H = 18, 45 | KEY_I = 19, 46 | KEY_J = 20, 47 | KEY_K = 21, 48 | KEY_L = 22, 49 | KEY_M = 23, 50 | KEY_N = 24, 51 | KEY_O = 25, 52 | KEY_P = 26, 53 | KEY_Q = 27, 54 | KEY_R = 28, 55 | KEY_S = 29, 56 | KEY_T = 30, 57 | KEY_U = 31, 58 | KEY_V = 32, 59 | KEY_W = 33, 60 | KEY_X = 34, 61 | KEY_Y = 35, 62 | KEY_Z = 36, 63 | 64 | /// Keypad number 0 key 65 | KEY_PAD_0 = 37, 66 | 67 | /// Keypad number 1 key 68 | KEY_PAD_1 = 38, 69 | 70 | /// Keypad number 2 key 71 | KEY_PAD_2 = 39, 72 | 73 | /// Keypad number 3 key 74 | KEY_PAD_3 = 40, 75 | 76 | /// Keypad number 4 key 77 | KEY_PAD_4 = 41, 78 | 79 | /// Keypad number 5 key 80 | KEY_PAD_5 = 42, 81 | 82 | /// Keypad number 6 key 83 | KEY_PAD_6 = 43, 84 | 85 | /// Keypad number 7 key 86 | KEY_PAD_7 = 44, 87 | 88 | /// Keypad number 8 key 89 | KEY_PAD_8 = 45, 90 | 91 | /// Keypad number 9 key 92 | KEY_PAD_9 = 46, 93 | 94 | /// Keypad division/slash key (/) 95 | KEY_PAD_DIVIDE = 47, 96 | 97 | /// Keypad asterisk key (*) 98 | KEY_PAD_MULTIPLY = 48, 99 | 100 | /// Keypad minus key 101 | KEY_PAD_MINUS = 49, 102 | 103 | /// Keypad plus key 104 | KEY_PAD_PLUS = 50, 105 | 106 | /// Keypad enter key 107 | KEY_PAD_ENTER = 51, 108 | 109 | /// Keypad dot key (.) 110 | KEY_PAD_DECIMAL = 52, 111 | KEY_LBRACKET = 53, 112 | KEY_RBRACKET = 54, 113 | KEY_SEMICOLON = 55, 114 | KEY_APOSTROPHE = 56, 115 | KEY_BACKQUOTE = 57, 116 | KEY_COMMA = 58, 117 | KEY_PERIOD = 59, 118 | KEY_SLASH = 60, 119 | KEY_BACKSLASH = 61, 120 | KEY_MINUS = 62, 121 | KEY_EQUAL = 63, 122 | KEY_ENTER = 64, 123 | KEY_SPACE = 65, 124 | KEY_BACKSPACE = 66, 125 | KEY_TAB = 67, 126 | KEY_CAPSLOCK = 68, 127 | KEY_NUMLOCK = 69, 128 | KEY_ESCAPE = 70, 129 | KEY_SCROLLLOCK = 71, 130 | KEY_INSERT = 72, 131 | KEY_DELETE = 73, 132 | KEY_HOME = 74, 133 | KEY_END = 75, 134 | KEY_PAGEUP = 76, 135 | KEY_PAGEDOWN = 77, 136 | KEY_BREAK = 78, 137 | KEY_LSHIFT = 79, 138 | KEY_RSHIFT = 80, 139 | KEY_LALT = 81, 140 | KEY_RALT = 82, 141 | KEY_LCONTROL = 83, 142 | KEY_RCONTROL = 84, 143 | 144 | /// The left Windows key or the Command key on Mac OSX 145 | KEY_LWIN = 85, 146 | 147 | /// The right Windows key or the Command key on Mac OSX 148 | KEY_RWIN = 86, 149 | KEY_APP = 87, 150 | KEY_UP = 88, 151 | KEY_LEFT = 89, 152 | KEY_DOWN = 90, 153 | KEY_RIGHT = 91, 154 | KEY_F1 = 92, 155 | KEY_F2 = 93, 156 | KEY_F3 = 94, 157 | KEY_F4 = 95, 158 | KEY_F5 = 96, 159 | KEY_F6 = 97, 160 | KEY_F7 = 98, 161 | KEY_F8 = 99, 162 | KEY_F9 = 100, 163 | KEY_F10 = 101, 164 | KEY_F11 = 102, 165 | KEY_F12 = 103, 166 | KEY_CAPSLOCKTOGGLE = 104, 167 | KEY_NUMLOCKTOGGLE = 105, 168 | KEY_LAST = 106, 169 | KEY_SCROLLLOCKTOGGLE = 106, 170 | KEY_COUNT = 107, 171 | KEY_XBUTTON_A = 114, 172 | KEY_XBUTTON_B = 115, 173 | KEY_XBUTTON_X = 116, 174 | KEY_XBUTTON_Y = 117, 175 | KEY_XBUTTON_LEFT_SHOULDER = 118, 176 | KEY_XBUTTON_RIGHT_SHOULDER = 119, 177 | KEY_XBUTTON_BACK = 120, 178 | KEY_XBUTTON_START = 121, 179 | KEY_XBUTTON_STICK1 = 122, 180 | KEY_XBUTTON_STICK2 = 123, 181 | KEY_XBUTTON_UP = 146, 182 | KEY_XBUTTON_RIGHT = 147, 183 | KEY_XBUTTON_DOWN = 148, 184 | KEY_XBUTTON_LEFT = 149, 185 | KEY_XSTICK1_RIGHT = 150, 186 | KEY_XSTICK1_LEFT = 151, 187 | KEY_XSTICK1_DOWN = 152, 188 | KEY_XSTICK1_UP = 153, 189 | KEY_XBUTTON_LTRIGGER = 154, 190 | KEY_XBUTTON_RTRIGGER = 155, 191 | KEY_XSTICK2_RIGHT = 156, 192 | KEY_XSTICK2_LEFT = 157, 193 | KEY_XSTICK2_DOWN = 158, 194 | KEY_XSTICK2_UP = 159 195 | } 196 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/LAST.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum LAST 4 | { 5 | LAST_VISIBLE_CONTENTS = 128, 6 | LAST_SHARED_ACTIVITY = 1860, 7 | LAST_SHARED_COLLISION_GROUP = 21, 8 | 9 | /// Serverside only 10 | LAST_SHARED_SCHEDULE = 88 11 | } 12 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/MASK.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum MASK : long 4 | { 5 | /// Anything that is not empty space 6 | MASK_ALL = 4294967295, 7 | 8 | /// Anything that blocks line of sight for AI 9 | MASK_BLOCKLOS = 16449, 10 | 11 | /// Anything that blocks line of sight for AI or NPCs 12 | MASK_BLOCKLOS_AND_NPCS = 33570881, 13 | 14 | /// Water that is moving (may not work) 15 | MASK_CURRENT = 16515072, 16 | 17 | /// Anything that blocks corpse movement 18 | MASK_DEADSOLID = 65547, 19 | 20 | /// Anything that blocks NPC movement 21 | MASK_NPCSOLID = 33701899, 22 | 23 | /// Anything that blocks NPC movement, except other NPCs 24 | MASK_NPCSOLID_BRUSHONLY = 147467, 25 | 26 | /// The world entity 27 | MASK_NPCWORLDSTATIC = 131083, 28 | 29 | /// Anything that blocks lighting 30 | MASK_OPAQUE = 16513, 31 | 32 | /// Anything that blocks lighting, including NPCs 33 | MASK_OPAQUE_AND_NPCS = 33570945, 34 | 35 | /// Anything that blocks player movement 36 | MASK_PLAYERSOLID = 33636363, 37 | 38 | /// World + Brushes + Player Clips 39 | MASK_PLAYERSOLID_BRUSHONLY = 81931, 40 | 41 | /// Anything that stops a bullet (including hitboxes) 42 | MASK_SHOT = 1174421507, 43 | 44 | /// Anything that stops a bullet (excluding hitboxes) 45 | MASK_SHOT_HULL = 100679691, 46 | 47 | /// Solids except for grates 48 | MASK_SHOT_PORTAL = 33570819, 49 | 50 | /// Anything that is (normally) solid 51 | MASK_SOLID = 33570827, 52 | 53 | /// World + Brushes 54 | MASK_SOLID_BRUSHONLY = 16395, 55 | 56 | /// Things that split area portals 57 | MASK_SPLITAREAPORTAL = 48, 58 | 59 | /// Anything that blocks line of sight for players 60 | MASK_VISIBLE = 24705, 61 | 62 | /// Anything that blocks line of sight for players, including NPCs 63 | MASK_VISIBLE_AND_NPCS = 33579137, 64 | 65 | /// Anything that has water-like physics 66 | MASK_WATER = 16432 67 | } 68 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/MAT.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum MAT 4 | { 5 | /// Alien flesh ( Headcrabs, Vortigaunts ) 6 | MAT_ALIENFLESH = 72, 7 | 8 | /// Antlions 9 | MAT_ANTLION = 65, 10 | MAT_BLOODYFLESH = 66, 11 | MAT_CLIP = 73, 12 | MAT_COMPUTER = 80, 13 | 14 | /// Concrete 15 | MAT_CONCRETE = 67, 16 | 17 | /// Dirt 18 | MAT_DIRT = 68, 19 | MAT_EGGSHELL = 69, 20 | 21 | /// Flesh 22 | MAT_FLESH = 70, 23 | MAT_FOLIAGE = 79, 24 | 25 | /// Glass 26 | MAT_GLASS = 89, 27 | MAT_GRATE = 71, 28 | 29 | /// Snow 30 | MAT_SNOW = 74, 31 | 32 | /// Metal 33 | MAT_METAL = 77, 34 | 35 | /// Plastic 36 | MAT_PLASTIC = 76, 37 | 38 | /// Sand 39 | MAT_SAND = 78, 40 | MAT_SLOSH = 83, 41 | MAT_TILE = 84, 42 | 43 | /// Grass 44 | MAT_GRASS = 85, 45 | MAT_VENT = 86, 46 | 47 | /// Wood 48 | MAT_WOOD = 87, 49 | 50 | /// Skybox or nodraw texture 51 | MAT_DEFAULT = 88, 52 | MAT_WARPSHIELD = 90 53 | } 54 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/MATERIAL.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum MATERIAL 4 | { 5 | MATERIAL_LINES = 1, 6 | MATERIAL_LINE_LOOP = 5, 7 | MATERIAL_LINE_STRIP = 4, 8 | MATERIAL_POINTS = 0, 9 | MATERIAL_POLYGON = 6, 10 | MATERIAL_QUADS = 7, 11 | MATERIAL_TRIANGLES = 2, 12 | MATERIAL_TRIANGLE_STRIP = 3 13 | } 14 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/MATERIAL_CULLMODE.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum MATERIAL_CULLMODE 4 | { 5 | /// Counter clock wise cull mode 6 | MATERIAL_CULLMODE_CCW = 0, 7 | 8 | /// Clock wise cull mode 9 | MATERIAL_CULLMODE_CW = 1 10 | } 11 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/MATERIAL_FOG.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum MATERIAL_FOG 4 | { 5 | /// No fog 6 | MATERIAL_FOG_NONE = 0, 7 | 8 | /// Linear fog 9 | MATERIAL_FOG_LINEAR = 1, 10 | 11 | /// 12 | /// For use in conjunction with render.SetFogZ. Does not work if start distance is bigger than end distance. 13 | /// Ignores density setting. Seems to be broken? Used for underwater fog by the engine. 14 | /// 15 | MATERIAL_FOG_LINEAR_BELOW_FOG_Z = 2 16 | } 17 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/MATERIAL_LIGHT.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum MATERIAL_LIGHT 4 | { 5 | /// No light 6 | MATERIAL_LIGHT_DISABLE = 0, 7 | 8 | /// Point light 9 | MATERIAL_LIGHT_POINT = 1, 10 | 11 | /// Directional light 12 | MATERIAL_LIGHT_DIRECTIONAL = 2, 13 | 14 | /// Spot light 15 | MATERIAL_LIGHT_SPOT = 3 16 | } 17 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/MATERIAL_RT_DEPTH.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum MATERIAL_RT_DEPTH 4 | { 5 | MATERIAL_RT_DEPTH_SHARED = 0, 6 | MATERIAL_RT_DEPTH_SEPARATE = 1, 7 | MATERIAL_RT_DEPTH_NONE = 2, 8 | MATERIAL_RT_DEPTH_ONLY = 3 9 | } 10 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/MOUSE.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum MOUSE 4 | { 5 | /// Left mouse button 6 | MOUSE_LEFT = 107, 7 | 8 | /// Right mouse button 9 | MOUSE_RIGHT = 108, 10 | 11 | /// Middle mouse button, aka the wheel press 12 | MOUSE_MIDDLE = 109, 13 | 14 | /// Mouse 4 button ( Sometimes, mouse wheel tilt left ) 15 | MOUSE_4 = 110, 16 | 17 | /// Mouse 5 button ( Sometimes, mouse wheel tilt right ) 18 | MOUSE_5 = 111, 19 | 20 | /// Mouse wheel scroll up 21 | MOUSE_WHEEL_UP = 112, 22 | 23 | /// Mouse wheel scroll down 24 | MOUSE_WHEEL_DOWN = 113, 25 | 26 | /// Mouse button count 27 | MOUSE_COUNT = 7, 28 | 29 | /// First mouse button 30 | MOUSE_FIRST = 107, 31 | 32 | /// Last mouse button 33 | MOUSE_LAST = 113 34 | } 35 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/MOVECOLLIDE.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum MOVECOLLIDE 4 | { 5 | /// Default behaviour 6 | MOVECOLLIDE_DEFAULT = 0, 7 | 8 | /// Entity will bouce 9 | MOVECOLLIDE_FLY_BOUNCE = 1, 10 | MOVECOLLIDE_FLY_CUSTOM = 2, 11 | 12 | /// Entity will slide 13 | MOVECOLLIDE_FLY_SLIDE = 3, 14 | MOVECOLLIDE_COUNT = 4 15 | } 16 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/MOVETYPE.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum MOVETYPE 4 | { 5 | /// Don't move 6 | MOVETYPE_NONE = 0, 7 | 8 | /// For players, in TF2 commander view, etc 9 | MOVETYPE_ISOMETRIC = 1, 10 | 11 | /// Player only, moving on the ground 12 | MOVETYPE_WALK = 2, 13 | 14 | /// Monster/NPC movement 15 | MOVETYPE_STEP = 3, 16 | 17 | /// Fly, no gravity 18 | MOVETYPE_FLY = 4, 19 | 20 | /// Fly, with gravity 21 | MOVETYPE_FLYGRAVITY = 5, 22 | 23 | /// Physics movetype 24 | MOVETYPE_VPHYSICS = 6, 25 | 26 | /// No clip to world, but pushes and crushes things 27 | MOVETYPE_PUSH = 7, 28 | 29 | /// Noclip 30 | MOVETYPE_NOCLIP = 8, 31 | 32 | /// For players, when moving on a ladder 33 | MOVETYPE_LADDER = 9, 34 | 35 | /// Spectator movetype. DO NOT use this to make player spectate 36 | MOVETYPE_OBSERVER = 10, 37 | 38 | /// 39 | /// Custom movetype, can be applied to the player to prevent the default movement code from running, while still 40 | /// calling the related hooks 41 | /// 42 | MOVETYPE_CUSTOM = 11 43 | } 44 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/NOTIFY.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum NOTIFY 4 | { 5 | /// Generic notification ( Lamp icon ) 6 | NOTIFY_GENERIC = 0, 7 | 8 | /// Error notification ( Red cross icon ) 9 | NOTIFY_ERROR = 1, 10 | 11 | /// Undo notification ( Two blue arrows icon ) 12 | NOTIFY_UNDO = 2, 13 | 14 | /// Hint notification ( Blue "?" icon ) 15 | NOTIFY_HINT = 3, 16 | 17 | /// Cleanup notification ( Scissors icon ) 18 | NOTIFY_CLEANUP = 4 19 | } 20 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/NPC.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum NPC 4 | { 5 | /// Invalid state 6 | NPC_STATE_INVALID = -1, 7 | 8 | /// NPC default state 9 | NPC_STATE_NONE = 0, 10 | 11 | /// NPC is idle 12 | NPC_STATE_IDLE = 1, 13 | 14 | /// NPC is alert and searching for enemies 15 | NPC_STATE_ALERT = 2, 16 | 17 | /// NPC is in combat 18 | NPC_STATE_COMBAT = 3, 19 | 20 | /// NPC is executing scripted sequence 21 | NPC_STATE_SCRIPT = 4, 22 | 23 | /// NPC is playing dead (used for expressions) 24 | NPC_STATE_PLAYDEAD = 5, 25 | 26 | /// NPC is prone to death 27 | NPC_STATE_PRONE = 6, 28 | 29 | /// NPC is dead 30 | NPC_STATE_DEAD = 7 31 | } 32 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/NUM.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum NUM 4 | { 5 | /// Seems to return amount of CLASS_ Enums, serverside only 6 | NUM_AI_CLASSES = 26, 7 | 8 | /// Seems to return amount of HULL_ Enums, serverside only 9 | NUM_HULLS = 10, 10 | NUM_BEAMS = 4, 11 | NUM_SPRITES = 6 12 | } 13 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/OBS_MODE.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum OBS_MODE 4 | { 5 | /// Not spectating 6 | OBS_MODE_NONE = 0, 7 | OBS_MODE_DEATHCAM = 1, 8 | 9 | /// TF2-like freezecam 10 | OBS_MODE_FREEZECAM = 2, 11 | 12 | /// Same as OBS_MODE_CHASE, but you can't rotate the view 13 | OBS_MODE_FIXED = 3, 14 | 15 | /// First person cam 16 | OBS_MODE_IN_EYE = 4, 17 | 18 | /// Chase cam, 3rd person cam, free rotation around the spectated target 19 | OBS_MODE_CHASE = 5, 20 | 21 | /// Free roam/noclip-alike 22 | OBS_MODE_ROAMING = 6 23 | } 24 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/PATTACH.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum PATTACH 4 | { 5 | /// Particle spawns in entity 6 | PATTACH_ABSORIGIN = 0, 7 | 8 | /// Particle attaches to entitys origin and follows the entity 9 | PATTACH_ABSORIGIN_FOLLOW = 1, 10 | PATTACH_CUSTOMORIGIN = 2, 11 | 12 | /// Particle attaches to passed to ParticleEffectAttach attachment id 13 | PATTACH_POINT = 3, 14 | 15 | /// Particle attaches to passed to ParticleEffectAttach attachment id and follows the entity 16 | PATTACH_POINT_FOLLOW = 4, 17 | 18 | /// Particle spawns in the beginning of coordinates, Vector( 0, 0, 0 ). 19 | PATTACH_WORLDORIGIN = 5 20 | } 21 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/PLAYER.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum PLAYER 4 | { 5 | PLAYER_IDLE = 0, 6 | PLAYER_WALK = 1, 7 | PLAYER_JUMP = 2, 8 | PLAYER_SUPERJUMP = 3, 9 | PLAYER_DIE = 4, 10 | 11 | /// Player attack according to current hold type, used in SWEPs 12 | PLAYER_ATTACK1 = 5, 13 | PLAYER_IN_VEHICLE = 6, 14 | PLAYER_RELOAD = 7, 15 | PLAYER_START_AIMING = 8, 16 | PLAYER_LEAVE_AIMING = 9 17 | } 18 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/PLAYERANIMEVENT.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum PLAYERANIMEVENT 4 | { 5 | PLAYERANIMEVENT_ATTACK_GRENADE = 2, 6 | 7 | /// Primary attack 8 | PLAYERANIMEVENT_ATTACK_PRIMARY = 0, 9 | 10 | /// Secondary attack 11 | PLAYERANIMEVENT_ATTACK_SECONDARY = 1, 12 | PLAYERANIMEVENT_CANCEL = 16, 13 | 14 | /// Used to play specific activities 15 | PLAYERANIMEVENT_CUSTOM = 19, 16 | PLAYERANIMEVENT_CUSTOM_GESTURE = 20, 17 | PLAYERANIMEVENT_CUSTOM_GESTURE_SEQUENCE = 22, 18 | 19 | /// Used to play specific sequences 20 | PLAYERANIMEVENT_CUSTOM_SEQUENCE = 21, 21 | PLAYERANIMEVENT_DIE = 8, 22 | PLAYERANIMEVENT_DOUBLEJUMP = 15, 23 | PLAYERANIMEVENT_FLINCH_CHEST = 9, 24 | PLAYERANIMEVENT_FLINCH_HEAD = 10, 25 | PLAYERANIMEVENT_FLINCH_LEFTARM = 11, 26 | PLAYERANIMEVENT_FLINCH_LEFTLEG = 13, 27 | PLAYERANIMEVENT_FLINCH_RIGHTARM = 12, 28 | PLAYERANIMEVENT_FLINCH_RIGHTLEG = 14, 29 | 30 | /// Jump 31 | PLAYERANIMEVENT_JUMP = 6, 32 | 33 | /// Reload 34 | PLAYERANIMEVENT_RELOAD = 3, 35 | PLAYERANIMEVENT_RELOAD_END = 5, 36 | PLAYERANIMEVENT_RELOAD_LOOP = 4, 37 | 38 | /// Snap to current yaw exactly 39 | PLAYERANIMEVENT_SNAP_YAW = 18, 40 | PLAYERANIMEVENT_SPAWN = 17, 41 | PLAYERANIMEVENT_SWIM = 7 42 | } 43 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/RENDERGROUP.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum RENDERGROUP 4 | { 5 | /// For both translucent/transparent and opaque/solid entities 6 | RENDERGROUP_BOTH = 9, 7 | 8 | /// For non transparent/solid entities 9 | RENDERGROUP_OPAQUE = 7, 10 | RENDERGROUP_OPAQUE_BRUSH = 12, 11 | RENDERGROUP_OPAQUE_HUGE = 1, 12 | RENDERGROUP_OTHER = 13, 13 | RENDERGROUP_STATIC = 6, 14 | RENDERGROUP_STATIC_HUGE = 0, 15 | 16 | /// For translucent/transparent entities. 17 | RENDERGROUP_TRANSLUCENT = 8, 18 | RENDERGROUP_VIEWMODEL = 10, 19 | RENDERGROUP_VIEWMODEL_TRANSLUCENT = 11 20 | } 21 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/RENDERMODE.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum RENDERMODE 4 | { 5 | /// Normal render mode 6 | RENDERMODE_NORMAL = 0, 7 | RENDERMODE_TRANSCOLOR = 1, 8 | RENDERMODE_TRANSTEXTURE = 2, 9 | RENDERMODE_GLOW = 3, 10 | 11 | /// 12 | /// Use this to make alpha of Color work for your entity. For players, it must be set for their active weapon 13 | /// aswell. 14 | /// 15 | RENDERMODE_TRANSALPHA = 4, 16 | RENDERMODE_TRANSADD = 5, 17 | RENDERMODE_ENVIROMENTAL = 6, 18 | RENDERMODE_TRANSADDFRAMEBLEND = 7, 19 | RENDERMODE_TRANSALPHADD = 8, 20 | RENDERMODE_WORLDGLOW = 9, 21 | RENDERMODE_NONE = 10 22 | } 23 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/RT_SIZE.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum RT_SIZE 4 | { 5 | RT_SIZE_NO_CHANGE = 0, 6 | RT_SIZE_DEFAULT = 1, 7 | RT_SIZE_PICMIP = 2, 8 | RT_SIZE_HDR = 3, 9 | RT_SIZE_FULL_FRAME_BUFFER = 4, 10 | RT_SIZE_OFFSCREEN = 5, 11 | RT_SIZE_FULL_FRAME_BUFFER_ROUNDED_UP = 6 12 | } 13 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/SCHED.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum SCHED 4 | { 5 | /// The schedule enum limit 6 | LAST_SHARED_SCHEDULE = 88, 7 | 8 | /// Begins AI script based on NPC's m_hCine save value. 9 | SCHED_AISCRIPT = 56, 10 | 11 | /// Idle stance and face ideal yaw angles. 12 | SCHED_ALERT_FACE = 5, 13 | SCHED_ALERT_FACE_BESTSOUND = 6, 14 | SCHED_ALERT_REACT_TO_COMBAT_SOUND = 7, 15 | 16 | /// Rotate 180 degrees and back to check for enemies. 17 | SCHED_ALERT_SCAN = 8, 18 | 19 | /// Remain idle until an enemy is heard or found. 20 | SCHED_ALERT_STAND = 9, 21 | 22 | /// Walk until an enemy is heard or found. 23 | SCHED_ALERT_WALK = 10, 24 | 25 | /// Remain idle until provoked or an enemy is found. 26 | SCHED_AMBUSH = 52, 27 | 28 | /// Performs ACT_ARM. 29 | SCHED_ARM_WEAPON = 48, 30 | 31 | /// Back away from enemy. If not possible to back away then go behind enemy. 32 | SCHED_BACK_AWAY_FROM_ENEMY = 24, 33 | SCHED_BACK_AWAY_FROM_SAVE_POSITION = 26, 34 | 35 | /// Heavy damage was taken for the first time in a while. 36 | SCHED_BIG_FLINCH = 23, 37 | 38 | /// Begin chasing an enemy. 39 | SCHED_CHASE_ENEMY = 17, 40 | SCHED_CHASE_ENEMY_FAILED = 18, 41 | SCHED_COMBAT_FACE = 12, 42 | SCHED_COMBAT_PATROL = 75, 43 | SCHED_COMBAT_STAND = 15, 44 | SCHED_COMBAT_SWEEP = 13, 45 | SCHED_COMBAT_WALK = 16, 46 | 47 | /// When not moving, will perform ACT_COWER. 48 | SCHED_COWER = 40, 49 | 50 | /// Regular NPC death. 51 | SCHED_DIE = 53, 52 | 53 | /// Plays NPC death sound (doesn't kill NPC). 54 | SCHED_DIE_RAGDOLL = 54, 55 | SCHED_DISARM_WEAPON = 49, 56 | SCHED_DROPSHIP_DUSTOFF = 79, 57 | SCHED_DUCK_DODGE = 84, 58 | SCHED_ESTABLISH_LINE_OF_FIRE = 35, 59 | SCHED_ESTABLISH_LINE_OF_FIRE_FALLBACK = 36, 60 | SCHED_FAIL = 81, 61 | SCHED_FAIL_ESTABLISH_LINE_OF_FIRE = 38, 62 | SCHED_FAIL_NOSTOP = 82, 63 | SCHED_FAIL_TAKE_COVER = 31, 64 | SCHED_FALL_TO_GROUND = 78, 65 | SCHED_FEAR_FACE = 14, 66 | SCHED_FLEE_FROM_BEST_SOUND = 29, 67 | 68 | /// Plays ACT_FLINCH_PHYSICS. 69 | SCHED_FLINCH_PHYSICS = 80, 70 | 71 | /// Force walk to position (debug). 72 | SCHED_FORCED_GO = 71, 73 | 74 | /// Force run to position (debug). 75 | SCHED_FORCED_GO_RUN = 72, 76 | 77 | /// Pick up item if within a radius of 5 units. 78 | SCHED_GET_HEALTHKIT = 66, 79 | SCHED_HIDE_AND_RELOAD = 50, 80 | 81 | /// Idle stance 82 | SCHED_IDLE_STAND = 1, 83 | 84 | /// Walk to position. 85 | SCHED_IDLE_WALK = 2, 86 | 87 | /// Walk to random position within a radius of 200 units. 88 | SCHED_IDLE_WANDER = 3, 89 | SCHED_INTERACTION_MOVE_TO_PARTNER = 85, 90 | SCHED_INTERACTION_WAIT_FOR_PARTNER = 86, 91 | SCHED_INVESTIGATE_SOUND = 11, 92 | SCHED_MELEE_ATTACK1 = 41, 93 | SCHED_MELEE_ATTACK2 = 42, 94 | 95 | /// Move away from player. 96 | SCHED_MOVE_AWAY = 68, 97 | 98 | /// Stop moving and continue enemy scan. 99 | SCHED_MOVE_AWAY_END = 70, 100 | 101 | /// Failed to move away; stop moving. 102 | SCHED_MOVE_AWAY_FAIL = 69, 103 | 104 | /// Move away from enemy while facing it and checking for new enemies. 105 | SCHED_MOVE_AWAY_FROM_ENEMY = 25, 106 | SCHED_MOVE_TO_WEAPON_RANGE = 34, 107 | 108 | /// Pick up a new weapon if within a radius of 5 units. 109 | SCHED_NEW_WEAPON = 63, 110 | 111 | /// Fail safe: Create the weapon that the NPC went to pick up if it was removed during pick up schedule. 112 | SCHED_NEW_WEAPON_CHEAT = 64, 113 | 114 | /// No schedule is being performed. 115 | SCHED_NONE = 0, 116 | 117 | /// Prevents movement until COND_NPC_UNFREEZE(68) is set. 118 | SCHED_NPC_FREEZE = 73, 119 | 120 | /// Run to random position and stop if enemy is heard or found. 121 | SCHED_PATROL_RUN = 76, 122 | 123 | /// Walk to random position and stop if enemy is heard or found. 124 | SCHED_PATROL_WALK = 74, 125 | SCHED_PRE_FAIL_ESTABLISH_LINE_OF_FIRE = 37, 126 | SCHED_RANGE_ATTACK1 = 43, 127 | SCHED_RANGE_ATTACK2 = 44, 128 | 129 | /// Stop moving and reload until danger is heard. 130 | SCHED_RELOAD = 51, 131 | SCHED_RUN_FROM_ENEMY = 32, 132 | SCHED_RUN_FROM_ENEMY_FALLBACK = 33, 133 | SCHED_RUN_FROM_ENEMY_MOB = 83, 134 | 135 | /// Run to random position within a radius of 500 units. 136 | SCHED_RUN_RANDOM = 77, 137 | SCHED_SCENE_GENERIC = 62, 138 | SCHED_SCRIPTED_CUSTOM_MOVE = 59, 139 | SCHED_SCRIPTED_FACE = 61, 140 | SCHED_SCRIPTED_RUN = 58, 141 | SCHED_SCRIPTED_WAIT = 60, 142 | SCHED_SCRIPTED_WALK = 57, 143 | SCHED_SHOOT_ENEMY_COVER = 39, 144 | SCHED_SLEEP = 87, 145 | SCHED_SMALL_FLINCH = 22, 146 | SCHED_SPECIAL_ATTACK1 = 45, 147 | SCHED_SPECIAL_ATTACK2 = 46, 148 | SCHED_STANDOFF = 47, 149 | SCHED_SWITCH_TO_PENDING_WEAPON = 65, 150 | SCHED_TAKE_COVER_FROM_BEST_SOUND = 28, 151 | SCHED_TAKE_COVER_FROM_ENEMY = 27, 152 | SCHED_TAKE_COVER_FROM_ORIGIN = 30, 153 | SCHED_TARGET_CHASE = 21, 154 | 155 | /// Face NPC target. 156 | SCHED_TARGET_FACE = 20, 157 | 158 | /// Human victory dance. 159 | SCHED_VICTORY_DANCE = 19, 160 | SCHED_WAIT_FOR_SCRIPT = 55, 161 | SCHED_WAIT_FOR_SPEAK_FINISH = 67, 162 | SCHED_WAKE_ANGRY = 4 163 | } 164 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/SCREENFADE.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum SCREENFADE 4 | { 5 | /// Fade out after the hold time has passed 6 | SCREENFADE_IN = 1, 7 | 8 | /// Fade in, hold time passes, disappear 9 | SCREENFADE_OUT = 2, 10 | 11 | /// With white color, turns the screen black 12 | SCREENFADE_MODULATE = 4, 13 | 14 | /// No effects, never disappear 15 | SCREENFADE_STAYOUT = 8, 16 | 17 | /// Appear, Disappear, no effects 18 | SCREENFADE_PURGE = 16 19 | } 20 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/SENSORBONE.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum SENSORBONE 4 | { 5 | SENSORBONE_SHOULDER_RIGHT = 8, 6 | SENSORBONE_SHOULDER_LEFT = 4, 7 | SENSORBONE_HIP = 0, 8 | SENSORBONE_ELBOW_RIGHT = 9, 9 | SENSORBONE_KNEE_RIGHT = 17, 10 | SENSORBONE_WRIST_RIGHT = 10, 11 | SENSORBONE_ANKLE_LEFT = 14, 12 | SENSORBONE_FOOT_LEFT = 15, 13 | SENSORBONE_WRIST_LEFT = 6, 14 | SENSORBONE_FOOT_RIGHT = 19, 15 | SENSORBONE_HAND_RIGHT = 11, 16 | SENSORBONE_SHOULDER = 2, 17 | SENSORBONE_HIP_LEFT = 12, 18 | SENSORBONE_HIP_RIGHT = 16, 19 | SENSORBONE_HAND_LEFT = 7, 20 | SENSORBONE_ANKLE_RIGHT = 18, 21 | SENSORBONE_SPINE = 1, 22 | SENSORBONE_ELBOW_LEFT = 5, 23 | SENSORBONE_KNEE_LEFT = 13, 24 | SENSORBONE_HEAD = 3 25 | } 26 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/SF.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum SF 4 | { 5 | /// Citizen that resupplies ammo 6 | SF_CITIZEN_AMMORESUPPLIER = 524288, 7 | SF_CITIZEN_FOLLOW = 65536, 8 | SF_CITIZEN_IGNORE_SEMAPHORE = 2097152, 9 | 10 | /// Makes the citizen a medic 11 | SF_CITIZEN_MEDIC = 131072, 12 | SF_CITIZEN_NOT_COMMANDABLE = 1048576, 13 | 14 | /// Gives the citizen a random head 15 | SF_CITIZEN_RANDOM_HEAD = 262144, 16 | 17 | /// Gives the citizen a random female head 18 | SF_CITIZEN_RANDOM_HEAD_FEMALE = 8388608, 19 | 20 | /// Gives the citizen a random male head 21 | SF_CITIZEN_RANDOM_HEAD_MALE = 4194304, 22 | SF_CITIZEN_USE_RENDER_BOUNDS = 16777216, 23 | 24 | /// Makes the floor turret friendly 25 | SF_FLOOR_TURRET_CITIZEN = 512, 26 | SF_NPC_ALTCOLLISION = 4096, 27 | SF_NPC_ALWAYSTHINK = 1024, 28 | 29 | /// NPC Drops health kit when it dies 30 | SF_NPC_DROP_HEALTHKIT = 8, 31 | SF_NPC_FADE_CORPSE = 512, 32 | SF_NPC_FALL_TO_GROUND = 4, 33 | SF_NPC_GAG = 2, 34 | SF_NPC_LONG_RANGE = 256, 35 | SF_NPC_NO_PLAYER_PUSHAWAY = 16384, 36 | 37 | /// NPC Doesn't drop weapon on death 38 | SF_NPC_NO_WEAPON_DROP = 8192, 39 | SF_NPC_START_EFFICIENT = 16, 40 | SF_NPC_TEMPLATE = 2048, 41 | SF_NPC_WAIT_FOR_SCRIPT = 128, 42 | SF_NPC_WAIT_TILL_SEEN = 1, 43 | SF_PHYSBOX_MOTIONDISABLED = 32768, 44 | SF_PHYSBOX_NEVER_PICK_UP = 2097152, 45 | SF_PHYSPROP_MOTIONDISABLED = 8, 46 | 47 | /// Prevent that physbox from being picked up 48 | SF_PHYSPROP_PREVENT_PICKUP = 512, 49 | 50 | /// Makes the rollermine friendly 51 | SF_ROLLERMINE_FRIENDLY = 65536 52 | } 53 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/SIM.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum SIM 4 | { 5 | /// Don't simulate physics 6 | SIM_NOTHING = 0, 7 | SIM_LOCAL_ACCELERATION = 1, 8 | SIM_LOCAL_FORCE = 2, 9 | SIM_GLOBAL_ACCELERATION = 3, 10 | SIM_GLOBAL_FORCE = 4 11 | } 12 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/SND.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum SND 4 | { 5 | /// To keep the compiler happy 6 | SND_NOFLAGS = 0, 7 | 8 | /// Change sound vol 9 | SND_CHANGE_VOL = 1, 10 | 11 | /// Change sound pitch 12 | SND_CHANGE_PITCH = 2, 13 | 14 | /// Stop the sound 15 | SND_STOP = 4, 16 | 17 | /// We're spawning, used in some cases for ambients. Not sent over net, only a param between dll and server. 18 | SND_SPAWNING = 8, 19 | 20 | /// Sound has an initial delay 21 | SND_DELAY = 16, 22 | 23 | /// Stop all looping sounds on the entity. 24 | SND_STOP_LOOPING = 32, 25 | 26 | /// This sound should be paused if the game is paused 27 | SND_SHOULDPAUSE = 128, 28 | SND_IGNORE_PHONEMES = 256, 29 | 30 | /// Used to change all sounds emitted by an entity, regardless of scriptname 31 | SND_IGNORE_NAME = 512, 32 | SND_DO_NOT_OVERWRITE_EXISTING_ON_CHANNEL = 1024 33 | } 34 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/SNDLVL.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum SNDLVL 4 | { 5 | /// Sound plays everywhere 6 | SNDLVL_NONE = 0, 7 | 8 | /// Rustling leaves 9 | SNDLVL_20dB = 20, 10 | 11 | /// Whispering 12 | SNDLVL_25dB = 25, 13 | 14 | /// Library 15 | SNDLVL_30dB = 30, 16 | SNDLVL_35dB = 35, 17 | SNDLVL_40dB = 40, 18 | 19 | /// Refrigerator 20 | SNDLVL_45dB = 45, 21 | 22 | /// Average home 23 | SNDLVL_50dB = 50, 24 | 25 | /// Stop the sound 26 | SNDLVL_55dB = 55, 27 | 28 | /// Normal conversation, clothes dryer 29 | SNDLVL_60dBSNDLVL_IDLE = 60, 30 | 31 | /// Washing machine, dishwasher 32 | SNDLVL_65dB = 65, 33 | SNDLVL_STATIC = 66, 34 | 35 | /// Car, vacuum cleaner, mixer, electric sewing machine 36 | SNDLVL_70dB = 70, 37 | 38 | /// Busy traffic 39 | SNDLVL_75dBSNDLVL_NORM = 75, 40 | 41 | /// Mini-bike, alarm clock, noisy restaurant, office tabulator, outboard motor, passing snowmobile 42 | SNDLVL_80dBSNDLVL_TALKING = 80, 43 | 44 | /// Average factory, electric shaver 45 | SNDLVL_85dB = 85, 46 | 47 | /// Screaming child, passing motorcycle, convertible ride on freeway 48 | SNDLVL_90dB = 90, 49 | SNDLVL_95dB = 95, 50 | 51 | /// Subway train, diesel truck, woodworking shop, pneumatic drill, boiler shop, jackhammer 52 | SNDLVL_100dB = 100, 53 | 54 | /// Helicopter, power mower 55 | SNDLVL_105dB = 105, 56 | 57 | /// Snowmobile (drivers seat), inboard motorboat, sandblasting 58 | SNDLVL_110dB = 110, 59 | 60 | /// Car horn, propeller aircraft 61 | SNDLVL_120dB = 120, 62 | 63 | /// Air raid siren 64 | SNDLVL_130dB = 130, 65 | 66 | /// Threshold of pain, gunshot, jet engine 67 | SNDLVL_140dBSNDLVL_GUNFIRE = 140, 68 | SNDLVL_150dB = 150, 69 | 70 | /// Rocket launching 71 | SNDLVL_180dB = 180 72 | } 73 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/SOLID.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum SOLID 4 | { 5 | /// Does not collide with anything 6 | SOLID_NONE = 0, 7 | SOLID_BSP = 1, 8 | 9 | /// Uses the entity's axis-aligned bounding box for collisions 10 | SOLID_BBOX = 2, 11 | 12 | /// Uses the entity's object-aligned bounding box for collisions 13 | SOLID_OBB = 3, 14 | 15 | /// Same as SOLID_OBB but restricts orientation to the Z-axisNote: Seems to be broken. 16 | SOLID_OBB_YAW = 4, 17 | SOLID_CUSTOM = 5, 18 | 19 | /// Uses the collision mesh of the entities model 20 | SOLID_VPHYSICS = 6 21 | } 22 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/STENCIL.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum STENCIL 4 | { 5 | /// Never passes. 6 | STENCIL_NEVER = 1, 7 | 8 | /// Passes when the existing value in the stencil buffer is lower than the reference value. 9 | STENCIL_LESS = 2, 10 | 11 | /// Passes when the existing value in the stencil buffer is equal to the reference value. 12 | STENCIL_EQUAL = 3, 13 | 14 | /// Passes when the existing value in the stencil buffer is lower or equal than the reference value. 15 | STENCIL_LESSEQUAL = 4, 16 | 17 | /// Passes when the existing value in the stencil buffer is higher than the reference value. 18 | STENCIL_GREATER = 5, 19 | 20 | /// Passes when the existing value in the stencil buffer is not equal to the reference value. 21 | STENCIL_NOTEQUAL = 6, 22 | 23 | /// Passes when the existing value in the stencil buffer is higher or equal to the reference value. 24 | STENCIL_GREATEREQUAL = 7, 25 | 26 | /// Always passes. 27 | STENCIL_ALWAYS = 8, 28 | 29 | /// Preserves the existing stencil buffer value. 30 | STENCIL_KEEP = 1, 31 | 32 | /// Sets the value in the stencil buffer to 0. 33 | STENCIL_ZERO = 2, 34 | 35 | /// Sets the value in the stencil buffer to the reference value, set using render.SetStencilReferenceValue. 36 | STENCIL_REPLACE = 3, 37 | 38 | /// Increments the value in the stencil buffer by 1, clamping the result. 39 | STENCIL_INCRSAT = 4, 40 | 41 | /// Decrements the value in the stencil buffer by 1, clamping the result. 42 | STENCIL_DECRSAT = 5, 43 | 44 | /// Inverts the value in the stencil buffer. 45 | STENCIL_INVERT = 6, 46 | 47 | /// Increments the value in the stencil buffer by 1, wrapping around on overflow. 48 | STENCIL_INCR = 7, 49 | 50 | /// Decrements the value in the stencil buffer by 1, wrapping around on overflow. 51 | STENCIL_DECR = 8 52 | } 53 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/STEPSOUNDTIME.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum STEPSOUNDTIME 4 | { 5 | /// Normal step 6 | STEPSOUNDTIME_NORMAL = 0, 7 | 8 | /// Step on ladder 9 | STEPSOUNDTIME_ON_LADDER = 1, 10 | 11 | /// Step in water, with water reaching knee 12 | STEPSOUNDTIME_WATER_KNEE = 2, 13 | 14 | /// Step in water, with water reaching foot 15 | STEPSOUNDTIME_WATER_FOOT = 3 16 | } 17 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/STUDIO.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum STUDIO : long 4 | { 5 | STUDIO_DRAWTRANSLUCENTSUBMODELS = 4, 6 | STUDIO_GENERATE_STATS = 16777216, 7 | STUDIO_ITEM_BLINK = 64, 8 | STUDIO_NOSHADOWS = 128, 9 | STUDIO_RENDER = 1, 10 | STUDIO_SHADOWDEPTHTEXTURE = 1073741824, 11 | STUDIO_SSAODEPTHTEXTURE = 134217728, 12 | STUDIO_STATIC_LIGHTING = 16, 13 | STUDIO_TRANSPARENCY = 2147483648, 14 | STUDIO_TWOPASS = 8, 15 | STUDIO_VIEWXFORMATTACHMENTS = 2, 16 | STUDIO_WIREFRAME = 32, 17 | STUDIO_WIREFRAME_VCOLLIDE = 256 18 | } 19 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/SURF.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum SURF 4 | { 5 | SURF_BUMPLIGHT = 2048, 6 | SURF_HINT = 256, 7 | 8 | /// This surface is part of an entity's hitbox 9 | SURF_HITBOX = 32768, 10 | SURF_LIGHT = 1, 11 | SURF_NOCHOP = 16384, 12 | 13 | /// No decals are applied to this surface 14 | SURF_NODECALS = 8192, 15 | 16 | /// This surface is an invisible entity, equivalent to HitNoDraw in TraceResult structure 17 | SURF_NODRAW = 128, 18 | 19 | /// This surface has no lights calculated 20 | SURF_NOLIGHT = 1024, 21 | 22 | /// This surface cannot have portals placed on, used by Portal's gun 23 | SURF_NOPORTAL = 32, 24 | 25 | /// No shadows are cast on this surface 26 | SURF_NOSHADOWS = 4096, 27 | 28 | /// This surface can be ignored by impact effects 29 | SURF_SKIP = 512, 30 | 31 | /// This surface is a skybox, equivalent to HitSky in TraceResult structure 32 | SURF_SKY = 4, 33 | 34 | /// This surface is translucent 35 | SURF_TRANS = 16, 36 | 37 | /// This surface is a trigger, seems unused 38 | SURF_TRIGGER = 64, 39 | 40 | /// This surface is animated water 41 | SURF_WARP = 8 42 | } 43 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/TEAM.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum TEAM 4 | { 5 | /// Connecting team ID, set when player connects to the server 6 | TEAM_CONNECTING = 0, 7 | 8 | /// Spectator team ID 9 | TEAM_SPECTATOR = 1002, 10 | 11 | /// Unassigned team ID, set right after player connected 12 | TEAM_UNASSIGNED = 1001 13 | } 14 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/TEXFILTER.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum TEXFILTER 4 | { 5 | TEXFILTER_NONE = 0, 6 | TEXFILTER_LINEAR = 2, 7 | TEXFILTER_POINT = 3, 8 | TEXFILTER_ANISOTROPIC = 4 9 | } 10 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/TEXT.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum TEXT 4 | { 5 | /// Align the text on the left 6 | TEXT_ALIGN_LEFT = 0, 7 | 8 | /// Align the text in center 9 | TEXT_ALIGN_CENTER = 1, 10 | 11 | /// Align the text on the right 12 | TEXT_ALIGN_RIGHT = 2, 13 | 14 | /// Align the text on the top 15 | TEXT_ALIGN_TOP = 4, 16 | 17 | /// Align the text on the bottom 18 | TEXT_ALIGN_BOTTOM = 5 19 | } 20 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/TRACER.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum TRACER 4 | { 5 | /// Generates no tracer effects 6 | TRACER_NONE = 0, 7 | 8 | /// Generates tracer effects 9 | TRACER_LINE = 1, 10 | TRACER_RAIL = 2, 11 | TRACER_BEAM = 3, 12 | 13 | /// Generates tracer and makes whizzing noises if the bullet flies past the player being shot at 14 | TRACER_LINE_AND_WHIZ = 4 15 | } 16 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/TRANSMIT.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum TRANSMIT 4 | { 5 | /// Never transmit the entity, default for point entities 6 | TRANSMIT_NEVER = 1, 7 | 8 | /// Transmit when entity is in players view 9 | TRANSMIT_PVS = 2, 10 | 11 | /// Always transmit the entity 12 | TRANSMIT_ALWAYS = 3 13 | } 14 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/TYPE.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum TYPE 4 | { 5 | /// Angle 6 | TYPE_ANGLE = 11, 7 | 8 | /// boolean 9 | TYPE_BOOL = 1, 10 | 11 | /// Metatable of a Color structure 12 | TYPE_COLOR = 255, 13 | 14 | /// ConVar 15 | TYPE_CONVAR = 27, 16 | 17 | /// Amount of TYPE_* enums 18 | TYPE_COUNT = 40, 19 | 20 | /// CTakeDamageInfo 21 | TYPE_DAMAGEINFO = 15, 22 | 23 | /// Metatable of a DynamicLight structure 24 | TYPE_DLIGHT = 32, 25 | 26 | /// CEffectData 27 | TYPE_EFFECTDATA = 16, 28 | 29 | /// Entity 30 | TYPE_ENTITY = 9, 31 | 32 | /// File 33 | TYPE_FILE = 34, 34 | 35 | /// function 36 | TYPE_FUNCTION = 6, 37 | 38 | /// IMesh 39 | TYPE_IMESH = 28, 40 | 41 | /// Invalid type 42 | TYPE_INVALID = -1, 43 | TYPE_LIGHTUSERDATA = 2, 44 | 45 | /// CLuaLocomotion 46 | TYPE_LOCOMOTION = 35, 47 | 48 | /// IMaterial 49 | TYPE_MATERIAL = 21, 50 | 51 | /// VMatrix 52 | TYPE_MATRIX = 29, 53 | 54 | /// CMoveData 55 | TYPE_MOVEDATA = 17, 56 | 57 | /// CNavArea 58 | TYPE_NAVAREA = 37, 59 | 60 | /// CNavLadder 61 | TYPE_NAVLADDER = 39, 62 | TYPE_NIL = 0, 63 | 64 | /// number 65 | TYPE_NUMBER = 3, 66 | 67 | /// Panel 68 | TYPE_PANEL = 22, 69 | 70 | /// CLuaParticle 71 | TYPE_PARTICLE = 23, 72 | 73 | /// CLuaEmitter 74 | TYPE_PARTICLEEMITTER = 24, 75 | 76 | /// PathFollower 77 | TYPE_PATH = 36, 78 | 79 | /// PhysObj 80 | TYPE_PHYSOBJ = 12, 81 | 82 | /// pixelvis_handle_t 83 | TYPE_PIXELVISHANDLE = 31, 84 | 85 | /// CRecipientFilter 86 | TYPE_RECIPIENTFILTER = 18, 87 | 88 | /// IRestore 89 | TYPE_RESTORE = 14, 90 | 91 | /// ISave 92 | TYPE_SAVE = 13, 93 | 94 | /// Vehicle 95 | TYPE_SCRIPTEDVEHICLE = 20, 96 | 97 | /// CSoundPatch 98 | TYPE_SOUND = 30, 99 | 100 | /// IGModAudioChannel 101 | TYPE_SOUNDHANDLE = 38, 102 | 103 | /// string 104 | TYPE_STRING = 4, 105 | 106 | /// table 107 | TYPE_TABLE = 5, 108 | 109 | /// ITexture 110 | TYPE_TEXTURE = 24, 111 | 112 | /// thread 113 | TYPE_THREAD = 8, 114 | 115 | /// CUserCmd 116 | TYPE_USERCMD = 19, 117 | 118 | /// bf_read 119 | TYPE_USERMSG = 26, 120 | 121 | /// Vector 122 | TYPE_VECTOR = 10, 123 | 124 | /// IVideoWriter 125 | TYPE_VIDEO = 33 126 | } 127 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/USE.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum USE 4 | { 5 | USE_OFF = 0, 6 | USE_ON = 1, 7 | USE_SET = 2, 8 | USE_TOGGLE = 3, 9 | 10 | /// Fire as long as player holds their use key. 11 | CONTINUOUS_USE = 0, 12 | 13 | /// Toggling true/false use. 14 | ONOFF_USE = 1, 15 | 16 | /// Like a wheel turning. 17 | DIRECTIONAL_USE = 2, 18 | 19 | /// Fire only once when player presses their use key. 20 | SIMPLE_USE = 3 21 | } 22 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/WEAPON.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum WEAPON 4 | { 5 | WEAPON_PROFICIENCY_POOR = 0, 6 | WEAPON_PROFICIENCY_AVERAGE = 1, 7 | WEAPON_PROFICIENCY_GOOD = 2, 8 | WEAPON_PROFICIENCY_VERY_GOOD = 3, 9 | WEAPON_PROFICIENCY_PERFECT = 4 10 | } 11 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Enums/kRenderFx.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared.Enums 2 | { 3 | public enum kRenderFx 4 | { 5 | /// None. No change. 6 | kRenderFxNone = 0, 7 | 8 | /// Slowly pulses the entitys transparency, +-15 to the current alpha. 9 | kRenderFxPulseSlow = 1, 10 | 11 | /// Quickly pulses the entitys transparency, +-15 to the current alpha. 12 | kRenderFxPulseFast = 2, 13 | 14 | /// Slowly pulses the entitys transparency, +-60 to the current alpha. 15 | kRenderFxPulseSlowWide = 3, 16 | 17 | /// Quickly pulses the entitys transparency, +-60 to the current alpha. 18 | kRenderFxPulseFastWide = 4, 19 | 20 | /// 21 | /// Slowly fades away the entity, making it completely invisible.Starts from whatever alpha the entity currently 22 | /// has set. 23 | /// 24 | kRenderFxFadeSlow = 5, 25 | 26 | /// 27 | /// Quickly fades away the entity, making it completely invisible.Starts from whatever alpha the entity currently 28 | /// has set. 29 | /// 30 | kRenderFxFadeFast = 6, 31 | 32 | /// Slowly solidifies the entity, making it fully opaque.Starts from whatever alpha the entity currently has set. 33 | kRenderFxSolidSlow = 7, 34 | 35 | /// Quickly solidifies the entity, making it fully opaque.Starts from whatever alpha the entity currently has set. 36 | kRenderFxSolidFast = 8, 37 | 38 | /// Slowly switches the entitys transparency between its alpha and 0. 39 | kRenderFxStrobeSlow = 9, 40 | 41 | /// Quickly switches the entitys transparency between its alpha and 0. 42 | kRenderFxStrobeFast = 10, 43 | 44 | /// Very quickly switches the entitys transparency between its alpha and 0. 45 | kRenderFxStrobeFaster = 11, 46 | 47 | /// Same as Strobe Slow, but the interval is more randomized. 48 | kRenderFxFlickerSlow = 12, 49 | 50 | /// Same as Strobe Fast, but the interval is more randomized. 51 | kRenderFxFlickerFast = 13, 52 | kRenderFxNoDissipation = 14, 53 | 54 | /// Flickers ( randomizes ) the entitys transparency 55 | kRenderFxDistort = 15, 56 | 57 | /// Same as Distort, but fades the entity away the farther you are from it. 58 | kRenderFxHologram = 16, 59 | kRenderFxExplode = 17, 60 | kRenderFxGlowShell = 18, 61 | kRenderFxClampMinScale = 19, 62 | kRenderFxEnvRain = 20, 63 | kRenderFxEnvSnow = 21, 64 | kRenderFxSpotlight = 22, 65 | kRenderFxRagdoll = 23, 66 | 67 | /// Quickly pulses the entitys transparency, from 0 to 255. 68 | kRenderFxPulseFastWider = 24 69 | } 70 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/ExternDll.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared 2 | { 3 | static class ExternDll 4 | { 5 | internal const string LuaShared = "lua_shared.dll"; 6 | #if SOURCE_SDK 7 | internal const string Kernel32 = "kernel32.dll"; 8 | internal const string SourceExports = "source_exports.dll"; 9 | #endif 10 | } 11 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/LuaConfig.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared 2 | { 3 | static class LuaConfig 4 | { 5 | #if LUA_FLOAT_LONGDOUBLE 6 | public const int LUAL_BUFFERSIZE = 8192; 7 | #else 8 | public const int LUAL_BUFFERSIZE = 2048; // 0x80 * sizeof(void*) * sizeof(lua_Integer); 9 | #endif 10 | public const int LUA_IDSIZE = 60; 11 | } 12 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/LuaState.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace GarrysModLuaShared 4 | { 5 | public struct LuaState : IEquatable 6 | { 7 | readonly IntPtr _state; 8 | 9 | LuaState(IntPtr ptr) : this() { _state = ptr; } 10 | 11 | public static implicit operator IntPtr(LuaState luaState) => luaState._state; 12 | 13 | public static implicit operator LuaState(IntPtr ptr) => new LuaState(ptr); 14 | 15 | public static implicit operator LuaState(int value) => new IntPtr(value); 16 | 17 | public static implicit operator LuaState(long value) => new IntPtr(value); 18 | 19 | public static unsafe implicit operator LuaState(void* value) => new IntPtr(value); 20 | 21 | public static implicit operator int(LuaState luaState) => luaState._state.ToInt32(); 22 | 23 | public static implicit operator long(LuaState luaState) => luaState._state.ToInt64(); 24 | 25 | public static unsafe implicit operator void*(LuaState luaState) => luaState._state.ToPointer(); 26 | 27 | public static bool operator ==(LuaState a, LuaState b) => Math.Abs(a._state.ToInt64() - b._state.ToInt64()) == default(long); 28 | 29 | public static bool operator ==(LuaState a, long b) => Math.Abs(a._state.ToInt64() - b) == default(long); 30 | 31 | public static bool operator ==(long b, LuaState a) => Math.Abs(b - a._state.ToInt64()) == default(long); 32 | 33 | public static bool operator ==(LuaState a, int b) => Math.Abs(a._state.ToInt32() - b) == default(int); 34 | 35 | public static bool operator ==(int b, LuaState a) => Math.Abs(b - a._state.ToInt32()) == default(int); 36 | 37 | public static bool operator ==(LuaState a, IntPtr b) => Math.Abs(a._state.ToInt64() - b.ToInt64()) == default(long); 38 | 39 | public static bool operator ==(IntPtr a, LuaState b) => Math.Abs(a.ToInt64() - b._state.ToInt64()) == default(long); 40 | 41 | public static bool operator !=(LuaState a, LuaState b) => !(a == b); 42 | 43 | public static bool operator !=(LuaState a, long b) => !(a == b); 44 | 45 | public static bool operator !=(long b, LuaState a) => !(b == a); 46 | 47 | public static bool operator !=(LuaState a, int b) => !(a == b); 48 | 49 | public static bool operator !=(int b, LuaState a) => !(b == a); 50 | 51 | public static bool operator !=(LuaState a, IntPtr b) => !(a == b); 52 | 53 | public static bool operator !=(IntPtr b, LuaState a) => !(b == a); 54 | 55 | public bool Equals(LuaState other) => _state.Equals(other._state); 56 | 57 | public override bool Equals(object obj) 58 | { 59 | if (ReferenceEquals(null, obj)) 60 | { 61 | return false; 62 | } 63 | return obj is LuaState && Equals((LuaState)obj); 64 | } 65 | 66 | public override int GetHashCode() => _state.GetHashCode(); 67 | } 68 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/LuaTable.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared 2 | { 3 | public sealed class LuaTable : LuaObject 4 | { 5 | public static readonly LuaTable _G = new LuaTable((int)TableIndex.SpecialGlob); 6 | 7 | public LuaTable(int index) : base(index) { } 8 | } 9 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | 8 | [assembly: AssemblyTitle("GarrysModLuaShared")] 9 | [assembly: AssemblyDescription("C# binary module for Garry's Mod.")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("gmod-csharp-binary-module")] 13 | [assembly: AssemblyCopyright("")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | 21 | [assembly: ComVisible(false)] 22 | 23 | // The following GUID is for the ID of the typelib if this project is exposed to COM 24 | 25 | [assembly: Guid("79e48743-282e-4bfc-b190-4cf4f5045de8")] 26 | 27 | // Version information for an assembly consists of the following four values: 28 | // 29 | // Major Version 30 | // Minor Version 31 | // Build Number 32 | // Revision 33 | // 34 | // You can specify all the values or you can default the Build and Revision Numbers 35 | // by using the '*' as shown below: 36 | // [assembly: AssemblyVersion("1.0.*")] 37 | 38 | [assembly: AssemblyVersion("1.3.0.0")] 39 | [assembly: AssemblyFileVersion("1.3.0.0")] -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | using System.CodeDom.Compiler; 12 | using System.ComponentModel; 13 | using System.Diagnostics; 14 | using System.Diagnostics.CodeAnalysis; 15 | using System.Drawing; 16 | using System.Globalization; 17 | using System.Resources; 18 | using System.Runtime.CompilerServices; 19 | 20 | namespace GarrysModLuaShared.Properties { 21 | /// 22 | /// A strongly-typed resource class, for looking up localized strings, etc. 23 | /// 24 | // This class was auto-generated by the StronglyTypedResourceBuilder 25 | // class via a tool like ResGen or Visual Studio. 26 | // To add or remove a member, edit your .ResX file then rerun ResGen 27 | // with the /str option, or rebuild your VS project. 28 | [GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 29 | [DebuggerNonUserCode()] 30 | [CompilerGenerated()] 31 | internal class Resources { 32 | 33 | private static ResourceManager resourceMan; 34 | 35 | private static CultureInfo resourceCulture; 36 | 37 | [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 38 | internal Resources() { 39 | } 40 | 41 | /// 42 | /// Returns the cached ResourceManager instance used by this class. 43 | /// 44 | [EditorBrowsable(EditorBrowsableState.Advanced)] 45 | internal static ResourceManager ResourceManager { 46 | get { 47 | if (ReferenceEquals(resourceMan, null)) { 48 | ResourceManager temp = new ResourceManager("GarrysModLuaShared.Properties.Resources", typeof(Resources).Assembly); 49 | resourceMan = temp; 50 | } 51 | return resourceMan; 52 | } 53 | } 54 | 55 | /// 56 | /// Overrides the current thread's CurrentUICulture property for all 57 | /// resource lookups using this strongly typed resource class. 58 | /// 59 | [EditorBrowsable(EditorBrowsableState.Advanced)] 60 | internal static CultureInfo Culture { 61 | get { 62 | return resourceCulture; 63 | } 64 | set { 65 | resourceCulture = value; 66 | } 67 | } 68 | 69 | /// 70 | /// Looks up a localized resource of type System.Drawing.Bitmap. 71 | /// 72 | internal static Bitmap ASCII_table { 73 | get { 74 | object obj = ResourceManager.GetObject("ASCII_table", resourceCulture); 75 | return ((Bitmap)(obj)); 76 | } 77 | } 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 122 | ..\Resources\ASCII_table.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 123 | 124 | -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Random.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace GarrysModLuaShared 4 | { 5 | static class Random 6 | { 7 | internal static readonly System.Random Generator = new System.Random((int)(DateTime.Now.Ticks + Environment.TickCount)); 8 | } 9 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Resources/ASCII_table.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmegaExtern/gmod-csharp-binary-module/bbd1caa16705fc322da61059e4cff9221909e6da/GarrysModLuaShared/GarrysModLuaShared/Resources/ASCII_table.png -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Source/ICvar.cs: -------------------------------------------------------------------------------- 1 | #if SOURCE_SDK 2 | using System.Runtime.InteropServices; 3 | 4 | namespace GarrysModLuaShared.Source 5 | { 6 | static class ICvar 7 | { 8 | /// 9 | /// 10 | /// 11 | /// 12 | [DllImport(ExternDll.SourceExports, CallingConvention = CallingConvention.Cdecl, EntryPoint = "?SetValue@ICvar@SourceExports@@CAHPBD0@Z", SetLastError = true)] 13 | [return: MarshalAs(UnmanagedType.Bool)] 14 | public static extern bool SetValue(string name, string value); 15 | 16 | /// 17 | /// 18 | /// 19 | /// 20 | [DllImport(ExternDll.SourceExports, CallingConvention = CallingConvention.Cdecl, EntryPoint = "?SetValue@ICvar@SourceExports@@CAHPBDH@Z", SetLastError = true)] 21 | [return: MarshalAs(UnmanagedType.Bool)] 22 | public static extern bool SetValue(string name, int value); 23 | 24 | /// 25 | /// 26 | /// 27 | /// 28 | [DllImport(ExternDll.SourceExports, CallingConvention = CallingConvention.Cdecl, EntryPoint = "?SetValue@ICvar@SourceExports@@CAHPBDM@Z", SetLastError = true)] 29 | [return: MarshalAs(UnmanagedType.Bool)] 30 | public static extern bool SetValue(string name, float value); 31 | 32 | /// 33 | /// 34 | /// 35 | /// 36 | [DllImport(ExternDll.SourceExports, CallingConvention = CallingConvention.Cdecl, EntryPoint = "?SetValue@ICvar@SourceExports@@CAHPBD_N@Z", SetLastError = true)] 37 | [return: MarshalAs(UnmanagedType.Bool)] 38 | public static extern bool SetValue(string name, bool value); 39 | } 40 | } 41 | #endif -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Source/IVEngineClient.cs: -------------------------------------------------------------------------------- 1 | #if SOURCE_SDK 2 | using System.Runtime.InteropServices; 3 | 4 | namespace GarrysModLuaShared.Source 5 | { 6 | static class IVEngineClient 7 | { 8 | /// 9 | /// Inserts into the command buffer as if it was typed by the client to his/her 10 | /// console. 11 | /// 12 | /// Note: Calls to this are checked against (if that bit is not 13 | /// set, then this function can't change it). 14 | /// 15 | /// Call to have access to 16 | /// vars. 17 | /// 18 | /// Command to insert. 19 | [DllImport(ExternDll.SourceExports, CallingConvention = CallingConvention.Cdecl, EntryPoint = "?ClientCmd@IVEngineClient@SourceExports@@CAXPBD@Z", SetLastError = true)] 20 | public static extern void ClientCmd(string cmdString); 21 | 22 | /// This version does NOT check against . 23 | /// Command to insert. 24 | [DllImport(ExternDll.SourceExports, CallingConvention = CallingConvention.Cdecl, EntryPoint = "?ClientCmd_Unrestricted@IVEngineClient@SourceExports@@CAXPBD@Z", SetLastError = true)] 25 | public static extern void ClientCmd_Unrestricted(string cmdString); 26 | 27 | /// 28 | /// Inserts into the command buffer as if it was typed by the client to his/her 29 | /// console. 30 | /// 31 | /// And then executes the command string immediately (vs which executes in the next frame). 32 | /// 33 | /// Note: This is NOT checked against the vars. 34 | /// 35 | /// Command to insert. 36 | [DllImport(ExternDll.SourceExports, CallingConvention = CallingConvention.Cdecl, EntryPoint = "?ExecuteClientCmd@IVEngineClient@SourceExports@@CAXPBD@Z", SetLastError = true)] 37 | public static extern void ExecuteClientCmd(string cmdString); 38 | 39 | /// Gets the dimensions of the game window. 40 | /// Width (in pixels). 41 | /// Height (in pixels). 42 | [DllImport(ExternDll.SourceExports, CallingConvention = CallingConvention.Cdecl, EntryPoint = "?GetScreenSize@IVEngineClient@SourceExports@@CAXAAH0@Z", SetLastError = true)] 43 | public static extern void GetScreenSize(ref int width, ref int height); 44 | } 45 | } 46 | #endif -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Structs/AmmoData.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | using System.Runtime.InteropServices; 3 | using GarrysModLuaShared.Enums; 4 | 5 | namespace GarrysModLuaShared.Structs 6 | { 7 | /// Structure used for bullets, see . 8 | [StructLayout(LayoutKind.Sequential)] 9 | public struct AmmoData 10 | { 11 | /// Damage type. 12 | [DefaultValue(DMG.DMG_BULLET)] 13 | public DMG dmgtype; 14 | 15 | /// The force of the ammo. 16 | [DefaultValue(1000.0D)] 17 | public double force; 18 | 19 | /// The maximum splash. 20 | [DefaultValue(0.0D)] 21 | public double maxsplash; 22 | 23 | /// The minimum splash. 24 | [DefaultValue(0.0D)] 25 | public double minsplash; 26 | 27 | /// Name of the ammo. 28 | [DefaultValue("MissingName")] 29 | public string name; 30 | 31 | /// The damage dealt to NPCs. 32 | [DefaultValue(10.0D)] 33 | public double npcdmg; 34 | 35 | /// The damage dealt to players. 36 | [DefaultValue(10.0D)] 37 | public double plydmg; 38 | 39 | /// Tracer type. 40 | [DefaultValue(TRACER.TRACER_NONE)] 41 | public TRACER tracer; 42 | 43 | /// Maximum amount of ammo of this type the player should be able to carry in reserve. 44 | /// 45 | /// NOTE: Currently only affects . 46 | /// 47 | [DefaultValue(9999.0D)] 48 | public double maxcarry; 49 | 50 | /// Flags for the ammo type. 51 | [DefaultValue(0.0D)] 52 | public double flags; 53 | } 54 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Structs/AngPos.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | using GarrysModLuaShared.Classes; 3 | 4 | namespace GarrysModLuaShared.Structs 5 | { 6 | /// Structure used by various functions, such as . 7 | [StructLayout(LayoutKind.Sequential)] 8 | public struct AngPos 9 | { 10 | /// Angle object. 11 | public Angle Ang; 12 | 13 | /// Vector object. 14 | public Vector Pos; 15 | } 16 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Structs/AnimationData.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | using System.Runtime.InteropServices; 3 | using GarrysModLuaShared.Classes; 4 | 5 | namespace GarrysModLuaShared.Structs 6 | { 7 | /// 8 | /// Structure used by panel animation methods, primarily , and returned 9 | /// by . 10 | /// 11 | [StructLayout(LayoutKind.Sequential)] 12 | public struct AnimationData 13 | { 14 | /// The system time value returned by when the animation starts/will start. 15 | public double StartTime; 16 | 17 | /// The system time value returned by when the animation ends/will end. 18 | public double EndTime; 19 | 20 | /// The ease in/out level of the animation. 21 | [DefaultValue(-1.0D)] 22 | public double Ease; 23 | } 24 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Structs/AttachmentData.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace GarrysModLuaShared.Structs 4 | { 5 | [StructLayout(LayoutKind.Sequential)] 6 | public struct AttachmentData 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Structs/BodyGroupData.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace GarrysModLuaShared.Structs 4 | { 5 | [StructLayout(LayoutKind.Sequential)] 6 | public struct BodyGroupData 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Structs/BoneManipulationData.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace GarrysModLuaShared.Structs 4 | { 5 | [StructLayout(LayoutKind.Sequential)] 6 | public struct BoneManipulationData 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Structs/Bullet.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace GarrysModLuaShared.Structs 4 | { 5 | [StructLayout(LayoutKind.Sequential)] 6 | public struct Bullet 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Structs/CamData.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace GarrysModLuaShared.Structs 4 | { 5 | [StructLayout(LayoutKind.Sequential)] 6 | public struct CamData 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Structs/CollisionData.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace GarrysModLuaShared.Structs 4 | { 5 | [StructLayout(LayoutKind.Sequential)] 6 | public struct CollisionData 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Structs/Color.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace GarrysModLuaShared.Structs 4 | { 5 | /// Object returned by the function and used in various situations. 6 | [StructLayout(LayoutKind.Sequential)] 7 | public struct Color 8 | { 9 | /// The red channel. 10 | public byte r; 11 | 12 | /// The blue channel. 13 | public byte b; 14 | 15 | /// The alpha channel (transparency). 16 | public byte a; 17 | 18 | /// The green channel. 19 | public byte g; 20 | } 21 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Structs/ColorModifyData.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace GarrysModLuaShared.Structs 4 | { 5 | [StructLayout(LayoutKind.Sequential)] 6 | public struct ColorModifyData 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Structs/CreationMenus.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace GarrysModLuaShared.Structs 4 | { 5 | [StructLayout(LayoutKind.Sequential)] 6 | public struct CreationMenus 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Structs/DateData.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace GarrysModLuaShared.Structs 4 | { 5 | [StructLayout(LayoutKind.Sequential)] 6 | public struct DateData 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Structs/DebugInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace GarrysModLuaShared.Structs 4 | { 5 | [StructLayout(LayoutKind.Sequential)] 6 | public struct DebugInfo 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Structs/DynamicLight.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace GarrysModLuaShared.Structs 4 | { 5 | [StructLayout(LayoutKind.Sequential)] 6 | public struct DynamicLight 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Structs/EmitSoundInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace GarrysModLuaShared.Structs 4 | { 5 | [StructLayout(LayoutKind.Sequential)] 6 | public struct EmitSoundInfo 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Structs/EntityCopyData.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace GarrysModLuaShared.Structs 4 | { 5 | [StructLayout(LayoutKind.Sequential)] 6 | public struct EntityCopyData 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Structs/FontData.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace GarrysModLuaShared.Structs 4 | { 5 | [StructLayout(LayoutKind.Sequential)] 6 | public struct FontData 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Structs/HTTPRequest.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace GarrysModLuaShared.Structs 4 | { 5 | [StructLayout(LayoutKind.Sequential)] 6 | public struct HTTPRequest 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Structs/HullTrace.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace GarrysModLuaShared.Structs 4 | { 5 | [StructLayout(LayoutKind.Sequential)] 6 | public struct HullTrace 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Structs/LocalLight.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace GarrysModLuaShared.Structs 4 | { 5 | [StructLayout(LayoutKind.Sequential)] 6 | public struct LocalLight 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Structs/MatProxyData.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace GarrysModLuaShared.Structs 4 | { 5 | [StructLayout(LayoutKind.Sequential)] 6 | public struct MatProxyData 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Structs/MeshVertex.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace GarrysModLuaShared.Structs 4 | { 5 | [StructLayout(LayoutKind.Sequential)] 6 | public struct MeshVertex 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Structs/OperatingParams.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace GarrysModLuaShared.Structs 4 | { 5 | [StructLayout(LayoutKind.Sequential)] 6 | public struct OperatingParams 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Structs/PhysEnvPerformanceSettings.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace GarrysModLuaShared.Structs 4 | { 5 | [StructLayout(LayoutKind.Sequential)] 6 | public struct PhysEnvPerformanceSettings 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Structs/PhysProperties.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace GarrysModLuaShared.Structs 4 | { 5 | [StructLayout(LayoutKind.Sequential)] 6 | public struct PhysProperties 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Structs/PhysicsObjectSave.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace GarrysModLuaShared.Structs 4 | { 5 | [StructLayout(LayoutKind.Sequential)] 6 | public struct PhysicsObjectSave 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Structs/PolygonVertex.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace GarrysModLuaShared.Structs 4 | { 5 | [StructLayout(LayoutKind.Sequential)] 6 | public struct PolygonVertex 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Structs/RenderCamData.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace GarrysModLuaShared.Structs 4 | { 5 | [StructLayout(LayoutKind.Sequential)] 6 | public struct RenderCamData 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Structs/RenderCaptureData.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace GarrysModLuaShared.Structs 4 | { 5 | [StructLayout(LayoutKind.Sequential)] 6 | public struct RenderCaptureData 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Structs/ServerQueryData.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace GarrysModLuaShared.Structs 4 | { 5 | [StructLayout(LayoutKind.Sequential)] 6 | public struct ServerQueryData 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Structs/SoundData.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace GarrysModLuaShared.Structs 4 | { 5 | [StructLayout(LayoutKind.Sequential)] 6 | public struct SoundData 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Structs/SunInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace GarrysModLuaShared.Structs 4 | { 5 | [StructLayout(LayoutKind.Sequential)] 6 | public struct SunInfo 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Structs/TeamData.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace GarrysModLuaShared.Structs 4 | { 5 | [StructLayout(LayoutKind.Sequential)] 6 | public struct TeamData 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Structs/TextData.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace GarrysModLuaShared.Structs 4 | { 5 | [StructLayout(LayoutKind.Sequential)] 6 | public struct TextData 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Structs/TextureData.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace GarrysModLuaShared.Structs 4 | { 5 | [StructLayout(LayoutKind.Sequential)] 6 | public struct TextureData 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Structs/ToScreenData.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace GarrysModLuaShared.Structs 4 | { 5 | [StructLayout(LayoutKind.Sequential)] 6 | public struct ToScreenData 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Structs/Trace.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace GarrysModLuaShared.Structs 4 | { 5 | [StructLayout(LayoutKind.Sequential)] 6 | public struct Trace 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Structs/TraceResult.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace GarrysModLuaShared.Structs 4 | { 5 | [StructLayout(LayoutKind.Sequential)] 6 | public struct TraceResult 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Structs/Undo.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace GarrysModLuaShared.Structs 4 | { 5 | [StructLayout(LayoutKind.Sequential)] 6 | public struct Undo 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Structs/VehicleParams.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace GarrysModLuaShared.Structs 4 | { 5 | [StructLayout(LayoutKind.Sequential)] 6 | public struct VehicleParams 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Structs/VehicleParamsAxle.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace GarrysModLuaShared.Structs 4 | { 5 | [StructLayout(LayoutKind.Sequential)] 6 | public struct VehicleParamsAxle 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Structs/VehicleParamsBody.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace GarrysModLuaShared.Structs 4 | { 5 | [StructLayout(LayoutKind.Sequential)] 6 | public struct VehicleParamsBody 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Structs/VehicleParamsEngine.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace GarrysModLuaShared.Structs 4 | { 5 | [StructLayout(LayoutKind.Sequential)] 6 | public struct VehicleParamsEngine 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Structs/VehicleParamsSteering.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace GarrysModLuaShared.Structs 4 | { 5 | [StructLayout(LayoutKind.Sequential)] 6 | public struct VehicleParamsSteering 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Structs/VideoData.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace GarrysModLuaShared.Structs 4 | { 5 | [StructLayout(LayoutKind.Sequential)] 6 | public struct VideoData 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Structs/ViewData.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace GarrysModLuaShared.Structs 4 | { 5 | [StructLayout(LayoutKind.Sequential)] 6 | public struct ViewData 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/TableIndex.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared 2 | { 3 | enum TableIndex 4 | { 5 | /// Global table 6 | SpecialGlob = -10002, 7 | 8 | /// Environment table 9 | SpecialEnv, 10 | 11 | /// Registry table 12 | SpecialReg 13 | } 14 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/Type.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared 2 | { 3 | enum Type 4 | { 5 | Invalid = -1, 6 | Nil, 7 | Bool, 8 | LightUserData, 9 | Number, 10 | String, 11 | Table, 12 | Function, 13 | UserData, 14 | Thread, 15 | Entity, 16 | Vector, 17 | Angle, 18 | PhysObj, 19 | Save, 20 | Restore, 21 | DamageInfo, 22 | EffectData, 23 | MoveData, 24 | RecipientFilter, 25 | UserCmd, 26 | ScriptedVehicle, 27 | Material, 28 | Panel, 29 | Particle, 30 | ParticleEmitter, 31 | Texture, 32 | UserMsg, 33 | ConVar, 34 | Mesh, 35 | Matrix, 36 | Sound, 37 | PixelVisHandle, 38 | DLight, 39 | Video, 40 | File, 41 | Count 42 | } 43 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/cookie.cs: -------------------------------------------------------------------------------- 1 | using static GarrysModLuaShared.Lua; 2 | 3 | namespace GarrysModLuaShared 4 | { 5 | /// 6 | /// Used to store permanent variables/settings on clients that will persist between servers. They are stored in 7 | /// the cl.db SQLite database located in the root Garry's Mod folder. 8 | /// 9 | static class cookie 10 | { 11 | /// Deletes a cookie on the client. 12 | /// Pointer to lua_State struct. 13 | /// The name of the cookie that you want to delete. 14 | public static void Delete(LuaState luaState, string name) 15 | { 16 | lock (SyncRoot) 17 | { 18 | lua_getglobal(luaState, nameof(cookie)); 19 | lua_getfield(luaState, -1, nameof(Delete)); 20 | lua_pushstring(luaState, name); 21 | lua_pcall(luaState, 1); 22 | } 23 | } 24 | 25 | /// Gets the value of a cookie on the client as a number. 26 | /// Pointer to lua_State struct. 27 | /// The name of the cookie that you want to get. 28 | /// Value to return if the cookie does not exist. 29 | /// The cookie value. 30 | public static double GetNumber(LuaState luaState, string name, object @default = null) 31 | { 32 | lock (SyncRoot) 33 | { 34 | lua_getglobal(luaState, nameof(cookie)); 35 | lua_getfield(luaState, -1, nameof(GetNumber)); 36 | lua_pushstring(luaState, name); 37 | lua_pushobject(luaState, @default); 38 | lua_pcall(luaState, 2, 1); 39 | return lua_tonumber(luaState); 40 | } 41 | } 42 | 43 | /// Gets the value of a cookie on the client as a string. 44 | /// Pointer to lua_State struct. 45 | /// The name of the cookie that you want to get. 46 | /// Value to return if the cookie does not exist. 47 | /// The cookie value. 48 | public static string GetString(LuaState luaState, string name, object @default = null) 49 | { 50 | lock (SyncRoot) 51 | { 52 | lua_getglobal(luaState, nameof(cookie)); 53 | lua_getfield(luaState, -1, nameof(GetString)); 54 | lua_pushstring(luaState, name); 55 | lua_pushobject(luaState, @default); 56 | lua_pcall(luaState, 2, 1); 57 | return ToManagedString(luaState); 58 | } 59 | } 60 | 61 | /// Sets the value of a cookie on the client. 62 | /// 63 | /// These are stored in the cl.db file. 64 | /// 65 | /// Pointer to lua_State struct. 66 | /// The name of the cookie that you want to set. 67 | /// Value to store in the cookie. 68 | public static void Set(LuaState luaState, string name, string value) 69 | { 70 | lock (SyncRoot) 71 | { 72 | lua_getglobal(luaState, nameof(cookie)); 73 | lua_getfield(luaState, -1, nameof(Set)); 74 | lua_pushstring(luaState, name); 75 | lua_pushstring(luaState, value); 76 | lua_pcall(luaState, 2); 77 | } 78 | } 79 | } 80 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/gameevent.cs: -------------------------------------------------------------------------------- 1 | using static GarrysModLuaShared.Lua; 2 | 3 | namespace GarrysModLuaShared 4 | { 5 | /// Used to interface with the built in game events system. 6 | static class gameevent 7 | { 8 | /// Add a game event listener. 9 | /// Pointer to lua_State struct. 10 | /// The event to listen to, travels through hooks with eventName as event. 11 | /// 12 | /// List of valid events can be found . 13 | /// 14 | public static void Listen(LuaState luaState, string eventName) 15 | { 16 | lock (SyncRoot) 17 | { 18 | lua_getglobal(luaState, nameof(gameevent)); 19 | lua_getfield(luaState, -1, nameof(Listen)); 20 | lua_pushstring(luaState, eventName); 21 | lua_pcall(luaState, 1); 22 | } 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/language.cs: -------------------------------------------------------------------------------- 1 | #if CLIENT 2 | using static GarrysModLuaShared.Lua; 3 | 4 | namespace GarrysModLuaShared 5 | { 6 | /// The language library is used for translation. 7 | static class language 8 | { 9 | /// 10 | /// Adds a language item. Language placeholders are replaced with full text in Garry's Mod once registered with 11 | /// this function. 12 | /// 13 | /// Pointer to lua_State struct. 14 | /// The key for this phrase. 15 | /// The phrase that should be displayed whenever this key is used. 16 | public static void Add(LuaState luaState, string placeholder, string fullText) 17 | { 18 | lock (SyncRoot) 19 | { 20 | lua_getglobal(luaState, nameof(language)); 21 | lua_getfield(luaState, -1, nameof(Add)); 22 | lua_pushstring(luaState, placeholder); 23 | lua_pushstring(luaState, fullText); 24 | lua_pcall(luaState, 2); 25 | } 26 | } 27 | 28 | /// Retrieves the translated version of inputted string. Useful for concentrating multiple translated strings. 29 | /// Pointer to lua_State struct. 30 | /// The untranslated phrase. 31 | /// The translated version of inputted . 32 | public static string GetPhrase(LuaState luaState, string phrase) 33 | { 34 | lock (SyncRoot) 35 | { 36 | lua_getglobal(luaState, nameof(language)); 37 | lua_getfield(luaState, -1, nameof(GetPhrase)); 38 | lua_pushstring(luaState, phrase); 39 | lua_pcall(luaState, 1, 1); 40 | return ToManagedString(luaState); 41 | } 42 | } 43 | } 44 | } 45 | 46 | #endif -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/luaL_Buffer.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared 2 | { 3 | unsafe struct luaL_Buffer 4 | { 5 | /// Current position in buffer 6 | public int p; 7 | 8 | /// Number of strings in the stack (level) 9 | public int lvl; 10 | 11 | public LuaState luaState; 12 | public fixed char buffer [LuaConfig.LUAL_BUFFERSIZE]; 13 | } 14 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/luaL_Reg.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared 2 | { 3 | class luaL_Reg 4 | { 5 | public lua_CFunction func; 6 | public string name; 7 | 8 | luaL_Reg() { } 9 | 10 | public luaL_Reg(string name, lua_CFunction func) 11 | { 12 | this.name = name; 13 | this.func = func; 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/lua_Alloc.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace GarrysModLuaShared 5 | { 6 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] 7 | public delegate IntPtr lua_Alloc(IntPtr ud, IntPtr ptr, IntPtr osize, IntPtr nsize); 8 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/lua_CFunction.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace GarrysModLuaShared 4 | { 5 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] 6 | public delegate int lua_CFunction(LuaState luaState); 7 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/lua_Debug.cs: -------------------------------------------------------------------------------- 1 | namespace GarrysModLuaShared 2 | { 3 | public unsafe struct lua_Debug 4 | { 5 | public int @event; 6 | public string name; 7 | public string namewhat; 8 | public string what; 9 | public string source; 10 | public int currentline; 11 | public int linedefined; 12 | public int lastlinedefined; 13 | public byte nups; 14 | public byte nparams; 15 | public char isvararg; 16 | public char istailcall; 17 | public fixed char short_src [LuaConfig.LUA_IDSIZE]; 18 | } 19 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/lua_Hook.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace GarrysModLuaShared 4 | { 5 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] 6 | public delegate void lua_Hook(LuaState luaState, lua_Debug ar); 7 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/lua_Reader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace GarrysModLuaShared 5 | { 6 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] 7 | public delegate IntPtr lua_Reader(LuaState luaState, IntPtr data, IntPtr size); 8 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/lua_Writer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace GarrysModLuaShared 5 | { 6 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] 7 | public delegate int lua_Writer(LuaState luaState, IntPtr buffer, IntPtr size, IntPtr data); 8 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/menu.cs: -------------------------------------------------------------------------------- 1 | #if CLIENT 2 | using static GarrysModLuaShared.Lua; 3 | 4 | namespace GarrysModLuaShared 5 | { 6 | /// The menu library. 7 | static class menu 8 | { 9 | /// Used by "Demo to Video" to record the frame. 10 | /// Pointer to lua_State struct. 11 | public static void RecordFrame(LuaState luaState) 12 | { 13 | lock (SyncRoot) 14 | { 15 | lua_getglobal(luaState, nameof(menu)); 16 | lua_getfield(luaState, -1, nameof(RecordFrame)); 17 | lua_pcall(luaState, 1); 18 | } 19 | } 20 | } 21 | } 22 | 23 | #endif -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/notification.cs: -------------------------------------------------------------------------------- 1 | #if CLIENT 2 | using GarrysModLuaShared.Enums; 3 | using static GarrysModLuaShared.Lua; 4 | 5 | namespace GarrysModLuaShared 6 | { 7 | /// Used to display notifications on the screen (mid-right). 8 | static class notification 9 | { 10 | /// Adds a standard notification to your screen. 11 | /// Pointer to lua_State struct. 12 | /// The string to display. 13 | /// Determines the method for displaying the notification. 14 | /// The number of seconds to display the notification for. 15 | public static void AddLegacy(LuaState luaState, string text, NOTIFY notifyType, double length) 16 | { 17 | lock (SyncRoot) 18 | { 19 | lua_getglobal(luaState, nameof(notification)); 20 | lua_getfield(luaState, -1, nameof(AddLegacy)); 21 | lua_pushstring(luaState, text); 22 | lua_pushnumber(luaState, (int)notifyType); 23 | lua_pushnumber(luaState, length); 24 | lua_pcall(luaState, 3); 25 | } 26 | } 27 | 28 | /// Adds a notification with an animated progress bar. 29 | /// Pointer to lua_State struct. 30 | /// Can be any type. It's used as an index. 31 | /// The text to show. 32 | public static void AddProgress(LuaState luaState, object uniqueId, string text) 33 | { 34 | lock (SyncRoot) 35 | { 36 | lua_getglobal(luaState, nameof(notification)); 37 | lua_getfield(luaState, -1, nameof(AddProgress)); 38 | lua_pushobject(luaState, uniqueId); 39 | lua_pushstring(luaState, text); 40 | lua_pcall(luaState, 2); 41 | } 42 | } 43 | 44 | /// Removes the notification after 0.8 seconds. 45 | /// Pointer to lua_State struct. 46 | /// The unique ID of the notification. 47 | public static void Kill(LuaState luaState, object uniqueId) 48 | { 49 | lock (SyncRoot) 50 | { 51 | lua_getglobal(luaState, nameof(notification)); 52 | lua_getfield(luaState, -1, nameof(Kill)); 53 | lua_pushobject(luaState, uniqueId); 54 | lua_pcall(luaState, 1); 55 | } 56 | } 57 | } 58 | } 59 | 60 | #endif -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/os.cs: -------------------------------------------------------------------------------- 1 | using static GarrysModLuaShared.Lua; 2 | 3 | namespace GarrysModLuaShared 4 | { 5 | /// 6 | /// The os library is a standard Lua library originally intended to allow Lua access to various features of the 7 | /// Operating System it's running on, however many of the features and functions have been removed in Garry's Mod due 8 | /// to security issues. It's only used in Garry's Mod for date & time operations. 9 | /// 10 | static class os 11 | { 12 | /// Returns the approximate CPU time the application run. 13 | /// 14 | /// This can be very useful for optimizing as you can use it to find out how long it took your function to run. 15 | /// 16 | /// Pointer to lua_State struct. 17 | /// The approximate CPU time the application run. 18 | public static double clock(LuaState luaState) 19 | { 20 | lock (SyncRoot) 21 | { 22 | lua_getglobal(luaState, nameof(os)); 23 | lua_getfield(luaState, -1, nameof(clock)); 24 | lua_pcall(luaState, 0, 1); 25 | return lua_tonumber(luaState); 26 | } 27 | } 28 | 29 | /// Returns the date/time as a formatted string or in a table. 30 | /// Pointer to lua_State struct. 31 | /// 32 | /// The format string. 33 | /// 34 | /// If this is equal to '*t' then this function will return a table, otherwise it will return a string. 35 | /// 36 | /// If this starts with an '!', the returned data will use the UTC timezone rather than the local timezone. 37 | /// 38 | /// See http://www.mkssoftware.com/docs/man3/strftime.3.asp for available format flags. 39 | /// 40 | /// Not all flags are available on all operating systems and the result of using an invalid flag is undefined.This 41 | /// currently crashes the game on Windows.Most or all flags are available on OS X and Linux but considerably fewer are 42 | /// available on Windows.See http://msdn.microsoft.com/en-us/library/fe06s4ak.aspx for a list of available flags on 43 | /// Windows. 44 | /// 45 | /// Time to use for the format. 46 | /// Formatted date. Note: This can be a table if the first argument equals to "*t"! 47 | public static string date(LuaState luaState, string format, double time) 48 | { 49 | lock (SyncRoot) 50 | { 51 | if (format == "*t") 52 | { 53 | //throw new NotSupportedException("TODO: Tables."); 54 | return default(string); 55 | } 56 | lua_getglobal(luaState, nameof(os)); 57 | lua_getfield(luaState, -1, nameof(date)); 58 | lua_pushstring(luaState, format); 59 | lua_pushnumber(luaState, time); 60 | lua_pcall(luaState, 2, 1); 61 | return ToManagedString(luaState); 62 | } 63 | } 64 | 65 | /// Subtracts the second of the first value and rounds the result. 66 | /// Pointer to lua_State struct. 67 | /// The first value. 68 | /// The value to subtract. 69 | /// Difference. 70 | public static double difftime(LuaState luaState, double timeA, double timeB) 71 | { 72 | lock (SyncRoot) 73 | { 74 | lua_getglobal(luaState, nameof(os)); 75 | lua_getfield(luaState, -1, nameof(difftime)); 76 | lua_pushnumber(luaState, timeA); 77 | lua_pushnumber(luaState, timeB); 78 | lua_pcall(luaState, 2, 1); 79 | return lua_tonumber(luaState); 80 | } 81 | } 82 | 83 | /// 84 | /// Returns the system time in seconds past the unix epoch. If a table is supplied, the function attempts to build 85 | /// a system time with the specified table members. 86 | /// 87 | /// Pointer to lua_State struct. 88 | /// Seconds passed since Unix epoch. 89 | public static double time(LuaState luaState) // TODO: After implementing tables (this takes a DateData structure table). 90 | { 91 | lock (SyncRoot) 92 | { 93 | lua_getglobal(luaState, nameof(os)); 94 | lua_getfield(luaState, -1, nameof(time)); 95 | lua_pushnil(luaState); // Pushing nil (until tables gets implemented). 96 | lua_pcall(luaState, 1, 1); 97 | return lua_tonumber(luaState); 98 | } 99 | } 100 | } 101 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/physenv.cs: -------------------------------------------------------------------------------- 1 | using static GarrysModLuaShared.Lua; 2 | 3 | namespace GarrysModLuaShared 4 | { 5 | /// 6 | /// The physenv library allows you to control the physics environment created by the engine, and lets you modify 7 | /// constants such as gravity and maximum velocity. 8 | /// 9 | static class physenv 10 | { 11 | /// Loads the given surface properties as a string, follows the file format. 12 | /// Pointer to lua_State struct. 13 | /// The properties to add. 14 | public static void AddSurfaceData(LuaState luaState, string properties) 15 | { 16 | lock (SyncRoot) 17 | { 18 | lua_getglobal(luaState, nameof(physenv)); 19 | lua_getfield(luaState, -1, nameof(AddSurfaceData)); 20 | lua_pushstring(luaState, properties); 21 | lua_pcall(luaState, 1); 22 | } 23 | } 24 | 25 | /// Returns the air density. 26 | /// Pointer to lua_State struct. 27 | /// The air density. 28 | public static double GetAirDensity(LuaState luaState) 29 | { 30 | lock (SyncRoot) 31 | { 32 | lua_getglobal(luaState, nameof(physenv)); 33 | lua_getfield(luaState, -1, nameof(GetAirDensity)); 34 | lua_pcall(luaState, 0, 1); 35 | return lua_tonumber(luaState); 36 | } 37 | } 38 | 39 | // TODO: physenv.GetGravity (returns Vector structure). 40 | 41 | // TODO: physenv.GetPerformanceSettings (returns PhysEnvPerformanceSettings structure). 42 | 43 | /// Sets the air density. 44 | /// Pointer to lua_State struct. 45 | /// The new air density. 46 | public static void SetAirDensity(LuaState luaState, double airDensity) 47 | { 48 | lock (SyncRoot) 49 | { 50 | lua_getglobal(luaState, nameof(physenv)); 51 | lua_getfield(luaState, -1, nameof(SetAirDensity)); 52 | lua_pushnumber(luaState, airDensity); 53 | lua_pcall(luaState, 1); 54 | } 55 | } 56 | 57 | // TODO: physenv.SetPerformanceSettings (takes PhysEnvPerformanceSettings structure as argument). 58 | 59 | // TODO: physenv.SetGravity (takes Vector structure as argument). 60 | } 61 | } -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/resource.cs: -------------------------------------------------------------------------------- 1 | #if SERVER 2 | using static GarrysModLuaShared.Lua; 3 | 4 | namespace GarrysModLuaShared 5 | { 6 | /// 7 | /// The resource library is used to control what files are sent to clients who join a server, this includes 8 | /// models, materials, sounds, text files but not Lua files. 9 | /// 10 | static class resource 11 | { 12 | /// 13 | /// Adds the specified and all related files to the files the client should download. 14 | /// 15 | /// For convenience, this function will automatically add any other files that are related to the selected one, and 16 | /// throw an error if it can't find them. For example, a .vmt file will automatically add the .vtf with the same name, 17 | /// and a .mdl file will automatically add all .vvd, .ani, .dx80.vtx, .dx90.vtx, .sw.vtx, .phy and .jpg files with the 18 | /// same name, with a separate error for each missing file. If you do not want it to do this, use 19 | /// . 20 | /// 21 | /// NOTE: There's a 8192 downloadable file limit. If you need more, consider using Workshop addons - 22 | /// . You should also consider the fact that you have way too many downloads. 23 | /// 24 | /// Pointer to lua_State struct. 25 | /// Path of the file to be added, relative to garrysmod root folder. 26 | public static void AddFile(LuaState luaState, string path) 27 | { 28 | lock (SyncRoot) 29 | { 30 | lua_getglobal(luaState, nameof(resource)); 31 | lua_getfield(luaState, -1, nameof(AddFile)); 32 | lua_pushstring(luaState, path); 33 | lua_pcall(luaState, 1); 34 | } 35 | } 36 | 37 | /// Adds the specified file to the files the client should download. 38 | /// Pointer to lua_State struct. 39 | /// Path of the file to be added, relative to garrysmod root folder. 40 | public static void AddSingleFile(LuaState luaState, string path) 41 | { 42 | lock (SyncRoot) 43 | { 44 | lua_getglobal(luaState, nameof(resource)); 45 | lua_getfield(luaState, -1, nameof(AddSingleFile)); 46 | lua_pushstring(luaState, path); 47 | lua_pcall(luaState, 1); 48 | } 49 | } 50 | 51 | /// 52 | /// Adds a workshop addon for the client to download before entering the server. 53 | /// 54 | /// Having the raw files from a workshop item does not count as having already downloaded it. 55 | /// 56 | /// So players who previously downloaded a map through Fast Download will have to re-download it if you use the 57 | /// workshop. 58 | /// 59 | /// You should try to only add addons that have custom content ( models, sounds, etc ). 60 | /// 61 | /// Gamemodes that are 62 | /// workshop enabled are 63 | /// automatically added to this list - so there's no need to add them. 64 | /// 65 | /// The server's current map is also automatically added, if it is loaded from a workshop addon. 66 | /// 67 | /// Pointer to lua_State struct. 68 | /// The workshop ID of the file. This cannot be a collection. 69 | public static void AddWorkshop(LuaState luaState, string workshopId) 70 | { 71 | lock (SyncRoot) 72 | { 73 | lua_getglobal(luaState, nameof(resource)); 74 | lua_getfield(luaState, -1, nameof(AddWorkshop)); 75 | lua_pushstring(luaState, workshopId); 76 | lua_pcall(luaState, 1); 77 | } 78 | } 79 | } 80 | } 81 | 82 | #endif -------------------------------------------------------------------------------- /GarrysModLuaShared/GarrysModLuaShared/system.cs: -------------------------------------------------------------------------------- 1 | using static GarrysModLuaShared.Lua; 2 | 3 | namespace GarrysModLuaShared 4 | { 5 | /// 6 | /// The system library provides functions that allow you to gather information about the system running the game, 7 | /// such as operating system, uptime and battery level. 8 | /// 9 | static class system 10 | { 11 | /// Returns the total uptime of the current application. 12 | /// 13 | /// This will return a similar value to . 14 | /// 15 | /// Pointer to lua_State struct. 16 | /// Seconds of game uptime as an integer. 17 | public static uint AppTime(LuaState luaState) 18 | { 19 | lock (SyncRoot) 20 | { 21 | lua_getglobal(luaState, nameof(system)); 22 | lua_getfield(luaState, -1, nameof(AppTime)); 23 | lua_pcall(luaState, 0, 1); 24 | return (uint)lua_tonumber(luaState); 25 | } 26 | } 27 | 28 | /// Returns the current battery power. 29 | /// Pointer to lua_State struct. 30 | /// 0-100 if on battery power. 31 | /// 32 | /// If plugged in, the value will be 255 regardless of charging state. 33 | /// 34 | public static byte BatteryPower(LuaState luaState) 35 | { 36 | lock (SyncRoot) 37 | { 38 | lua_getglobal(luaState, nameof(system)); 39 | lua_getfield(luaState, -1, nameof(BatteryPower)); 40 | lua_pcall(luaState, 0, 1); 41 | return (byte)lua_tointeger(luaState); 42 | } 43 | } 44 | 45 | #if CLIENT 46 | /// Flashes the window. Currently works only on Windows platform. 47 | /// Pointer to lua_State struct. 48 | public static void FlashWindow(LuaState luaState) 49 | { 50 | lock (SyncRoot) 51 | { 52 | lua_getglobal(luaState, nameof(system)); 53 | lua_getfield(luaState, -1, nameof(FlashWindow)); 54 | lua_pcall(luaState); 55 | } 56 | } 57 | #endif 58 | 59 | /// Returns the country code of this computer, determined by the localisation settings of the OS. 60 | /// Pointer to lua_State struct. 61 | /// 62 | /// Two-letter country code, using ISO 3166-1 63 | /// standard. 64 | /// 65 | public static string GetCountry(LuaState luaState) 66 | { 67 | lock (SyncRoot) 68 | { 69 | lua_getglobal(luaState, nameof(system)); 70 | lua_getfield(luaState, -1, nameof(GetCountry)); 71 | lua_pcall(luaState, 0, 1); 72 | return ToManagedString(luaState); 73 | } 74 | } 75 | 76 | /// Returns whether or not the game window has focus. 77 | /// 78 | /// This does nothing on dedicated servers. 79 | /// 80 | /// Returns true 100% of the time on OS X and returns nil on Linux platform. 81 | /// 82 | /// Pointer to lua_State struct. 83 | /// Whether or not the game window has focus. 84 | public static bool HasFocus(LuaState luaState) 85 | { 86 | lock (SyncRoot) 87 | { 88 | lua_getglobal(luaState, nameof(system)); 89 | lua_getfield(luaState, -1, nameof(HasFocus)); 90 | lua_pcall(luaState, 0, 1); 91 | return lua_toboolean(luaState) == 1; 92 | } 93 | } 94 | 95 | /// Returns whether the current OS is Linux. 96 | /// Pointer to lua_State struct. 97 | /// Whether or not the game is running on Linux. 98 | public static bool IsLinux(LuaState luaState) 99 | { 100 | lock (SyncRoot) 101 | { 102 | lua_getglobal(luaState, nameof(system)); 103 | lua_getfield(luaState, -1, nameof(IsLinux)); 104 | lua_pcall(luaState, 0, 1); 105 | return lua_toboolean(luaState) == 1; 106 | } 107 | } 108 | 109 | /// Returns whether the current OS is OSX. 110 | /// Pointer to lua_State struct. 111 | /// Whether or not the game is running on OSX. 112 | public static bool IsOSX(LuaState luaState) 113 | { 114 | lock (SyncRoot) 115 | { 116 | lua_getglobal(luaState, nameof(system)); 117 | lua_getfield(luaState, -1, nameof(IsOSX)); 118 | lua_pcall(luaState, 0, 1); 119 | return lua_toboolean(luaState) == 1; 120 | } 121 | } 122 | 123 | #if CLIENT 124 | /// Returns true if the game is currently running windowed; otherwise false if it is fullscreen. 125 | /// Pointer to lua_State struct. 126 | /// Is the game running in a window? 127 | public static bool IsWindowed(LuaState luaState) 128 | { 129 | lock (SyncRoot) 130 | { 131 | lua_getglobal(luaState, nameof(system)); 132 | lua_getfield(luaState, -1, nameof(IsWindowed)); 133 | lua_pcall(luaState, 0, 1); 134 | return lua_toboolean(luaState) == 1; 135 | } 136 | } 137 | #endif 138 | 139 | /// Returns whether the current OS is Windows. 140 | /// Pointer to lua_State struct. 141 | /// Whether the system the game runs on is Windows or not. 142 | public static bool IsWindows(LuaState luaState) 143 | { 144 | lock (SyncRoot) 145 | { 146 | lua_getglobal(luaState, nameof(system)); 147 | lua_getfield(luaState, -1, nameof(IsWindows)); 148 | lua_pcall(luaState, 0, 1); 149 | return lua_toboolean(luaState) == 1; 150 | } 151 | } 152 | 153 | /// 154 | /// Returns the synchronized steam time. This is the number of seconds since the 155 | /// Unix epoch. 156 | /// 157 | /// Pointer to lua_State struct. 158 | /// Current steam-synchronized Unix time. 159 | public static uint SteamTime(LuaState luaState) 160 | { 161 | lock (SyncRoot) 162 | { 163 | lua_getglobal(luaState, nameof(system)); 164 | lua_getfield(luaState, -1, nameof(SteamTime)); 165 | lua_pcall(luaState, 0, 1); 166 | return (uint)lua_tonumber(luaState); 167 | } 168 | } 169 | 170 | /// Returns the total uptime of operating system. 171 | /// Pointer to lua_State struct. 172 | /// The total uptime of operating system. 173 | public static uint UpTime(LuaState luaState) 174 | { 175 | lock (SyncRoot) 176 | { 177 | lua_getglobal(luaState, nameof(system)); 178 | lua_getfield(luaState, -1, nameof(UpTime)); 179 | lua_pcall(luaState, 0, 1); 180 | return (uint)lua_tonumber(luaState); 181 | } 182 | } 183 | } 184 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU LESSER GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | 9 | This version of the GNU Lesser General Public License incorporates 10 | the terms and conditions of version 3 of the GNU General Public 11 | License, supplemented by the additional permissions listed below. 12 | 13 | 0. Additional Definitions. 14 | 15 | As used herein, "this License" refers to version 3 of the GNU Lesser 16 | General Public License, and the "GNU GPL" refers to version 3 of the GNU 17 | General Public License. 18 | 19 | "The Library" refers to a covered work governed by this License, 20 | other than an Application or a Combined Work as defined below. 21 | 22 | An "Application" is any work that makes use of an interface provided 23 | by the Library, but which is not otherwise based on the Library. 24 | Defining a subclass of a class defined by the Library is deemed a mode 25 | of using an interface provided by the Library. 26 | 27 | A "Combined Work" is a work produced by combining or linking an 28 | Application with the Library. The particular version of the Library 29 | with which the Combined Work was made is also called the "Linked 30 | Version". 31 | 32 | The "Minimal Corresponding Source" for a Combined Work means the 33 | Corresponding Source for the Combined Work, excluding any source code 34 | for portions of the Combined Work that, considered in isolation, are 35 | based on the Application, and not on the Linked Version. 36 | 37 | The "Corresponding Application Code" for a Combined Work means the 38 | object code and/or source code for the Application, including any data 39 | and utility programs needed for reproducing the Combined Work from the 40 | Application, but excluding the System Libraries of the Combined Work. 41 | 42 | 1. Exception to Section 3 of the GNU GPL. 43 | 44 | You may convey a covered work under sections 3 and 4 of this License 45 | without being bound by section 3 of the GNU GPL. 46 | 47 | 2. Conveying Modified Versions. 48 | 49 | If you modify a copy of the Library, and, in your modifications, a 50 | facility refers to a function or data to be supplied by an Application 51 | that uses the facility (other than as an argument passed when the 52 | facility is invoked), then you may convey a copy of the modified 53 | version: 54 | 55 | a) under this License, provided that you make a good faith effort to 56 | ensure that, in the event an Application does not supply the 57 | function or data, the facility still operates, and performs 58 | whatever part of its purpose remains meaningful, or 59 | 60 | b) under the GNU GPL, with none of the additional permissions of 61 | this License applicable to that copy. 62 | 63 | 3. Object Code Incorporating Material from Library Header Files. 64 | 65 | The object code form of an Application may incorporate material from 66 | a header file that is part of the Library. You may convey such object 67 | code under terms of your choice, provided that, if the incorporated 68 | material is not limited to numerical parameters, data structure 69 | layouts and accessors, or small macros, inline functions and templates 70 | (ten or fewer lines in length), you do both of the following: 71 | 72 | a) Give prominent notice with each copy of the object code that the 73 | Library is used in it and that the Library and its use are 74 | covered by this License. 75 | 76 | b) Accompany the object code with a copy of the GNU GPL and this license 77 | document. 78 | 79 | 4. Combined Works. 80 | 81 | You may convey a Combined Work under terms of your choice that, 82 | taken together, effectively do not restrict modification of the 83 | portions of the Library contained in the Combined Work and reverse 84 | engineering for debugging such modifications, if you also do each of 85 | the following: 86 | 87 | a) Give prominent notice with each copy of the Combined Work that 88 | the Library is used in it and that the Library and its use are 89 | covered by this License. 90 | 91 | b) Accompany the Combined Work with a copy of the GNU GPL and this license 92 | document. 93 | 94 | c) For a Combined Work that displays copyright notices during 95 | execution, include the copyright notice for the Library among 96 | these notices, as well as a reference directing the user to the 97 | copies of the GNU GPL and this license document. 98 | 99 | d) Do one of the following: 100 | 101 | 0) Convey the Minimal Corresponding Source under the terms of this 102 | License, and the Corresponding Application Code in a form 103 | suitable for, and under terms that permit, the user to 104 | recombine or relink the Application with a modified version of 105 | the Linked Version to produce a modified Combined Work, in the 106 | manner specified by section 6 of the GNU GPL for conveying 107 | Corresponding Source. 108 | 109 | 1) Use a suitable shared library mechanism for linking with the 110 | Library. A suitable mechanism is one that (a) uses at run time 111 | a copy of the Library already present on the user's computer 112 | system, and (b) will operate properly with a modified version 113 | of the Library that is interface-compatible with the Linked 114 | Version. 115 | 116 | e) Provide Installation Information, but only if you would otherwise 117 | be required to provide such information under section 6 of the 118 | GNU GPL, and only to the extent that such information is 119 | necessary to install and execute a modified version of the 120 | Combined Work produced by recombining or relinking the 121 | Application with a modified version of the Linked Version. (If 122 | you use option 4d0, the Installation Information must accompany 123 | the Minimal Corresponding Source and Corresponding Application 124 | Code. If you use option 4d1, you must provide the Installation 125 | Information in the manner specified by section 6 of the GNU GPL 126 | for conveying Corresponding Source.) 127 | 128 | 5. Combined Libraries. 129 | 130 | You may place library facilities that are a work based on the 131 | Library side by side in a single library together with other library 132 | facilities that are not Applications and are not covered by this 133 | License, and convey such a combined library under terms of your 134 | choice, if you do both of the following: 135 | 136 | a) Accompany the combined library with a copy of the same work based 137 | on the Library, uncombined with any other library facilities, 138 | conveyed under the terms of this License. 139 | 140 | b) Give prominent notice with the combined library that part of it 141 | is a work based on the Library, and explaining where to find the 142 | accompanying uncombined form of the same work. 143 | 144 | 6. Revised Versions of the GNU Lesser General Public License. 145 | 146 | The Free Software Foundation may publish revised and/or new versions 147 | of the GNU Lesser General Public License from time to time. Such new 148 | versions will be similar in spirit to the present version, but may 149 | differ in detail to address new problems or concerns. 150 | 151 | Each version is given a distinguishing version number. If the 152 | Library as you received it specifies that a certain numbered version 153 | of the GNU Lesser General Public License "or any later version" 154 | applies to it, you have the option of following the terms and 155 | conditions either of that published version or of any later version 156 | published by the Free Software Foundation. If the Library as you 157 | received it does not specify a version number of the GNU Lesser 158 | General Public License, you may choose any version of the GNU Lesser 159 | General Public License ever published by the Free Software Foundation. 160 | 161 | If the Library as you received it specifies that a proxy can decide 162 | whether future versions of the GNU Lesser General Public License shall 163 | apply, that proxy's public statement of acceptance of any version is 164 | permanent authorization for you to choose that version for the 165 | Library. 166 | 167 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # gmod-csharp-binary-module 2 | C# binary module for Garry's Mod. 3 | --------------------------------------------------------------------------------