aboutsummaryrefslogtreecommitdiff
path: root/gamemode/shared/synchronize.lua
diff options
context:
space:
mode:
Diffstat (limited to 'gamemode/shared/synchronize.lua')
-rw-r--r--gamemode/shared/synchronize.lua22
1 files changed, 22 insertions, 0 deletions
diff --git a/gamemode/shared/synchronize.lua b/gamemode/shared/synchronize.lua
new file mode 100644
index 0000000..126c616
--- /dev/null
+++ b/gamemode/shared/synchronize.lua
@@ -0,0 +1,22 @@
+
+if (SERVER) then
+ util.AddNetworkString("LoadEntity_WS")
+
+ net.Receive("LoadEntity_WS",function(siz,pl)
+ local Ab = net.ReadEntity()
+
+ if (Ab:IsPlayer()) then
+ Ab:UpdateSelection(pl)
+ --pl:UpdateStream(Ab)
+ end
+ end)
+else
+ local Q = 0
+ function GM:NetworkEntityCreated(ent)
+ Q=Q+1
+ timer.Simple(math.Rand(0.1,0.2)*Q,function()
+ net.Start("LoadEntity_WS") net.WriteEntity(ent) net.SendToServer()
+ Q=Q-1
+ end)
+ end
+end \ No newline at end of file