Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
355
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.00 KB | None | 0 0
  1. --[[
  2. © 2015 CloudSixteen.com do not share, re-distribute or modify
  3. without permission of its author (kurozael@gmail.com).
  4.  
  5. Clockwork was created by Conna Wiles (also known as kurozael.)
  6. http://cloudsixteen.com/license/clockwork.html
  7. --]]
  8.  
  9. local AddCSLuaFile = AddCSLuaFile;
  10. local IsValid = IsValid;
  11. local pairs = pairs;
  12. local pcall = pcall;
  13. local string = string;
  14. local table = table;
  15. local game = game;
  16.  
  17. if (!Clockwork) then
  18. Clockwork = GM;
  19. else
  20. CurrentGM = Clockwork;
  21. table.Merge(CurrentGM, GM);
  22. Clockwork = nil;
  23.  
  24. Clockwork = GM;
  25. table.Merge(Clockwork, CurrentGM);
  26. CurrentGM = nil;
  27. end;
  28.  
  29. Clockwork.ClockworkFolder = Clockwork.ClockworkFolder or GM.Folder;
  30. Clockwork.SchemaFolder = Clockwork.SchemaFolder or GM.Folder;
  31. Clockwork.KernelVersion = "0.96.6";
  32. Clockwork.KernelBuild = "alpha"
  33. Clockwork.DeveloperVersion = true;
  34. Clockwork.Website = "http://kurozael.com";
  35. Clockwork.Author = "kurozael";
  36. Clockwork.Email = "kurozael@gmail.com";
  37. Clockwork.Name = "Clockwork";
  38.  
  39. --[[ Check if we are using the right CloudAuthX version. --]]
  40. if (SERVER and CloudAuthX.GetVersion() < 12) then
  41. for i = 1, 3 do
  42. Error("[CloudAuthX] Clockwork requires an updated CloudAuthX .dll or .so!\n");
  43. end;
  44. end;
  45.  
  46. --[[
  47. Do not edit this function. Editing this function will cause
  48. the schema to not function, and CloudAuthX will not
  49. auth you.
  50. --]]
  51. function Clockwork:GetGameDescription()
  52. local schemaName = self.kernel:GetSchemaGamemodeName();
  53. return "CW: "..schemaName;
  54. end;
  55.  
  56. AddCSLuaFile("cl_kernel.lua");
  57. AddCSLuaFile("cl_theme.lua");
  58. AddCSLuaFile("sh_kernel.lua");
  59. --AddCSLuaFile("sh_fixes.lua");
  60. AddCSLuaFile("sh_enum.lua");
  61. AddCSLuaFile("sh_boot.lua");
  62. include("sh_enum.lua");
  63. --include("sh_fixes.lua");
  64. include("sh_kernel.lua");
  65.  
  66. if (CLIENT) then
  67. if (CW_SCRIPT_SHARED) then
  68. CW_SCRIPT_SHARED = Clockwork.kernel:Deserialize(CW_SCRIPT_SHARED);
  69. else
  70. CW_SCRIPT_SHARED = {};
  71. end;
  72.  
  73. if (CW_SCRIPT_SHARED.clientCode) then
  74. RunString(CW_SCRIPT_SHARED.clientCode);
  75. end;
  76. end;
  77.  
  78. if (CW_SCRIPT_SHARED.schemaFolder) then
  79. Clockwork.SchemaFolder = CW_SCRIPT_SHARED.schemaFolder;
  80. end;
  81.  
  82. if (!game.GetWorld) then
  83. game.GetWorld = function() return Entity(0); end;
  84. end;
  85.  
  86. --[[ These are aliases to avoid variable name conflicts. --]]
  87. cwPlayer, cwTeam, cwFile = player, team, file;
  88. _player, _team, _file = player, team, file;
  89. library, lib = cwLibrary, cwLib;
  90.  
  91. --[[ These are libraries that we want to load before any others. --]]
  92. Clockwork.kernel:IncludePrefixed("libraries/server/sv_file.lua");
  93.  
  94. if (SERVER) then CloudAuthX.Authenticate(); end;
  95.  
  96. Clockwork.kernel:IncludeDirectory("libraries/server", true);
  97. Clockwork.kernel:IncludeDirectory("libraries/client", true);
  98. Clockwork.kernel:IncludeDirectory("libraries/", true);
  99. Clockwork.kernel:IncludePrefixed("cl_theme.lua");
  100. Clockwork.kernel:IncludeDirectory("language/", true);
  101. Clockwork.kernel:IncludeDirectory("directory/", true);
  102. Clockwork.kernel:IncludeDirectory("config/", true);
  103. Clockwork.kernel:IncludePlugins("plugins/", true);
  104. Clockwork.kernel:IncludeDirectory("system/", true);
  105. Clockwork.kernel:IncludeDirectory("items/", true);
  106. Clockwork.kernel:IncludeDirectory("derma/", true);
  107.  
  108. --[[ The following code is loaded by CloudAuthX. --]]
  109. if (SERVER) then include("sv_cloudax.lua"); end;
  110.  
  111. --[[ The following code is loaded over-the-Cloud. --]]
  112. if (SERVER and Clockwork.LoadPreSchemaExternals) then
  113. Clockwork:LoadPreSchemaExternals();
  114. end;
  115.  
  116. --[[ Load the schema and let any plugins know about it. --]]
  117. Clockwork.kernel:IncludeSchema();
  118. Clockwork.plugin:Call("ClockworkSchemaLoaded");
  119.  
  120. if (SERVER) then
  121. MsgC(Color(0, 255, 100, 255), "[Clockwork] Schema \""..Schema:GetName().."\" ["..Clockwork.kernel:GetSchemaGamemodeVersion().."] by "..Schema:GetAuthor().." loaded!\n");
  122. end;
  123.  
  124. --[[ The following code is loaded over-the-Cloud. --]]
  125. if (SERVER and Clockwork.LoadPostSchemaExternals) then
  126. Clockwork:LoadPostSchemaExternals();
  127. end;
  128.  
  129. if (CLIENT) then
  130. Clockwork.plugin:Call("ClockworkLoadShared", CW_SCRIPT_SHARED);
  131. end;
  132.  
  133. Clockwork.kernel:IncludeDirectory("commands/", true);
  134.  
  135. Clockwork.player:AddCharacterData("PhysDesc", NWTYPE_STRING, "");
  136. Clockwork.player:AddPlayerData("Language", NWTYPE_STRING, "English", true);
  137.  
  138. -- Called when the Clockwork shared variables are added.
  139. function Clockwork:ClockworkAddSharedVars(globalVars, playerVars)
  140. for k, v in pairs(self.player.characterData) do
  141. playerVars:Add(k, v.nwType, v.playerOnly);
  142. end;
  143.  
  144. for k, v in pairs(self.player.playerData) do
  145. playerVars:Add(k, v.nwType, v.playerOnly);
  146. end;
  147.  
  148. playerVars:Number("InvWeight", true);
  149. playerVars:Number("InvSpace", true);
  150. playerVars:Number("MaxHP");
  151. playerVars:Number("MaxAP");
  152. playerVars:Number("IsDrunk", true);
  153. playerVars:Number("Wages", true);
  154. playerVars:Number("Cash", true);
  155. playerVars:Number("ActDuration");
  156. playerVars:Number("ForceAnim");
  157. playerVars:Number("IsRagdoll");
  158. playerVars:Number("Faction");
  159. playerVars:Number("Gender");
  160. playerVars:Number("Key");
  161. playerVars:Bool("TargetKnows", true);
  162. playerVars:Bool("FallenOver", true);
  163. playerVars:Bool("CharBanned", true);
  164. playerVars:Bool("IsWepRaised");
  165. playerVars:Bool("Initialized");
  166. playerVars:Bool("IsJogMode");
  167. playerVars:Bool("IsRunMode");
  168. playerVars:String("Clothes", true);
  169. playerVars:String("Model", true);
  170. playerVars:String("ActName");
  171. playerVars:String("flags");
  172. playerVars:String("Flags");
  173. playerVars:String("Name");
  174. playerVars:String("icon");
  175. playerVars:Entity("Ragdoll");
  176. playerVars:Float("StartActTime");
  177. globalVars:String("NoMySQL");
  178. globalVars:String("Date");
  179. globalVars:Number("Minute");
  180. globalVars:Number("Hour");
  181. globalVars:Number("Day");
  182. end;
  183.  
  184. Clockwork.plugin:Call("ClockworkAddSharedVars",
  185. Clockwork.kernel:GetSharedVars():Global(true),
  186. Clockwork.kernel:GetSharedVars():Player(true)
  187. );
  188.  
  189. Clockwork.plugin:IncludeEffects("Clockwork/framework");
  190. Clockwork.plugin:IncludeWeapons("Clockwork/framework");
  191. Clockwork.plugin:IncludeEntities("Clockwork/framework");
  192.  
  193. if (SERVER) then CloudAuthX.Initialize(); end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement