Advertisement
r4k0

Untitled

Aug 23rd, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. AddCSLuaFile("cl_init.lua")
  2. AddCSLuaFile("shared.lua")
  3.  
  4. include("shared.lua")
  5.  
  6. function ENT:Initialize()
  7. self:SetModel("models/maxofs2d/button_02.mdl")
  8. self:PhysicsInit(SOLID_VPHYSICS)
  9. self:SetMoveType(MOVETYPE_NONE)
  10. self:SetSolid(SOLID_VPHYSICS)
  11. self:SetUseType(SIMPLE_USE)
  12. self:DropToFloor()
  13. local phys = self:GetPhysicsObject()
  14.  
  15. if phys:IsValid() then
  16.  
  17. phys:Wake()
  18.  
  19. end
  20.  
  21. end
  22.  
  23. function ENT:Use(act,call)
  24.  
  25. if not IsValid(self:GetParent()) then self:Remove() return end
  26.  
  27. local amb = self:GetParent()
  28.  
  29. if not ConfigurationMedicMod.Vehicles[amb:GetModel()] then self:Remove() return end
  30.  
  31. if not IsValid( amb.Stretcher ) then return end
  32.  
  33. if not IsValid(call) and not table.HasValue(ConfigurationMedicMod.MedicTeams, call:Team()) then return end
  34.  
  35. local stretcher = amb.Stretcher
  36.  
  37. stretcher:SetParent( nil )
  38. stretcher:SetPos(amb:LocalToWorld(ConfigurationMedicMod.Vehicles[amb:GetModel()].backPos))
  39. stretcher:SetColor(Color(255,255,255,255))
  40.  
  41. amb.Stretcher = nil
  42.  
  43.  
  44. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement