Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
538
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.47 KB | None | 0 0
  1. --[[
  2. © 2013 CloudSixteen.com do not share, re-distribute or modify
  3. without permission of its author (kurozael@gmail.com).
  4. --]]
  5.  
  6. local AddCSLuaFile = AddCSLuaFile;
  7. local IsValid = IsValid;
  8. local pairs = pairs;
  9. local pcall = pcall;
  10. local string = string;
  11. local table = table;
  12. local game = game;
  13.  
  14. --[[
  15. Past Contributors:
  16. Impulse (impulsh@gmail.com)
  17. Alex (gristhavoc@gmail.com)
  18. --]]
  19.  
  20. if (!Clockwork) then
  21. Clockwork = GM;
  22. else
  23. CurrentGM = Clockwork;
  24. table.Merge(CurrentGM, GM);
  25. Clockwork = nil;
  26.  
  27. Clockwork = GM;
  28. table.Merge(Clockwork, CurrentGM);
  29. CurrentGM = nil;
  30. end;
  31.  
  32. Clockwork.Name = "Clockwork";
  33. Clockwork.Email = "gristhavoc@gmail.com";
  34. Clockwork.Author = "Mr. Brightside";
  35. Clockwork.Website = "http://alexgrist.com";
  36. Clockwork.KernelVersion = "1.0";
  37. Clockwork.SchemaFolder = Clockwork.SchemaFolder or GM.Folder;
  38. Clockwork.ClockworkFolder = Clockwork.ClockworkFolder or GM.Folder;
  39.  
  40. --[[
  41. Do not edit this function. Editing this function will cause
  42. the schema to not function, and CloudAuthX will not
  43. auth you.
  44. --]]
  45. function Clockwork:GetGameDescription()
  46. local schemaName = self.kernel:GetSchemaGamemodeName();
  47. return "Insert Gamemode Name Here!";
  48. end;
  49.  
  50. AddCSLuaFile("cl_kernel.lua");
  51. AddCSLuaFile("sh_kernel.lua");
  52. AddCSLuaFile("sh_enum.lua");
  53. AddCSLuaFile("sh_boot.lua");
  54. include("sh_enum.lua");
  55. include("sh_kernel.lua");
  56.  
  57. if (CLIENT) then
  58. if (CW_SCRIPT_SHARED) then
  59. CW_SCRIPT_SHARED = Clockwork.kernel:Deserialize(CW_SCRIPT_SHARED);
  60. else
  61. CW_SCRIPT_SHARED = {};
  62. end;
  63. end;
  64.  
  65. if (CW_SCRIPT_SHARED.schemaFolder) then
  66. Clockwork.SchemaFolder = CW_SCRIPT_SHARED.schemaFolder;
  67. end;
  68.  
  69. if (!game.GetWorld) then
  70. game.GetWorld = function() return Entity(0); end;
  71. end;
  72.  
  73. --[[ These are aliases to avoid variable name conflicts. --]]
  74. cwPlayer, cwTeam, cwFile = player, team, file;
  75. _player, _team, _file = player, team, file;
  76.  
  77. --[[ These are libraries that we want to load before any others. --]]
  78. Clockwork.kernel:IncludePrefixed("libraries/sv_file.lua");
  79. Clockwork.kernel:IncludeDirectory("libraries/", true);
  80. Clockwork.kernel:IncludeDirectory("directory/", true);
  81. Clockwork.kernel:IncludeDirectory("translations/", true);
  82. Clockwork.kernel:IncludeDirectory("config/", true);
  83. Clockwork.kernel:IncludePlugins("plugins/", true);
  84. Clockwork.kernel:IncludeDirectory("system/", true);
  85. Clockwork.kernel:IncludeDirectory("items/", true);
  86. Clockwork.kernel:IncludeDirectory("derma/", true);
  87.  
  88. --[[ The following code is loaded by CloudAuthX. --]]
  89. if (SERVER) then include("sv_cloudax.lua"); end;
  90.  
  91. --[[ The following code is loaded over-the-Cloud. --]]
  92. if (SERVER and Clockwork.LoadPreSchemaExternals) then
  93. Clockwork:LoadPreSchemaExternals();
  94. end;
  95.  
  96. --[[ Load the schema and let any plugins know about it. --]]
  97. Clockwork.kernel:IncludeSchema();
  98. Clockwork.plugin:Call("ClockworkSchemaLoaded");
  99.  
  100. --[[ The following code is loaded over-the-Cloud. --]]
  101. if (SERVER and Clockwork.LoadPostSchemaExternals) then
  102. Clockwork:LoadPostSchemaExternals();
  103. end;
  104.  
  105. if (CLIENT) then
  106. Clockwork.plugin:Call("ClockworkLoadShared", CW_SCRIPT_SHARED);
  107. end;
  108.  
  109. Clockwork.kernel:IncludeDirectory("commands/", true);
  110.  
  111. -- Called when the Clockwork shared variables are added.
  112. function Clockwork:ClockworkAddSharedVars(globalVars, playerVars)
  113. playerVars:Number("InvWeight", true);
  114. playerVars:Number("MaxHP", true);
  115. playerVars:Number("MaxAP", true);
  116. playerVars:Number("IsDrunk", true);
  117. playerVars:Number("Wages", true);
  118. playerVars:Number("Cash", true);
  119. playerVars:Number("ForceAnim");
  120. playerVars:Number("IsRagdoll");
  121. playerVars:Bool("TargetKnows", true);
  122. playerVars:Bool("FallenOver", true);
  123. playerVars:Bool("CharBanned", true);
  124. playerVars:String("Clothes", true);
  125. playerVars:String("Model", true);
  126. globalVars:String("NoMySQL");
  127. globalVars:String("Date");
  128. globalVars:Number("Minute");
  129. globalVars:Number("Hour");
  130. globalVars:Number("Day");
  131. end;
  132.  
  133. Clockwork.plugin:Call("ClockworkAddSharedVars",
  134. Clockwork.kernel:GetSharedVars():Global(true),
  135. Clockwork.kernel:GetSharedVars():Player(true)
  136. );
  137.  
  138. Clockwork.plugin:IncludeEffects("clockwork/framework");
  139. Clockwork.plugin:IncludeWeapons("clockwork/framework");
  140. Clockwork.plugin:IncludeEntities("clockwork/framework");
  141.  
  142. if (SERVER) then
  143. Clockwork.plugin:Call("ClockworkSaveShared", CW_SCRIPT_SHARED);
  144.  
  145. local scriptShared = "CW_SCRIPT_SHARED = [["..Clockwork.kernel:Serialize(CW_SCRIPT_SHARED).."]];";
  146. Clockwork.file:Write("lua/clockwork.lua", scriptShared);
  147.  
  148. AddCSLuaFile("clockwork.lua");
  149. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement