G.IncludeClientFile

From GMod Wiki

Jump to: navigation, search
Function
Syntax IncludeClientFile( String filepath )
Where is this used?
Description:
Convenience function used in shared files
If called serverside the filepath is passed on to AddCSLuaFile.
If called clientside the filepath is passed on to include.
Returns: nil
Part of Library: Global Functions
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=G.IncludeClientFile]G.IncludeClientFile [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionA demonstration of this function's awesome space saving abilities.
Used onNewerShared.png
Code
IncludeClientFile("myFirstScript.lua")
 
// Does the same job as...
 
if SERVER then
	AddCSLuaFile("myFirstScript.lua")
else
	include("myFirstScript.lua")
end
OutputYour file is downloaded and included by clients


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox