blob: b8cec566e6cc1cbce90928cd2d9471deeaa7cb32 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
nrequire("sh_animations.lua")
local meta = FindMetaTable("Player")
util.AddNetworkString("art_start_animation")
util.AddNetworkString("art_stop_animation")
util.AddNetworkString("art_start_sequence")
util.AddNetworkString("art_end_sequence")
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
local sequences = {}
function meta:StartSequence(name,untilstoped,speed)
untilstoped = untilstoped or false
speed = speed or 1
local seq, time = self:LookupSequence(name)
sequences[self] = sequences[self] or {}
if untilstoped then
sequences[self] = {CurTime() + 9999999, seq, speed}
else
sequences[self] = {CurTime() + time, seq, speed}
end
self:SetCycle(0)
net.Start("art_start_sequence")
net.WriteEntity(self)
net.WriteUInt(seq,31)
net.WriteFloat(time)
net.WriteBool(untilstoped)
net.WriteFloat(speed)
net.Broadcast()
end
function meta:EndSequence(name)
sequences[self] = nil
net.Start("art_end_sequence")
net.WriteEntity(self)
net.Broadcast()
end
return sequences
|