Guest User

Untitled

a guest
Dec 12th, 2012
74
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. include("shared.lua")
  2.  
  3. function ENT:Think()
  4.     if not self:GetOwner():Alive() then
  5.         self:SetColor( Color(0,0,0,0) )
  6.         return
  7.     else
  8.         if self:GetOwner():GetNWString( "PModel" ) == "models/player/zombiefast.mdl" || self:GetOwner():GetNWString( "PModel" ) == "models/player/classic.mdl" then
  9.                 self:SetColor( Color(0,0,0,0) )
  10.         else  
  11.                 if LocalPlayer() == self:GetOwner() then
  12.                         self:SetColor( Color(255,255,255,255) )
  13.                 else  
  14.                         self:SetColor( Color(0,0,0,0) )
  15.                 end
  16.         end
  17.     end
  18.  
  19.     NextTime = 1
  20.     if ( CurTime() >= NextTime && !self:GetOwner():Alive() ) then
  21.     self:DrawModel()
  22.     NextTime = CurTime() + 1
  23.     end
  24. end
  25.  
  26. function ENT:Draw()
  27. local owner = self:GetOwner()
  28.  
  29.         if owner:GetRagdollEntity() then
  30.                 owner = owner:GetRagdollEntity()
  31.         elseif not owner:Alive() then self:SetNoDraw( true ) end
  32.  
  33.         local boneindex = owner:LookupBone("ValveBiped.Bip01_Head1")
  34.         if boneindex then
  35.                 local pos, ang = owner:GetBonePosition(boneindex)
  36.                 if pos and pos ~= owner:GetPos() then
  37.                         if owner:GetNWString( "PModel" ) == "models/player/group01/female_06.mdl" then
  38.                                 self:SetPos(pos + ang:Forward()*1 + ang:Right()*-1.3)
  39.                         elseif owner:GetNWString( "PModel" ) == "models/player/group01/female_01.mdl" then
  40.                                 self:SetPos(pos + ang:Forward()*1 + ang:Right()*-1.3)
  41.                         elseif owner:GetNWString( "PModel" ) == "models/player/alyx.mdl" then
  42.                                 self:SetPos(pos + ang:Forward()*1 + ang:Right()*-2.5)
  43.                         elseif owner:GetNWString( "PModel" ) == "models/player/group01/female_07.mdl" then
  44.                                 self:SetPos(pos + ang:Forward()*1 + ang:Right()*-1.3)
  45.                         elseif owner:GetNWString( "PModel" ) == "models/player/hostage/hostage_03.mdl" then
  46.                                 self:SetPos(pos + ang:Forward()*1 + ang:Right()*-1.3)
  47.                         elseif owner:GetNWString( "PModel" ) == "models/player/combine_soldier.mdl" then
  48.                                 self:SetPos(pos + ang:Forward()*1 + ang:Right()*-3.4)
  49.                         elseif owner:GetNWString( "PModel" ) == "models/player/charple01.mdl" then
  50.                                 self:SetPos(pos + ang:Forward()*-1 + ang:Right()*-2)
  51.                         elseif owner:GetNWString( "PModel" ) == "models/player/hostage/hostage_02.mdl" then
  52.                                 self:SetPos(pos + ang:Forward()*1 + ang:Right()*-1)
  53.                         elseif owner:GetNWString( "PModel" ) == "models/player/group01/female_04.mdl" then
  54.                                 self:SetPos(pos + ang:Forward()*1 + ang:Right()*-1.3)
  55.                         elseif owner:GetNWString( "PModel" ) == "models/player/group03/female_06.mdl" then
  56.                                 self:SetPos(pos + ang:Forward()*1 + ang:Right()*-1.3)
  57.                         elseif owner:GetNWString( "PModel" ) == "models/player/gasmask.mdl" then
  58.                                 self:SetPos(pos + ang:Forward()*5 + ang:Right()*-1.5)
  59. elseif owner:GetNWString( "PModel" ) == "models/player/group01/female_02.mdl" then
  60.                                 self:SetPos(pos + ang:Forward()*1 + ang:Right()*-1.3)
  61.                         elseif owner:GetNWString( "PModel" ) == "models/player/gman_high.mdl" then
  62.                                 self:SetPos(pos + ang:Forward()*1.5 + ang:Right()*-1.3)
  63.                         elseif owner:GetNWString( "PModel" ) == "models/player/group03/male_07.mdl" then
  64.                                 self:SetPos(pos + ang:Forward()*1.5 + ang:Right()*-1.3)
  65.                         elseif owner:GetNWString( "PModel" ) == "models/player/group03/female_03.mdl" then
  66.                                 self:SetPos(pos + ang:Forward()*1 + ang:Right()*-1.3)
  67.                         elseif owner:GetNWString( "PModel" ) == "models/player/police.mdl" then
  68.                                 self:SetPos(pos + ang:Forward()*1.5 + ang:Right()*-2)
  69.                         elseif owner:GetNWString( "PModel" ) == "models/player/breen.mdl" then
  70.                                 self:SetPos(pos + ang:Forward()*1 + ang:Right()*-1.3)
  71.                         elseif owner:GetNWString( "PModel" ) == "models/player/group01/male_01.mdl" then
  72.                                 self:SetPos(pos + ang:Forward()*1.5 + ang:Right()*-1.3)
  73.                         elseif owner:GetNWString( "PModel" ) == "models/player/zombie_soldier.mdl" then
  74.                                 self:SetPos(pos + ang:Forward()*0.5 + ang:Right()*-1.3)
  75.                         elseif owner:GetNWString( "PModel" ) == "models/player/group01/male_03.mdl" then
  76.  
  77.                                 self:SetPos(pos + ang:Forward()*1.5 + ang:Right()*-1.3)
  78.                         elseif owner:GetNWString( "PModel" ) == "models/player/group03/female_04.mdl" then
  79.                                 self:SetPos(pos + ang:Forward()*1 + ang:Right()*-1.3)
  80.                         elseif owner:GetNWString( "PModel" ) == "models/player/riot.mdl" then
  81.                                 self:SetPos(pos + ang:Forward()*5 + ang:Right()*-1.5)
  82.                         elseif owner:GetNWString( "PModel" ) == "models/player/group01/male_02.mdl" then
  83.                                 self:SetPos(pos + ang:Forward()*1.5 + ang:Right()*-1.3)
  84.                         elseif owner:GetNWString( "PModel" ) == "models/player/kleiner.mdl" then
  85.                                 self:SetPos(pos + ang:Forward()*1.5 + ang:Right()*-1.7)
  86.                         elseif owner:GetNWString( "PModel" ) == "models/player/group03/female_01.mdl" then
  87.                                 self:SetPos(pos + ang:Forward()*1.5 + ang:Right()*-1.3)
  88.                         elseif owner:GetNWString( "PModel" ) == "models/player/group01/male_09.mdl" then
  89.                                 self:SetPos(pos + ang:Forward()*1.5 + ang:Right()*-1.3)
  90.                         elseif owner:GetNWString( "PModel" ) == "models/player/phoenix.mdl" then
  91.                                 self:SetPos(pos + ang:Forward()*2.5 + ang:Right()*-1.5)
  92.                         elseif owner:GetNWString( "PModel" ) == "models/player/dod_american.mdl" then
  93.                                 self:SetPos(pos + ang:Forward()*2.5 + ang:Right()*-1.5)
  94.                         elseif owner:GetNWString( "PModel" ) == "models/player/group03/male_04.mdl" then
  95.                                 self:SetPos(pos + ang:Forward()*1.5 + ang:Right()*-1.3)
  96.                         elseif owner:GetNWString( "PModel" ) == "models/player/arctic.mdl" then
  97.                                 self:SetPos(pos + ang:Forward()*2.5 + ang:Right()*-1.5)
  98.                         elseif owner:GetNWString( "PModel" ) == "models/player/dod_german.mdl" then
  99.                                 self:SetPos(pos + ang:Forward()*2.5 + ang:Right()*-1.5)
  100.                         elseif owner:GetNWString( "PModel" ) == "models/player/swat.mdl" then
  101.                                 self:SetPos(pos + ang:Forward()*5.5 + ang:Right()*-1.5)
  102.                         elseif owner:GetNWString( "PModel" ) == "models/player/urban.mdl" then
  103.                                 self:SetPos(pos + ang:Forward()*5.5 + ang:Right()*-1.5)
  104.                         elseif owner:GetNWString( "PModel" ) == "models/player/group03/male_01.mdl" then
  105.                                 self:SetPos(pos + ang:Forward()*1.5 + ang:Right()*-1.3)
  106.                         elseif owner:GetNWString( "PModel" ) == "models/player/mossman.mdl" then
  107.                                 self:SetPos(pos + ang:Forward()*1.5 + ang:Right()*-1.7)
  108.                         elseif owner:GetNWString( "PModel" ) == "models/player/group01/male_06.mdl" then
  109.                                 self:SetPos(pos + ang:Forward()*1.5 + ang:Right()*-1.3)
  110.                         elseif owner:GetNWString( "PModel" ) == "models/player/group03/female_02.mdl" then
  111.                                 self:SetPos(pos + ang:Forward()*1.5 + ang:Right()*-1.3)
  112.                         elseif owner:GetNWString( "PModel" ) == "models/player/group01/male_07.mdl" then
  113.                                 self:SetPos(pos + ang:Forward()*1.5 + ang:Right()*-1.3)
  114.                         elseif owner:GetNWString( "PModel" ) == "models/player/combine_super_soldier.mdl" then
  115.                                 self:SetPos(pos + ang:Forward()*2 + ang:Right()*-4)
  116.                         elseif owner:GetNWString( "PModel" ) == "models/player/group01/female_03.mdl" then
  117.                                 self:SetPos(pos + ang:Forward()*1.5 + ang:Right()*-1.3)
  118. elseif owner:GetNWString( "PModel" ) == "models/player/group01/male_08.mdl" then
  119.                                 self:SetPos(pos + ang:Forward()*1.5 + ang:Right()*-1.3)
  120.                         elseif owner:GetNWString( "PModel" ) == "models/player/group01/male_04.mdl" then
  121.                                 self:SetPos(pos + ang:Forward()*1.5 + ang:Right()*-1.3)
  122.                         elseif owner:GetNWString( "PModel" ) == "models/player/group03/female_07.mdl" then
  123.                                 self:SetPos(pos + ang:Forward()*1.5 + ang:Right()*-1.3)
  124.                         elseif owner:GetNWString( "PModel" ) == "models/player/group03/male_02.mdl" then
  125.                                 self:SetPos(pos + ang:Forward()*1.5 + ang:Right()*-1.3)
  126.                         elseif owner:GetNWString( "PModel" ) == "models/player/magnusson.mdl" then
  127.                                 self:SetPos(pos + ang:Forward()*1 + ang:Right()*-2.5)
  128.                         elseif owner:GetNWString( "PModel" ) == "models/player/soldier_stripped.mdl" then
  129.                                 self:SetPos(pos + ang:Forward()*0.8 + ang:Right()*-2.3)
  130.                         elseif owner:GetNWString( "PModel" ) == "models/player/group03/female_06.mdl" then
  131.                                 self:SetPos(pos + ang:Forward()*1.5 + ang:Right()*-1.3)
  132.                         elseif owner:GetNWString( "PModel" ) == "models/player/combine_soldier_prisonguard.mdl" then
  133.                                 self:SetPos(pos + ang:Forward()*1 + ang:Right()*-3.4)
  134.                         elseif owner:GetNWString( "PModel" ) == "models/player/hostage/hostage_01.mdl" then
  135.                                 self:SetPos(pos + ang:Forward()*1 + ang:Right()*-1)
  136.                         elseif owner:GetNWString( "PModel" ) == "models/player/barney.mdl" then
  137.                                 self:SetPos(pos + ang:Forward()*1 + ang:Right()*-1.4)
  138.                         elseif owner:GetNWString( "PModel" ) == "models/player/group03/male_03.mdl" then
  139.                                 self:SetPos(pos + ang:Forward()*1.5 + ang:Right()*-1.3)
  140.                         elseif owner:GetNWString( "PModel" ) == "models/player/group03/male_05.mdl" then
  141.                                 self:SetPos(pos + ang:Forward()*1.5 + ang:Right()*-1.3)
  142.                         elseif owner:GetNWString( "PModel" ) == "models/player/odessa.mdl" then
  143.                                 self:SetPos(pos + ang:Forward()*1 + ang:Right()*-1.4)
  144.                         elseif owner:GetNWString( "PModel" ) == "models/player/group03/male_09.mdl" then
  145.                                 self:SetPos(pos + ang:Forward()*1.5 + ang:Right()*-1.3)
  146.                         elseif owner:GetNWString( "PModel" ) == "models/player/guerilla.mdl" then
  147.                                 self:SetPos(pos + ang:Forward()*3 + ang:Right()*-2)
  148.                         elseif owner:GetNWString( "PModel" ) == "models/player/hostage/hostage_04.mdl" then
  149.                                 self:SetPos(pos + ang:Forward()*1 + ang:Right()*-1)
  150.                         elseif owner:GetNWString( "PModel" ) == "models/player/leet.mdl" then
  151.                                 self:SetPos(pos + ang:Forward()*4 + ang:Right()*-1.5)
  152.                         elseif owner:GetNWString( "PModel" ) == "models/player/group01/male_05.mdl" then
  153.                                 self:SetPos(pos + ang:Forward()*1.5 + ang:Right()*-1.3)
  154.                         elseif owner:GetNWString( "PModel" ) == "models/player/group03/male_08.mdl" then
  155.                                 self:SetPos(pos + ang:Forward()*1.5 + ang:Right()*-1.3)
  156.                         end
  157.  
  158.                         ang:RotateAroundAxis(ang:Right(),-90)
  159.                         ang:RotateAroundAxis(ang:Up(),270)
  160.                         self:SetAngles(ang)
  161.                         self:SetColor( Color(0,0,0,0) )
  162.                         self:DrawModel()
  163.                         return
  164.                 end
  165.  
  166.         local attach = owner:GetAttachment(owner:LookupAttachment("eyes"))
  167.         if not attach then attach = owner:GetAttachment(owner:LookupAttachment("head")) end
  168.         if attach then
  169.                 self:SetPos(attach.Pos)
  170.                 self:SetAngles(attach.Ang)
  171.                 //self:DrawModel()
  172.         end
  173.         end
  174. end
RAW Paste Data