Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local material = Material( "icon16/stop.png" );
- hook.Add( "HUDPaint", "TB::DrawPoliceStop", function()
- if( #ents.FindByClass( "tb_cracker" ) < 1 || !table.HasValue( TB.Settings.PoliceJobs, RPExtraTeams[ LocalPlayer():Team() ].name ) ) then
- return;
- end
- local _e = ents.FindByClass( "tb_cracker" )[ 1 ];
- local pos = _e:GetPos():ToScreen();
- local dist = _e:GetPos():Distance( LocalPlayer():GetPos() );
- dist = math.Round( ( dist / 17.3 ) - 3, 0 );
- if( dist < 10 ) then
- return;
- end
- surface.SetDrawColor( color_white );
- surface.SetMaterial( material );
- surface.DrawTexturedRect( pos.x, pos.y, 16, 16 );
- draw.SimpleText( "Bank is being robbed! Distance: " .. dist .. "m", "Trebuchet18", pos.x + 18, pos.y - 2, color_white );
- end );
- TB.Door = Entity( 611 );
- net.Receive( "TB::WriteDoor", function( _ )
- TB.Door = Entity( net.ReadFloat() );
- timer.Simple( 20, function()
- if( !IsValid( TB.Door ) ) then
- TB.Door = Entity( 611 );
- end
- end );
- end );
- hook.Add( "PostDrawOpaqueRenderables", "TB::DrawDoorHUD", function()
- if( IsValid( TB.Door ) && LocalPlayer():GetPos():Distance( TB.Door:GetPos() ) < 500 ) then
- local text = TB.Door:GetNWFloat( "cooldown", 0 );
- local clr = Color( 0, 255, 0 );
- if( text == 0 ) then
- text = "Ready";
- else
- text = text - CurTime();
- text = string.FormattedTime( text );
- if( string.len( text.m ) < 2 ) then
- text.m = 0 .. text.m;
- end
- if( string.len( text.s ) < 2 ) then
- text.s = 0 .. text.s;
- end
- text = text.m .. ":" .. text.s;
- clr = Color( 255, 0, 0 );
- end
- local font = "TB::Vault";
- local pos = TB.Door:GetPos();
- local ang = TB.Door:GetAngles();
- local w, h = surface.GetTextSize( text );
- pos = pos + TB.Door:GetRight() * -1;
- pos = pos + TB.Door:GetUp() * 4;
- pos = pos + TB.Door:GetForward() * -3;
- ang:RotateAroundAxis( ang:Forward(), 90 );
- ang:RotateAroundAxis( ang:Right(), 90 );
- surface.SetFont( font );
- local w, h = surface.GetTextSize( text );
- cam.Start3D2D( pos, ang, 0.1 );
- draw.SimpleText( text, font, 9, 9, Color( 0, 0, 0 ), TEXT_ALIGN_CENTER );
- draw.SimpleText( text, font, 10, 10, clr, TEXT_ALIGN_CENTER );
- cam.End3D2D();
- end
- end );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement