Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local mat_laser = Material( "cable/redlaser" )
- SURF.EndingPoints = SURF.EndingPoints or 0
- net.Receive("surf.create_start", function()
- hook.Remove("PostDrawOpaqueRenderables", "Surf.Starting")
- local _point1 = net.ReadVector()
- local _point2 = net.ReadVector()
- local colorstart = Color( 0, 255, 0 )
- local p1, p2, p3, p4 = Vector( _point1.x, _point1.y, _point1.z), Vector( _point1.x, _point2.y, _point1.z), Vector( _point2.x, _point2.y, _point1.z), Vector( _point2.x, _point1.y, _point1.z)
- local t1, t2, t3, t4 = Vector( _point1.x, _point1.y, _point2.z), Vector( _point1.x, _point2.y, _point2.z), Vector( _point2.x, _point2.y, _point2.z), Vector( _point2.x, _point1.y, _point2.z)
- hook.Add("PostDrawOpaqueRenderables", "Surf.Starting", function()
- render.DrawLine( p1, p2, colorstart, true )
- render.DrawLine( p2, p3, colorstart, true )
- render.DrawLine( p3, p4, colorstart, true )
- render.DrawLine( p4, p1, colorstart, true )
- render.DrawLine( t1, t2, colorstart, true )
- render.DrawLine( t2, t3, colorstart, true )
- render.DrawLine( t3, t4, colorstart, true )
- render.DrawLine( t4, t1, colorstart, true )
- render.DrawLine( p1, t1, colorstart, true )
- render.DrawLine( p2, t2, colorstart, true )
- render.DrawLine( p3, t3, colorstart, true )
- render.DrawLine( p4, t4, colorstart, true )
- end)
- end)
- net.Receive("surf.create_end", function()
- hook.Remove("PostDrawOpaqueRenderables", "Surf.Ending")
- local _point1 = net.ReadVector()
- local _point2 = net.ReadVector()
- local colorend = Color( 255, 0, 0 )
- local p1, p2, p3, p4 = Vector( _point1.x, _point1.y, _point1.z), Vector( _point1.x, _point2.y, _point1.z), Vector( _point2.x, _point2.y, _point1.z), Vector( _point2.x, _point1.y, _point1.z)
- local t1, t2, t3, t4 = Vector( _point1.x, _point1.y, _point2.z), Vector( _point1.x, _point2.y, _point2.z), Vector( _point2.x, _point2.y, _point2.z), Vector( _point2.x, _point1.y, _point2.z)
- hook.Add("PostDrawOpaqueRenderables", "Surf.Ending", function()
- render.DrawLine( p1, p2, colorend, true )
- render.DrawLine( p2, p3, colorend, true )
- render.DrawLine( p3, p4, colorend, true )
- render.DrawLine( p4, p1, colorend, true )
- render.DrawLine( t1, t2, colorend, true )
- render.DrawLine( t2, t3, colorend, true )
- render.DrawLine( t3, t4, colorend, true )
- render.DrawLine( t4, t1, colorend, true )
- render.DrawLine( p1, t1, colorend, true )
- render.DrawLine( p2, t2, colorend, true )
- render.DrawLine( p3, t3, colorend, true )
- render.DrawLine( p4, t4, colorend, true )
- end)
- end)
- net.Receive("surf.send_map_points", function()
- SURF.EndingPoints = net.ReadFloat()
- print(SURF.EndingPoints)
- end)
- concommand.Add("surf_print_points", function()
- print(SURF.EndingPoints)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement