Advertisement
Guest User

Untitled

a guest
Jan 28th, 2020
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. --why it draws the PlayerModel the whole time when the swep is not selected.. i need to get the model icon disappears when im not in the drawweaponselection
  2.  
  3. function SWEP:DrawWeaponSelection( x, y, wide, tall, alpha )
  4. -- Set us up the texture
  5. surface.SetDrawColor( 255, 255, 255, alpha )
  6. surface.SetMaterial( Material("idcard.png") )
  7.  
  8. -- Lets get a sin wave to make it bounce
  9. local fsin = 0
  10.  
  11.  
  12. -- Borders
  13. y = y + 10
  14. x = x + 10
  15. wide = wide - 20
  16.  
  17. -- Draw that mother
  18. surface.DrawTexturedRect( x + ( fsin ), y - ( fsin ), wide-fsin*2 , ( wide / 2 ) + ( fsin ) )
  19.  
  20. -- Draw weapon info box
  21. self:PrintWeaponInfo( x + wide + 20, y + tall * 0.95, alpha )
  22.  
  23. local LP2 = LocalPlayer()
  24. PIcon2 = PIcon2 or vgui.Create( "DModelPanel")
  25. PIcon2:SetSize(32,32)
  26. PIcon2:SetModel(LP2:GetModel())
  27.  
  28. function PIcon2:LayoutEntity(ent) return end
  29.  
  30. PIcon2:SetPos(x+32,y+98)
  31. local eyepos = PIcon.Entity:GetBonePosition(PIcon2.Entity:LookupBone("ValveBiped.Bip01_Head1"))
  32.  
  33. eyepos:Add(Vector(0, 0, -2)) -- Move up slightly
  34.  
  35. PIcon2:SetLookAt(eyepos)
  36.  
  37. PIcon2:SetCamPos(eyepos-Vector(-20, 0, 0)) -- Move cam in front of eyes
  38.  
  39. PIcon2.Entity:SetEyeTarget(eyepos-Vector(-20, 0, 0))
  40.  
  41.  
  42.  
  43. draw.SimpleText(LP2:Nick(), "davinci_font_small", x+74, y+26, Color( 255, 255, 255, 255 ), TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER )
  44. draw.SimpleText(LP2:SteamID64(), "davinci_font_small", x+74, y+41, Color( 255, 255, 255, 255 ), TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER )
  45. draw.SimpleText(LP2:getDarkRPVar("job"), "davinci_font_small", x+74, y+55, Color( 255, 255, 255, 255 ), TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER )
  46.  
  47.  
  48.  
  49. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement