diff options
| author | Alexander Pickering <alexandermpickering@gmail.com> | 2016-11-27 22:02:47 -0500 |
|---|---|---|
| committer | Alexander Pickering <alexandermpickering@gmail.com> | 2016-11-27 22:02:47 -0500 |
| commit | 2c4329e2b6e19182a441f79a5c3010011f8ae767 (patch) | |
| tree | e4d8cd88690bed4cfacf2d4df39bdeed97b376f8 /gamemode/core/clienteffects | |
| parent | 5f2a8015bd5d2a42e79038bb52f20260d8d97ba0 (diff) | |
| download | artery-2c4329e2b6e19182a441f79a5c3010011f8ae767.tar.gz artery-2c4329e2b6e19182a441f79a5c3010011f8ae767.tar.bz2 artery-2c4329e2b6e19182a441f79a5c3010011f8ae767.zip | |
Vairous updates
Diffstat (limited to 'gamemode/core/clienteffects')
| -rw-r--r-- | gamemode/core/clienteffects/cl_effects.lua | 12 | ||||
| -rw-r--r-- | gamemode/core/clienteffects/sh_effects.lua | 10 | ||||
| -rw-r--r-- | gamemode/core/clienteffects/sv_effects.lua | 11 |
3 files changed, 33 insertions, 0 deletions
diff --git a/gamemode/core/clienteffects/cl_effects.lua b/gamemode/core/clienteffects/cl_effects.lua new file mode 100644 index 0000000..d51cf7d --- /dev/null +++ b/gamemode/core/clienteffects/cl_effects.lua @@ -0,0 +1,12 @@ + +local effects = {} +effects["weapon_blocked"] = function() + util.ScreenShake( LocalPlayer():GetPos(), 3, 3, 0.25, 100 ) +end + +net.Receive("art_clienteffect",function() + local effectid = net.ReadUInt(32) + local effectname = ART.screen_effect_ids[effectid] + print("Got effect name",effectname) + effects[effectname]() +end) diff --git a/gamemode/core/clienteffects/sh_effects.lua b/gamemode/core/clienteffects/sh_effects.lua new file mode 100644 index 0000000..70f3a79 --- /dev/null +++ b/gamemode/core/clienteffects/sh_effects.lua @@ -0,0 +1,10 @@ +ART = ART or {} + +ART.screen_effect_ids = { + "weapon_blocked" +} + +ART.screen_effect_names = {} +for k,v in pairs(ART.screen_effect_ids) do + ART.screen_effect_names[v] = k +end diff --git a/gamemode/core/clienteffects/sv_effects.lua b/gamemode/core/clienteffects/sv_effects.lua new file mode 100644 index 0000000..2a8e083 --- /dev/null +++ b/gamemode/core/clienteffects/sv_effects.lua @@ -0,0 +1,11 @@ + +ART = ART or {} + +util.AddNetworkString("art_clienteffect") + +ART.ApplyEffect = function(who,effectname) + assert(ART.screen_effect_names[effectname] ~= nil,"Attempted to call a nil effect name:" .. effectname .. ". Valid effect names:" .. table.concat(ART.screen_effect_ids,",")) + net.Start("art_clienteffect") + net.WriteUInt(ART.screen_effect_names[effectname],32) + net.Send(who) +end |
