Advertisement
Guest User

Untitled

a guest
Aug 30th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. AddCSLuaFile()
  2. ENT.Base = "base_anim"
  3. ENT.Type = "anim"
  4. ENT.PrintName = "shiddy"
  5. ENT.Author = "cossack"
  6. ENT.Category = "mainboard blues"
  7. ENT.Spawnable = true
  8. ENT.AdminOnly = true
  9. ENT.PhysgunDisable = true
  10. ENT.PhysgunAllowAdmin = true
  11.  
  12. if SERVER then
  13. function ENT:SpawnFunction(client, trace)
  14. local entity = ents.Create(className)
  15. entity:SetPos(trace.HitPos + Vector(0,0,50))
  16. entity:SetAngles(trace.HitNormal:Angle())
  17. entity:Spawn()
  18. entity:Activate()
  19. end
  20. end
  21.  
  22. function ENT:Initialize()
  23. self:SetModel("models/props_junk/wood_crate001a.mdl")
  24. self:PhysicsInit(SOLID_VPHYSICS)
  25. self:SetSolid(SOLID_VPHYSICS)
  26. self:SetMoveType(MOVETYPE_VPHYSICS)
  27. self:DrawShadow(false)
  28. local phys = self:GetPhysicsObject()
  29. if phys:IsValid() then
  30. phys:Wake()
  31. end
  32. end
  33.  
  34. else
  35. function ENT:Draw()
  36. -- Draw Model.
  37. self:DrawModel()
  38. local angles = self:GetAngles()
  39. local vector = self:GetPos()
  40.  
  41. cam.Start3D2D(vector, angles, 1)
  42. surface.SetDrawColor( Color( 255, 165, 0, 255 ) )
  43. surface.DrawRect( 0, 0, 8, 8 )
  44. cam.End3D2D
  45.  
  46. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement