Global/AddCSLuaFile

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
(Fixed wording, changed argument to optional (as in GMod 13))
m (Fixed spacing)
Line 1: Line 1:
 
{{Function
 
{{Function
| Name = AddCSLuaFile
+
| Name = AddCSLuaFile
| Namespace = [[Global]]
+
| Namespace = [[Global]]
| Realm = Server
+
| Realm = Server
 
}}
 
}}
  
 
{{Syntax
 
{{Syntax
 +
| Name = AddCSLuaFile
 +
| Description = Marks a Lua file to be sent to clients when they join the server.
  
| Name = AddCSLuaFile
+
| Arg1Name = file
| Description = Marks a Lua file to be sent to clients when they join the server.
+
| Arg1Type = string
| Returns =
+
| Arg1Req = false
| Arg1Name = file
+
| Arg1Desc = The name/path (relative to the garrysmod/lua folder) to the Lua file that should be sent.
| Arg1Type = string
+
| Arg1Req = false
+
| Arg1Desc = The name/path (relative to the garrysmod/lua folder) to the Lua file that should be sent.
+
 
}}
 
}}
  
 
==Examples==
 
==Examples==
 
{{Example
 
{{Example
| Description = Adds the cl_init.lua file in the "lua" folder to be downloaded by connecting clients.
+
| Description = Adds the cl_init.lua file in the "lua" folder to be downloaded by connecting clients.
| Code = AddCSLuaFile( "cl_init.lua" )
+
| Code = AddCSLuaFile( "cl_init.lua" )
| Output =  
+
| Output =  
 
}}
 
}}
  

Revision as of 11:59, 8 September 2012

Template:Function

Template:Syntax

Contents

Examples

Examples

Example

Adds the cl_init.lua file in the "lua" folder to be downloaded by connecting clients.

AddCSLuaFile( "cl_init.lua" )


Additional Notes

  • The file name and path cannot include ".."
  • The path is relative to the garrysmod/lua folder
  • You still need to include the file to use it client-side
  • If you call this function with no arguments it will add the current file.
Personal tools
Navigation