Advertisement
Angrypeppermushroom

Sequences > Activities

Aug 31st, 2015
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.75 KB | None | 0 0
  1. //CALL SetUpActivities ONLY AFTER YOUR MODEL HAS BEEN SET - IF NOT DONE THIS WAY, YOU WILL BE FACED WITH ERRORS!
  2.  
  3. ENT.m_tbActivities = {}
  4.  
  5. ENT.m_tbSeqActs = {
  6. ["ACT_EXAMPLE"] = "example",
  7. } //If example is a sequence and it has an ACT_ assigned to it, you will get self.m_tbActivities["ACT_EXAMPLE"] = <activity number>
  8.  
  9. function ENT:SetUpActivities(tbIdx)
  10.     for k,v in pairs(tbIdx) do
  11.         local tb = self:GetSequenceInfo(self:GetSequenceID(v))
  12.         self.m_tbActivities[k] = tb.activity
  13.     end
  14. end
  15.  
  16. function ENT:GetSequenceID(str)
  17.     local tb = self:GetSequenceList()
  18.     local i = 0
  19.  
  20.     for k,v in ipairs(tb) do
  21.         if v == str then
  22.             i = k; break
  23.         end
  24.     end
  25.  
  26.     return i
  27. end
  28.  
  29. function ENT:GetSpecialAnimation(strAct)
  30.     return self.m_tbActivities[strAct]
  31. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement