diff options
Diffstat (limited to 'gamemode/core/clienteffects')
| -rw-r--r-- | gamemode/core/clienteffects/cl_effects.lua | 8 | ||||
| -rw-r--r-- | gamemode/core/clienteffects/sv_effects.lua | 8 |
2 files changed, 16 insertions, 0 deletions
diff --git a/gamemode/core/clienteffects/cl_effects.lua b/gamemode/core/clienteffects/cl_effects.lua index 368c34a..db84b24 100644 --- a/gamemode/core/clienteffects/cl_effects.lua +++ b/gamemode/core/clienteffects/cl_effects.lua @@ -1,7 +1,15 @@ +---A registry of client-side effects. +-- Use this to register effects to be called with sv_effects.lua +--@module cl_effects.lua + local log = nrequire("log.lua") local er = {} --master table of effects local effects = {} +---Register an effect. +-- Registers an effect that can later be applied to the player +--@tparam string name The name of the effect +--@tparam function func The function to call when the effect is applied function er.RegisterEffect(name,func) if effects[name] ~= nil then log.warn("Effect \"" .. name .. "\" already registered, replaceing...") diff --git a/gamemode/core/clienteffects/sv_effects.lua b/gamemode/core/clienteffects/sv_effects.lua index cc3039f..d364068 100644 --- a/gamemode/core/clienteffects/sv_effects.lua +++ b/gamemode/core/clienteffects/sv_effects.lua @@ -1,6 +1,14 @@ +---A way to apply effects on players. +-- Also see cl_effects.lua +--@module sv_effects.lua local ed = {} +---Apply an effect to the player. +-- Send a message to a player, saying they should have an effects +--@tparam player ply The player to apply the effect to +--@tparam string name The name of the effect to apply +--@tparam string data Data to send for the effect (can be "") function ed.SendEffect(ply,name,data) net.Start("art_clienteffect") local dlen = #data |
