aboutsummaryrefslogtreecommitdiff
path: root/gamemode/core/animation
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2018-03-23 20:20:40 -0400
committerAlexander Pickering <alexandermpickering@gmail.com>2018-03-23 20:20:40 -0400
commite2428796b9afe019ae6ca45e07fbe1aaa6963917 (patch)
treeb6514bbf349a99ebd3e999a3811ab6f0fa52851b /gamemode/core/animation
parentc132bf1fa77a0b01b18a848db91879383a8210a8 (diff)
downloadartery-e2428796b9afe019ae6ca45e07fbe1aaa6963917.tar.gz
artery-e2428796b9afe019ae6ca45e07fbe1aaa6963917.tar.bz2
artery-e2428796b9afe019ae6ca45e07fbe1aaa6963917.zip
Started working on quest inventory
Diffstat (limited to 'gamemode/core/animation')
-rw-r--r--gamemode/core/animation/cl_animate.lua13
-rw-r--r--gamemode/core/animation/sv_animate.lua21
2 files changed, 34 insertions, 0 deletions
diff --git a/gamemode/core/animation/cl_animate.lua b/gamemode/core/animation/cl_animate.lua
new file mode 100644
index 0000000..fd322a1
--- /dev/null
+++ b/gamemode/core/animation/cl_animate.lua
@@ -0,0 +1,13 @@
+
+net.Receive("art_start_animation",function()
+ local what = net.ReadEntity()
+ local anim = net.ReadString()
+ what:SetupBones()
+ what:SetLuaAnimation(anim)
+end)
+
+net.Receive("art_stop_animation",function()
+ local what = net.ReadEntity()
+ local anim = net.ReadString()
+ what:StopLuaAnimation(anim)
+end)
diff --git a/gamemode/core/animation/sv_animate.lua b/gamemode/core/animation/sv_animate.lua
new file mode 100644
index 0000000..24d0ed0
--- /dev/null
+++ b/gamemode/core/animation/sv_animate.lua
@@ -0,0 +1,21 @@
+
+nrequire("sh_animations.lua")
+
+local meta = FindMetaTable("Player")
+
+util.AddNetworkString("art_start_animation")
+util.AddNetworkString("art_stop_animation")
+
+function meta:StartAnimation(name)
+ net.Start("art_start_animation")
+ net.WriteEntity(self)
+ net.WriteString(name)
+ net.Broadcast()
+end
+
+function meta:StopAnimation(name)
+ net.Start("art_stop_animation")
+ net.WriteEntity(self)
+ net.WriteString(name)
+ net.Broadcast()
+end