Global/AddCSLuaFile

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
(Changed how Namespace works - pass it the link yourself)
(Fixed wording, changed argument to optional (as in GMod 13))
Line 8: Line 8:
  
 
  | Name = AddCSLuaFile
 
  | Name = AddCSLuaFile
  | Description = Adds a Lua file to the list for clients to download when they join the server.
+
  | Description = Marks a Lua file to be sent to clients when they join the server.
 
  | Returns =  
 
  | Returns =  
 
  | Arg1Name = file
 
  | Arg1Name = file
 
  | Arg1Type = string
 
  | Arg1Type = string
  | Arg1Req = true
+
  | Arg1Req = false
  | Arg1Desc = The name/path (relative from the lua folder) to the Lua file that should be included.
+
  | Arg1Desc = The name/path (relative to the garrysmod/lua folder) to the Lua file that should be sent.
 
}}
 
}}
  
Line 25: Line 25:
 
==Additional Notes==
 
==Additional Notes==
 
* The file name and path cannot include ".."
 
* The file name and path cannot include ".."
* The path is relative to the lua folder
+
* The path is relative to the garrysmod/lua folder
 
* You still need to [[Global/include|include]] the file to use it client-side
 
* You still need to [[Global/include|include]] the file to use it client-side
 +
* If you call this function with no arguments it will add the current file.

Revision as of 15:45, 5 August 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