aboutsummaryrefslogtreecommitdiff
path: root/gamemode/core/clienteffects/sv_effects.lua
blob: d3640685e3b9c5931fca9ee704c9454862757e9c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
---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
	net.WriteString(name)
	net.WriteUInt(dlen,32)
	net.WriteData(data,dlen)
	net.Send(ply)
end

return ed