Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SpawniconGenFunctions = {}
- function PositionSpawnIcon( model, pos )
- local mn, mx = model:GetRenderBounds()
- local middle = (mn + mx) * 0.5
- local size = 0
- size = math.max( size, math.abs(mn.x) + math.abs(mx.x) );
- size = math.max( size, math.abs(mn.y) + math.abs(mx.y) );
- size = math.max( size, math.abs(mn.z) + math.abs(mx.z) );
- model:SetPos( pos )
- model:SetAngles( Angle( 0, 180, 0 ) )
- local ModelName = model:GetModel()
- ModelName = string.Replace( ModelName, "--", "/" )
- ModelName = string.Replace( ModelName, "\\", "/" )
- local fnc = SpawniconGenFunctions[ ModelName ]
- if ( fnc ) then return fnc( model, pos, middle, size ) end
- if ( model:LookupAttachment( "eyes" ) > 0 ) then
- return RenderSpawnIcon_Ragdoll( model, pos, middle, size )
- end
- if ( model:LookupAttachment( "head" ) > 0 ) then
- return RenderSpawnIcon_Ragdoll_Head( model, pos, middle, size )
- end
- return RenderSpawnIcon_Prop( model, pos, middle, size )
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement