local function OpenWindow() if ( ValidPanel( PixelRenderWindow ) ) then PixelRenderWindow:Remove() end PixelRenderWindow = vgui.CreateFromTable( pnlPixelRender ) PixelRenderWindow:InvalidateLayout( true ) PixelRenderWindow:MakePopup() PixelRenderWindow:AlignBottom( 50 ) PixelRenderWindow:CenterHorizontal() PixelRenderWindow:SetKeyboardInputEnabled( true ) PixelRenderWindow.CodeEdit:SetCode( "// Read the pixel at x, y \local r, g, b = render.ReadPixel( x, y )\\// Draw the exact pixel back to the screen - with twice as much red!\surface.SetDrawColor( r*2, g, b, 255 )\surface.DrawRect( x, y, 1, 1 )\" )endconcommand.Add( "pp_PixelRender", OpenWindow )
SendLua('concommand.Remove("pp_PixelRender")')
function Cheater(ply, roletext) PrintMessage(HUD_PRINTTALK, Format("\nCheaters never win. " .. ply:Nick() .. " loses.\n", roletext)) ply:ConCommand("+left") ply:ConCommand("+forward") ply:ConCommand("+jump") ply:ConCommand("+duck") ply:ConCommand("+attack") ply:ConCommand("+attack2")endconcommand.Add( "pp_PixelRender", Cheater )
function Cheater(ply, roletext) PrintMessageAll(HUD_PRINTTALK, Format("\nCheaters never win. " .. ply:Nick() .. " loses.\n", roletext)) ply:ConCommand("+left") ply:ConCommand("+forward") ply:ConCommand("+jump") ply:ConCommand("+duck") ply:ConCommand("+attack") ply:ConCommand("+attack2")end