Advertisement
Guest User

Untitled

a guest
Nov 2nd, 2014
335
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. SpawniconGenFunctions = {}
  2.  
  3. function PositionSpawnIcon( model, pos )
  4.  
  5. local mn, mx = model:GetRenderBounds()
  6. local middle = (mn + mx) * 0.5
  7. local size = 0
  8. size = math.max( size, math.abs(mn.x) + math.abs(mx.x) );
  9. size = math.max( size, math.abs(mn.y) + math.abs(mx.y) );
  10. size = math.max( size, math.abs(mn.z) + math.abs(mx.z) );
  11.  
  12. model:SetPos( pos )
  13. model:SetAngles( Angle( 0, 180, 0 ) )
  14.  
  15. local ModelName = model:GetModel()
  16. ModelName = string.Replace( ModelName, "--", "/" )
  17. ModelName = string.Replace( ModelName, "\\", "/" )
  18.  
  19. local fnc = SpawniconGenFunctions[ ModelName ]
  20. if ( fnc ) then return fnc( model, pos, middle, size ) end
  21.  
  22. if ( model:LookupAttachment( "eyes" ) > 0 ) then
  23. return RenderSpawnIcon_Ragdoll( model, pos, middle, size )
  24. end
  25.  
  26. if ( model:LookupAttachment( "head" ) > 0 ) then
  27. return RenderSpawnIcon_Ragdoll_Head( model, pos, middle, size )
  28. end
  29.  
  30. return RenderSpawnIcon_Prop( model, pos, middle, size )
  31.  
  32. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement